日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Geth的命令行介绍

發布時間:2025/3/21 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Geth的命令行介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

本文主要是分類的方式將geth的命令行參數,屬性進行介紹和解釋,如有翻譯,理解上的偏差歡迎討論交流。

總覽

$ 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 復制代碼

命令

account 管理賬戶attach 啟動一個交互式的JavaScript環境,(通過連接到遠程節點) bug 打開一個窗口來反饋bugconsole 啟動一個交互式的JavaScript環境copydb 復制一個datadir,需要指定另一個datadir的路徑dump 從區塊鏈上dump指定的區塊dumpconfig 顯示配置信息export 導出區塊信息到文件import 從文件導入區塊信息init 初始化一個新的創世區塊js 執行指定的js文件license 顯示license信息makecache 生成 ethash驗證信息緩存?(用于測試) makedag 生成ethash挖礦DAG(用于測試)monitor 監控,顯示節點指標 removedb 刪除區塊鏈和狀態數據庫version 打印版本號wallet 管理以太坊錢包help, h 顯示所有的命令,和幫助信息 復制代碼

以太坊選項

ETHEREUM OPTIONS:--config value TOML 配置文件--datadir "/home/karalabe/.ethereum" 制定datadir位置--keystore 制定keystore位置(默認在datadir里面)--nousb 關閉監控usb錢包--networkid value 網絡標識符(數字,1=Frontier, 2=Morden (沒有使用), 3=Ropsten, 4=Rinkeby)(默認: 1)--testnet 測試網絡: 預設為工作量證明模式的測試網絡--rinkeby 測試網絡: 預設為權益證明模式的測試網絡--syncmode "fast" 區塊同步模式('fast','full',"light")--ethstats value ethstats服務器的URL(nodename:secret@host:port)--identity value 自定義節點名稱--lightserv value 最大允許的輕量級節點服務百分比 requests (0-90) (default: 0)--lightpeers value 最多允許接入的輕量級節點數量(默認:20--lightkdf 減少秘鑰生成時 內存和cup的使用量? 復制代碼

開發者選項

DEVELOPER CHAIN OPTIONS:--dev 啟動一個 權益證明 方式的網絡,預先存一筆錢到開發者賬戶,并且啟動挖礦 --dev.period value 區塊處理時間?,在開發模式下(0=事務被處理時挖礦) (默認: 0) 復制代碼

ETHASH算法相關選項

部分我也了解的不清楚的,以后再翻譯,或你們指導下我。

ETHASH OPTIONS:--ethash.cachedir 存儲ethash驗證緩存的目錄(目錄:在datadir里面 --ethash.cachesinmem value ethash 保存在內存中的數量,每16mb(默認2) --ethash.cachesondisk value 緩存在磁盤的ethash caches的百分比(默認: 3) --ethash.dagdir "/home/karalabe/.ethash" 存儲ethash挖礦DAG的目錄地址,默認(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) 復制代碼

事務池相關選項

TRANSACTION POOL OPTIONS:--txpool.nolocals 禁止對于本地提交的交易的價格豁免--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 所有賬戶最大非執行事務槽數量 (默認: 1024)--txpool.lifetime value 最大非執行的事務隊列時間總量 (默認: 3h0m0s) 復制代碼

性能調優選項

PERFORMANCE TUNING OPTIONS:--cache value 分配多少給內部緩存(兆字節) (最小 16MB / 數據庫要求) (默認: 128)--trie-cache-gens value 保存在內存中的 trie node數量 (默認: 120) 復制代碼

賬戶相關選項

ACCOUNT OPTIONS:--unlock value 賬戶解鎖,只有這個參數需要交互式輸入密碼--password value 賬戶的密碼,非交互式輸入 復制代碼

控制臺API相關選項

API AND CONSOLE OPTIONS:--rpc 啟動http-rpc 服務 --rpcaddr value http rpc 位于哪一個地址(ip) (默認: "localhost")--rpcport value http rpc 位于哪一個端口 (默認: 8545)--rpcapi value HTTP-RPC 提供哪些服務(可選:personal,db,eth,net,web3等)--ws 啟動 WS-RPC 服務--wsaddr value WS-RPC 位于哪一個地址(ip) (默認: "localhost")--wsport value WS-RPC 位于哪一個端口 (默認: 8546)--wsapi value API's 提供哪些服務(可選:personal,db,eth,net,web3等)--wsorigins value 允許哪些域可以以訪問websockts服務--ipcdisable 禁止 IPC-RPC 服務(windows多節點可選)--ipcpath ipc服務 文件/管道地址 (轉譯后的)--rpccorsdomain value prc服務允許的跨域訪問的地址。--jspath loadScript 執行本地js文件的路徑 (默認 .)--exec value 執行JavaScript --preload value 預加載到控制臺的JavaScript文件列表(逗號分隔) 復制代碼

網絡相關選項

NETWORKING OPTIONS:--bootnodes value 用于P2P發現引導的節點(啟動節點),用逗號隔開(輕量級服務使用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 網絡監聽端口 (默認: 30303)--maxpeers value 最大節點數(設置為0時,網絡被禁用)默認25 --maxpendpeers value 最大連接節點數,默認0 --nat value NAT端口映射機制(any|none|upnp|pmp|extip:<IP>) (默認: "any")--nodiscover 禁止節點發現機制(手工添加)--v5disc Enables the experimental RLPx V5 (Topic Discovery) mechanism--netrestrict value Restricts network communication to the given IP networks (CIDR masks)--nodekey value P2P 節點 秘鑰文件--nodekeyhex value 十六進制的P2P節點密鑰(用于測試) 復制代碼

挖礦相關選項

MINER OPTIONS:--mine 啟動挖礦--minerthreads value 挖礦時啟動的CPU線程數量(默認:8)--etherbase value 挖礦獎勵賬戶(默認account[0])無賬號時默認0 --targetgaslimit value gas限制,低于該值的事務無法被記錄 (默認:4712388) --gasprice "18000000000" 挖礦接受交易的最低gas價格--extradata value 礦工對區塊設置的擴展數據內容,默認客戶端版本號 復制代碼

GAS價格相關選項

GAS PRICE ORACLE OPTIONS: --gpoblocks value 通過最近的塊數量來計算gas價格 (默認: 10) --gpopercentile value 參考近期交易區塊gas價格的百分比來計算gas價格 (默認: 50) 復制代碼

虛擬機相關選項

VIRTUAL MACHINE OPTIONS:--vmdebug 記錄VM和合約相關的debug信息 復制代碼

日志和調試相關選項

LOGGING AND DEBUGGING OPTIONS:--metrics 啟動指標收集和報告 --fakepow 關閉POW工作量證明驗證 --nocompaction 輸入框導入后禁止壓縮? Disables db compaction after import--verbosity value 日志等級 0=安靜, 1=錯誤, 2=警告, 3=info, 4=debug, 5=詳細 (默認: 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 突出顯示調用位置日志(文件名及行號)--pprof 啟動pprof http服務(一種go語言的調試服務器) --pprofaddr value pprof HTTP 服務監聽ip (默認: "127.0.0.1")--pprofport value pprof HTTP 服務監聽端口 (默認: 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 將錯誤信息寫給定的文件中 復制代碼

WHISPER相關選項

WHISPER 是一種信息檢索協議,它允許節點間直接以一種安全的形式互發信息,并對第三方組織窺探者隱藏發送者和接收者的信息。 引用:

WHISPER (EXPERIMENTAL) OPTIONS:--shh 啟動 Whisper--shh.maxmessagesize value 最大接收的消息大小 (默認: 1048576)--shh.pow value 可接受的最小的POW (默認值: 0.2) 復制代碼

被棄用的選項

DEPRECATED OPTIONS:--fast 開啟快速同步--light 啟用輕客戶端模式 復制代碼

幫助和版權

MISC OPTIONS:--help, -h 顯示幫助 COPYRIGHT:Copyright 2013-2017 The go-ethereum Authors 復制代碼

參考了http://www.h3399.cn/201711/201789.html的翻譯內容,加上自己的一些理解,無法做到信雅達,但求多交流指正。

Command-Line-Options

以太坊客戶端Geth命令用法-參數詳解

轉載于:https://juejin.im/post/5a29eb9ef265da433562aa7e

總結

以上是生活随笔為你收集整理的Geth的命令行介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。