Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the geth command

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use the geth command, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Geth-go-ethereum command line interface

Specific command

The following commands are system-level operation commands, such as managing accounts, import and export functions, which do not start the node itself, but are using the corresponding functions. Only the console command and the attach command enter the js interaction window.

Account management account (for example, add list parameter to realize the address list of this node)

Attach launches an interactive JavaScript environment (connecting to a node), which is commonly used in production environments to start with background processes

Bug escalates to bug Issues (opens the page where github submits the question)

Console starts the interactive JavaScript environment (adding this parameter at startup will go directly to the console interactive page, but this is not recommended)

Copydb creates a local chain from the specified chaindata directory

Dump Dump (analyze) a specific block storage (executable. / geth dump-help view specific commands)

Dumpconfig displays configuration values (you can view the default configuration information for nodes)

Export exports the chunk chain to a file (you can see how to use it through. / geth export-help)

Import imports a blockchain file

Init starts and initializes a new Genesis block (initialized by getting the configuration in the json file)

Js executes the specified JavaScript file (multiple)

License displays license information

Makecache generates ethash validation cache (for testing)

Makedag generates ethash mining DAG (for testing)

Monitor Monitoring and Visualization of Node Index

Removedb deletes the blockchain and state database

Version print version number

Wallet manages Ethereum presale wallets

Help,h displays a list of commands or help commands

ETHEREUM option

The following command is passed when you start geth to specify the appropriate configuration.

-- config value TOML configuration file

-- data directory of datadir "/ home/karalabe/.ethereum" database and keystore key

-- keystore keystore storage directory (default is in datadir)

-- nousb disables monitoring and managing USB hardware wallets

-- networkid value network identifier (integer, 1=Frontier, 2=Morden (deprecated), 3=Ropsten, 4=Rinkeby) (default: 1)

-- testnet Ropsten network: pre-configured POW (proof-of-work) test network

-- rinkeby Rinkeby network: pre-configured POA (proof-of-authority) test network

-syncmode "fast" synchronization mode ("fast", "full", or "light")

-- ethstats value reports to ethstats service URL (nodename:secret@host:port)

-- identity value custom node name

-- maximum percentage of LES request time allowed by lightserv value (0-90) (default: 0)

-- maximum number of LES client peers for lightpeers value (default: 20)

-- lightkdf reduces key-derivation RAM&CPU use when consuming KDF intensity

Developer (mode) option

-- dev uses POA consensus network. By default, it pre-allocates a developer account and automatically starts mining.

-- Mining cycle in dev.period value developer mode (0 = mining in case of pending status transaction) (default: 0)

ETHASH option

-- ethash.cachedir ethash verification cache directory (default = within the datadir directory)

-- the most recent number of ethash caches saved by ethash.cachesinmem value in memory (per cache 16MB) (default: 2)

-- the most recent number of ethash caches saved by ethash.cachesondisk value on disk (per cache 16MB) (default: 3)

-- ethash.dagdir "" save ethash DAGs directory (default = user hom directory)

-- the latest number of ethash DAGs saved by ethash.dagsinmem value in memory (more than each 1GB) (default: 1)

-- the latest number of ethash DAGs saved by ethash.dagsondisk value on disk (more than each 1GB) (default: 2)

Deal Pool option

-- txpool.nolocals disables price exemption for locally submitted transactions

-- disk log of txpool.journal value local transactions: for node restart (default: "transactions.rlp")

-- interval for txpool.rejournal value to regenerate local transaction logs (default: 1 hour)

-- minimum gas price limit for txpool.pricelimit value to join the trading pool (default: 1)

-- percentage of txpool.pricebump value price fluctuation (relative to previous transactions) (default: 10)

-- txpool.accountslots value guarantees the minimum number of executable trading slots per account (default: 16)

-- the maximum number of trading slots that can be executed for all accounts in txpool.globalslots value (default: 4096)

-- maximum number of non-executable trading slots allowed per txpool.accountqueue value account (default: 64)

-- maximum number of non-executable transactions for all txpool.globalqueue value accounts (default: 1024)

