Geth的命令行介绍
生活随笔
收集整理的這篇文章主要介紹了
Geth的命令行介绍
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
前言
本文主要是分類的方式將geth的命令行參數(shù),屬性進(jìn)行介紹和解釋,如有翻譯,理解上的偏差歡迎討論交流。
總覽
$ geth help NAME:geth - the go-ethereum command line interfaceCopyright 2013-2017 The go-ethereum AuthorsUSAGE:geth [options] command [command options] [arguments...]VERSION:1.7.3-stableCOMMANDS:account Manage accountsattach Start an interactive JavaScript environment (connect to node)bug opens a window to report a bug on the geth repoconsole Start an interactive JavaScript environmentcopydb Create a local chain from a target chaindata folderdump Dump a specific block from storagedumpconfig Show configuration valuesexport Export blockchain into fileimport Import a blockchain fileinit Bootstrap and initialize a new genesis blockjs Execute the specified JavaScript fileslicense Display license informationmakecache Generate ethash verification cache (for testing)makedag Generate ethash mining DAG (for testing)monitor Monitor and visualize node metricsremovedb Remove blockchain and state databasesversion Print version numberswallet Manage Ethereum presale walletshelp, h Shows a list of commands or help for one commandETHEREUM OPTIONS:--config value TOML configuration file--datadir "/home/karalabe/.ethereum" Data directory for the databases and keystore--keystore Directory for the keystore (default = inside the datadir)--nousb Disables monitoring for and managing USB hardware wallets--networkid value Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby) (default: 1)--testnet Ropsten network: pre-configured proof-of-work test network--rinkeby Rinkeby network: pre-configured proof-of-authority test network--syncmode "fast" Blockchain sync mode ("fast", "full", or "light")--ethstats value Reporting URL of a ethstats service (nodename:secret@host:port)--identity value Custom node name--lightserv value Maximum percentage of time allowed for serving LES requests (0-90) (default: 0)--lightpeers value Maximum number of LES client peers (default: 20)--lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strengthDEVELOPER CHAIN OPTIONS:--dev Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled--dev.period value Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)ETHASH OPTIONS:--ethash.cachedir Directory to store the ethash verification caches (default = inside the datadir)--ethash.cachesinmem value Number of recent ethash caches to keep in memory (16MB each) (default: 2)--ethash.cachesondisk value Number of recent ethash caches to keep on disk (16MB each) (default: 3)--ethash.dagdir "/home/karalabe/.ethash" Directory to store the ethash mining DAGs (default = inside home folder)--ethash.dagsinmem value Number of recent ethash mining DAGs to keep in memory (1+GB each) (default: 1)--ethash.dagsondisk value Number of recent ethash mining DAGs to keep on disk (1+GB each) (default: 2)TRANSACTION POOL OPTIONS:--txpool.nolocals Disables price exemptions for locally submitted transactions--txpool.journal value Disk journal for local transaction to survive node restarts (default: "transactions.rlp")--txpool.rejournal value Time interval to regenerate the local transaction journal (default: 1h0m0s)--txpool.pricelimit value Minimum gas price limit to enforce for acceptance into the pool (default: 1)--txpool.pricebump value Price bump percentage to replace an already existing transaction (default: 10)--txpool.accountslots value Minimum number of executable transaction slots guaranteed per account (default: 16)--txpool.globalslots value Maximum number of executable transaction slots for all accounts (default: 4096)--txpool.accountqueue value Maximum number of non-executable transaction slots permitted per account (default: 64)--txpool.globalqueue value Maximum number of non-executable transaction slots for all accounts (default: 1024)--txpool.lifetime value Maximum amount of time non-executable transaction are queued (default: 3h0m0s)PERFORMANCE TUNING OPTIONS:--cache value Megabytes of memory allocated to internal caching (min 16MB / database forced) (default: 128)--trie-cache-gens value Number of trie node generations to keep in memory (default: 120)ACCOUNT OPTIONS:--unlock value Comma separated list of accounts to unlock--password value Password file to use for non-interactive password inputAPI AND CONSOLE OPTIONS:--rpc Enable the HTTP-RPC server--rpcaddr value HTTP-RPC server listening interface (default: "localhost")--rpcport value HTTP-RPC server listening port (default: 8545)--rpcapi value API's offered over the HTTP-RPC interface--ws Enable the WS-RPC server--wsaddr value WS-RPC server listening interface (default: "localhost")--wsport value WS-RPC server listening port (default: 8546)--wsapi value API's offered over the WS-RPC interface--wsorigins value Origins from which to accept websockets requests--ipcdisable Disable the IPC-RPC server--ipcpath Filename for IPC socket/pipe within the datadir (explicit paths escape it)--rpccorsdomain value Comma separated list of domains from which to accept cross origin requests (browser enforced)--jspath loadScript JavaScript root path for loadScript (default: ".")--exec value Execute JavaScript statement--preload value Comma separated list of JavaScript files to preload into the consoleNETWORKING OPTIONS:--bootnodes value Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)--bootnodesv4 value Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)--bootnodesv5 value Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)--port value Network listening port (default: 30303)--maxpeers value Maximum number of network peers (network disabled if set to 0) (default: 25)--maxpendpeers value Maximum number of pending connection attempts (defaults used if set to 0) (default: 0)--nat value NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: "any")--nodiscover Disables the peer discovery mechanism (manual peer addition)--v5disc Enables the experimental RLPx V5 (Topic Discovery) mechanism--netrestrict value Restricts network communication to the given IP networks (CIDR masks)--nodekey value P2P node key file--nodekeyhex value P2P node key as hex (for testing)MINER OPTIONS:--mine Enable mining--minerthreads value Number of CPU threads to use for mining (default: 8)--etherbase value Public address for block mining rewards (default = first account created) (default: "0")--targetgaslimit value Target gas limit sets the artificial target gas floor for the blocks to mine (default: 4712388)--gasprice "18000000000" Minimal gas price to accept for mining a transactions--extradata value Block extra data set by the miner (default = client version)GAS PRICE ORACLE OPTIONS:--gpoblocks value Number of recent blocks to check for gas prices (default: 10)--gpopercentile value Suggested gas price is the given percentile of a set of recent transaction gas prices (default: 50)VIRTUAL MACHINE OPTIONS:--vmdebug Record information useful for VM and contract debuggingLOGGING AND DEBUGGING OPTIONS:--metrics Enable metrics collection and reporting--fakepow Disables proof-of-work verification--nocompaction Disables db compaction after import--verbosity value Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)--vmodule value Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)--backtrace value Request a stack trace at a specific logging statement (e.g. "block.go:271")--debug Prepends log messages with call-site location (file and line number)--pprof Enable the pprof HTTP server--pprofaddr value pprof HTTP server listening interface (default: "127.0.0.1")--pprofport value pprof HTTP server listening port (default: 6060)--memprofilerate value Turn on memory profiling with the given rate (default: 524288)--blockprofilerate value Turn on block profiling with the given rate (default: 0)--cpuprofile value Write CPU profile to the given file--trace value Write execution trace to the given fileWHISPER (EXPERIMENTAL) OPTIONS:--shh Enable Whisper--shh.maxmessagesize value Max message size accepted (default: 1048576)--shh.pow value Minimum POW accepted (default: 0.2)DEPRECATED OPTIONS:--fast Enable fast syncing through state downloads--light Enable light client modeMISC OPTIONS:--help, -h show helpCOPYRIGHT:Copyright 2013-2017 The go-ethereum Authors 復(fù)制代碼命令
account 管理賬戶attach 啟動一個交互式的JavaScript環(huán)境,(通過連接到遠(yuǎn)程節(jié)點) bug 打開一個窗口來反饋bugconsole 啟動一個交互式的JavaScript環(huán)境copydb 復(fù)制一個datadir,需要指定另一個datadir的路徑dump 從區(qū)塊鏈上dump指定的區(qū)塊dumpconfig 顯示配置信息export 導(dǎo)出區(qū)塊信息到文件import 從文件導(dǎo)入?yún)^(qū)塊信息init 初始化一個新的創(chuàng)世區(qū)塊js 執(zhí)行指定的js文件license 顯示license信息makecache 生成 ethash驗證信息緩存?(用于測試) makedag 生成ethash挖礦DAG(用于測試)monitor 監(jiān)控,顯示節(jié)點指標(biāo) removedb 刪除區(qū)塊鏈和狀態(tài)數(shù)據(jù)庫version 打印版本號wallet 管理以太坊錢包help, h 顯示所有的命令,和幫助信息 復(fù)制代碼以太坊選項
ETHEREUM OPTIONS:--config value TOML 配置文件--datadir "/home/karalabe/.ethereum" 制定datadir位置--keystore 制定keystore位置(默認(rèn)在datadir里面)--nousb 關(guān)閉監(jiān)控usb錢包--networkid value 網(wǎng)絡(luò)標(biāo)識符(數(shù)字,1=Frontier, 2=Morden (沒有使用), 3=Ropsten, 4=Rinkeby)(默認(rèn): 1)--testnet 測試網(wǎng)絡(luò): 預(yù)設(shè)為工作量證明模式的測試網(wǎng)絡(luò)--rinkeby 測試網(wǎng)絡(luò): 預(yù)設(shè)為權(quán)益證明模式的測試網(wǎng)絡(luò)--syncmode "fast" 區(qū)塊同步模式('fast','full',"light")--ethstats value ethstats服務(wù)器的URL(nodename:secret@host:port)--identity value 自定義節(jié)點名稱--lightserv value 最大允許的輕量級節(jié)點服務(wù)百分比 requests (0-90) (default: 0)--lightpeers value 最多允許接入的輕量級節(jié)點數(shù)量(默認(rèn):20--lightkdf 減少秘鑰生成時 內(nèi)存和cup的使用量? 復(fù)制代碼開發(fā)者選項
DEVELOPER CHAIN OPTIONS:--dev 啟動一個 權(quán)益證明 方式的網(wǎng)絡(luò),預(yù)先存一筆錢到開發(fā)者賬戶,并且啟動挖礦 --dev.period value 區(qū)塊處理時間?,在開發(fā)模式下(0=事務(wù)被處理時挖礦) (默認(rèn): 0) 復(fù)制代碼ETHASH算法相關(guān)選項
部分我也了解的不清楚的,以后再翻譯,或你們指導(dǎo)下我。
ETHASH OPTIONS:--ethash.cachedir 存儲ethash驗證緩存的目錄(目錄:在datadir里面 --ethash.cachesinmem value ethash 保存在內(nèi)存中的數(shù)量,每16mb(默認(rèn)2) --ethash.cachesondisk value 緩存在磁盤的ethash caches的百分比(默認(rèn): 3) --ethash.dagdir "/home/karalabe/.ethash" 存儲ethash挖礦DAG的目錄地址,默認(rèn)(home目錄) --ethash.dagsinmem value Number of recent ethash mining DAGs to keep in memory (1+GB each) (default: 1)--ethash.dagsondisk value Number of recent ethash mining DAGs to keep on disk (1+GB each) (default: 2) 復(fù)制代碼事務(wù)池相關(guān)選項
TRANSACTION POOL OPTIONS:--txpool.nolocals 禁止對于本地提交的交易的價格豁免--txpool.journal value 本地事務(wù)磁盤日志(用于磁盤重啟?)Disk journal for local transaction to survive node restarts (default: "transactions.rlp")--txpool.rejournal value Time interval to regenerate the local transaction journal (default: 1h0m0s)--txpool.pricelimit value Minimum gas price limit to enforce for acceptance into the pool (default: 1)--txpool.pricebump value Price bump percentage to replace an already existing transaction (default: 10)--txpool.accountslots value Minimum number of executable transaction slots guaranteed per account (default: 16)--txpool.globalslots value Maximum number of executable transaction slots for all accounts (default: 4096)--txpool.accountqueue value Maximum number of non-executable transaction slots permitted per account (default: 64)--txpool.globalqueue value 所有賬戶最大非執(zhí)行事務(wù)槽數(shù)量 (默認(rèn): 1024)--txpool.lifetime value 最大非執(zhí)行的事務(wù)隊列時間總量 (默認(rèn): 3h0m0s) 復(fù)制代碼性能調(diào)優(yōu)選項
PERFORMANCE TUNING OPTIONS:--cache value 分配多少給內(nèi)部緩存(兆字節(jié)) (最小 16MB / 數(shù)據(jù)庫要求) (默認(rèn): 128)--trie-cache-gens value 保存在內(nèi)存中的 trie node數(shù)量 (默認(rèn): 120) 復(fù)制代碼賬戶相關(guān)選項
ACCOUNT OPTIONS:--unlock value 賬戶解鎖,只有這個參數(shù)需要交互式輸入密碼--password value 賬戶的密碼,非交互式輸入 復(fù)制代碼控制臺API相關(guān)選項
API AND CONSOLE OPTIONS:--rpc 啟動http-rpc 服務(wù) --rpcaddr value http rpc 位于哪一個地址(ip) (默認(rèn): "localhost")--rpcport value http rpc 位于哪一個端口 (默認(rèn): 8545)--rpcapi value HTTP-RPC 提供哪些服務(wù)(可選:personal,db,eth,net,web3等)--ws 啟動 WS-RPC 服務(wù)--wsaddr value WS-RPC 位于哪一個地址(ip) (默認(rèn): "localhost")--wsport value WS-RPC 位于哪一個端口 (默認(rèn): 8546)--wsapi value API's 提供哪些服務(wù)(可選:personal,db,eth,net,web3等)--wsorigins value 允許哪些域可以以訪問websockts服務(wù)--ipcdisable 禁止 IPC-RPC 服務(wù)(windows多節(jié)點可選)--ipcpath ipc服務(wù) 文件/管道地址 (轉(zhuǎn)譯后的)--rpccorsdomain value prc服務(wù)允許的跨域訪問的地址。--jspath loadScript 執(zhí)行本地js文件的路徑 (默認(rèn) .)--exec value 執(zhí)行JavaScript --preload value 預(yù)加載到控制臺的JavaScript文件列表(逗號分隔) 復(fù)制代碼網(wǎng)絡(luò)相關(guān)選項
NETWORKING OPTIONS:--bootnodes value 用于P2P發(fā)現(xiàn)引導(dǎo)的節(jié)點(啟動節(jié)點),用逗號隔開(輕量級服務(wù)使用v4+v5代替) Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)--bootnodesv4 value Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)--bootnodesv5 value Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)--port value 網(wǎng)絡(luò)監(jiān)聽端口 (默認(rèn): 30303)--maxpeers value 最大節(jié)點數(shù)(設(shè)置為0時,網(wǎng)絡(luò)被禁用)默認(rèn)25 --maxpendpeers value 最大連接節(jié)點數(shù),默認(rèn)0 --nat value NAT端口映射機(jī)制(any|none|upnp|pmp|extip:<IP>) (默認(rèn): "any")--nodiscover 禁止節(jié)點發(fā)現(xiàn)機(jī)制(手工添加)--v5disc Enables the experimental RLPx V5 (Topic Discovery) mechanism--netrestrict value Restricts network communication to the given IP networks (CIDR masks)--nodekey value P2P 節(jié)點 秘鑰文件--nodekeyhex value 十六進(jìn)制的P2P節(jié)點密鑰(用于測試) 復(fù)制代碼挖礦相關(guān)選項
MINER OPTIONS:--mine 啟動挖礦--minerthreads value 挖礦時啟動的CPU線程數(shù)量(默認(rèn):8)--etherbase value 挖礦獎勵賬戶(默認(rèn)account[0])無賬號時默認(rèn)0 --targetgaslimit value gas限制,低于該值的事務(wù)無法被記錄 (默認(rèn):4712388) --gasprice "18000000000" 挖礦接受交易的最低gas價格--extradata value 礦工對區(qū)塊設(shè)置的擴(kuò)展數(shù)據(jù)內(nèi)容,默認(rèn)客戶端版本號 復(fù)制代碼GAS價格相關(guān)選項
GAS PRICE ORACLE OPTIONS: --gpoblocks value 通過最近的塊數(shù)量來計算gas價格 (默認(rèn): 10) --gpopercentile value 參考近期交易區(qū)塊gas價格的百分比來計算gas價格 (默認(rèn): 50) 復(fù)制代碼虛擬機(jī)相關(guān)選項
VIRTUAL MACHINE OPTIONS:--vmdebug 記錄VM和合約相關(guān)的debug信息 復(fù)制代碼日志和調(diào)試相關(guān)選項
LOGGING AND DEBUGGING OPTIONS:--metrics 啟動指標(biāo)收集和報告 --fakepow 關(guān)閉POW工作量證明驗證 --nocompaction 輸入框?qū)牒蠼箟嚎s? Disables db compaction after import--verbosity value 日志等級 0=安靜, 1=錯誤, 2=警告, 3=info, 4=debug, 5=詳細(xì) (默認(rèn): 3)--vmodule value Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)--backtrace value Request a stack trace at a specific logging statement (e.g. "block.go:271")--debug 突出顯示調(diào)用位置日志(文件名及行號)--pprof 啟動pprof http服務(wù)(一種go語言的調(diào)試服務(wù)器) --pprofaddr value pprof HTTP 服務(wù)監(jiān)聽ip (默認(rèn): "127.0.0.1")--pprofport value pprof HTTP 服務(wù)監(jiān)聽端口 (默認(rèn): 6060)--memprofilerate value Turn on memory profiling with the given rate (default: 524288)--blockprofilerate value Turn on block profiling with the given rate (default: 0)--cpuprofile value 將cpuWrite CPU profile to the given file--trace value 將錯誤信息寫給定的文件中 復(fù)制代碼WHISPER相關(guān)選項
WHISPER 是一種信息檢索協(xié)議,它允許節(jié)點間直接以一種安全的形式互發(fā)信息,并對第三方組織窺探者隱藏發(fā)送者和接收者的信息。 引用:
WHISPER (EXPERIMENTAL) OPTIONS:--shh 啟動 Whisper--shh.maxmessagesize value 最大接收的消息大小 (默認(rèn): 1048576)--shh.pow value 可接受的最小的POW (默認(rèn)值: 0.2) 復(fù)制代碼被棄用的選項
DEPRECATED OPTIONS:--fast 開啟快速同步--light 啟用輕客戶端模式 復(fù)制代碼幫助和版權(quán)
MISC OPTIONS:--help, -h 顯示幫助 COPYRIGHT:Copyright 2013-2017 The go-ethereum Authors 復(fù)制代碼參考了http://www.h3399.cn/201711/201789.html的翻譯內(nèi)容,加上自己的一些理解,無法做到信雅達(dá),但求多交流指正。
Command-Line-Options
以太坊客戶端Geth命令用法-參數(shù)詳解
轉(zhuǎn)載于:https://juejin.im/post/5a29eb9ef265da433562aa7e
總結(jié)
以上是生活随笔為你收集整理的Geth的命令行介绍的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hibernate中many-to-on
- 下一篇: Svg 嵌入可编辑的div