-- maximum enlistment time for txpool.lifetime value non-executable transactions (default: 3 hours)

Options for performance tuning

-- number of memory MB allocated by cache value to internal cache, cache value (minimum 16 mb / database mandatory) (default: 128)

-- trie-cache-gens value maintains the number of trie node generated in memory (default: 120)

Account options

-- unlock value needs to unlock accounts separated by commas

-- password value password files for non-interactive password entry

API and console options

-- rpc enables HTTP-RPC server

-- rpcaddr value HTTP-RPC server interface address (default: "localhost")

-- rpcport value HTTP-RPC server listening port (default: 8545)

-- rpcapi value is based on API provided by HTTP-RPC interface

-- ws enables WS-RPC server

-- wsaddr value WS-RPC server listens for interface address (default: "localhost")

-- wsport value WS-RPC server listening port (default: 8546)

-- API provided by wsapi value WS-RPC-based interface

-- wsorigins value websockets request allowed source

-- ipcdisable disables IPC-RPC server

-- ipcpath the name of the IPC socket/pipe file contained in datadir (the escaped explicit path)

-- rpccorsdomain value allows a comma-separated list of domain names for cross-domain requests (browser mandatory)

-- the root path of the jspath loadScript JavaScript load script (default: ".")

-- exec value executes JavaScript statements (can only be used with console/attach)

-- A comma-delimited list of JavaScript files preloaded by preload value into the console

Network option

-- bootnodes value enode urls (comma separated) for P2P discovery boot (v4+v5 instead of light servers)

-- bootnodesv4 value enode urls (comma separated) for P2P v4 discovery boot (light server, full node)

-- bootnodesv5 value enode urls (comma separated) for P2P v5 discovery boot (light server, light node)

-- port value Nic listening port (default: 30303)

-- the maximum number of network nodes in maxpeers value (if set to 0, the network will be disabled) (default: 25)

-- the maximum number of connections attempted by maxpendpeers value (if set to 0, the default value will be used) (default: 0)

-- nat value NAT port mapping mechanism (any | none | upnp | pmp | extip:) (default: "any")

-- nodiscover disables node discovery mechanism (manually add nodes)

-- v5disc enables experimental RLPx V5 (Topic Discovery) mechanism

-- nodekey value P2P node key file

-- nodekeyhex value hexadecimal P2P node key (for testing)

Miner option

-- mine opens mining

-- number of CPU threads used by minerthreads value mining (default: 8)

-- etherbase value mining reward address (default = first created account) (default: "0")

-- targetgaslimit value target gas limit: set the minimum gas limit (below this will not be dug? ) (default: "4712388")

-- the lowest gas price for gasprice value mining to accept the transaction

-- extra block data set by extradata value miners (default = client version)

GAS Price option

-- the number of recent blocks used by gpoblocks value to check gas prices (default: 10)

-- gpopercentile value recommends that the gas price refer to the percentile of the recently traded gas price (default: 50)

Options for virtual machines

-- vmdebug records VM and contract debugging information

Logging and debugging options

-- metrics enables metrics collection and reporting

-- fakepow disables proof-of-work authentication

-- verbosity value log details: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)

-- vmodule value details of each module: separate the list with commas of = (such as eth/*=6,p2p=5)

-- backtrace value request specific logging stack trace (such as "block.go:271")

-- debug highlights the call location log (file name and line number)

-- pprof enables 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 opens memory profiling at a specified frequency (default: 524288)

-- blockprofilerate value opens block profiling at the specified frequency (default: 0)

-- cpuprofile value writes CPU profile to the specified file

-- trace value writes execution trace to the specified file

WHISPER Lab option

-- shh enables Whisper

-- the maximum message size acceptable to shh.maxmessagesize value (default: 1048576)

-- the smallest POW acceptable to shh.pow value (default: 0.2)

Deprecate option

-- fast enables fast synchronization (this mode is used by default when the client starts the first time, and full mode is used the second time)

-- light enables light client mode

Other options

-help,-h, which we often use to show help, that is, the above commands and details

After reading the above, have you mastered how to use the geth command? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report