mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Merge pull request #630 from maticnetwork/arpit/master-to-qa
RPC fix for coinbase address
This commit is contained in:
commit
7217f79767
25 changed files with 479 additions and 213 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
|
||||||
- [The new command line interface](./cli)
|
[The new command line interface (CLI)](./cli) in this version of Bor aims to give users more control over the codebase when interacting with and starting a node. We have made every effort to keep most of the flags similar to the old CLI, except for a few notable changes. One major change is the use of the --config flag, which previously represented fields without available flags. It now represents all flags available to the user, and will overwrite any other flags if provided. As a node operator, you still have the flexibility to modify flags as needed. Please note that this change does not affect the internal functionality of the node, and it remains compatible with Geth and the Ethereum Virtual Machine (EVM).
|
||||||
|
|
||||||
## Additional notes
|
## Additional notes
|
||||||
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
$ bor server <flags>
|
$ bor server <flags>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See [here](./cli/server.md) for more flag details.
|
||||||
|
|
||||||
- The `bor dumpconfig` sub-command prints the default configurations, in the TOML format, on the terminal. One can `pipe (>)` this to a file (say `config.toml`) and use it to start bor.
|
- The `bor dumpconfig` sub-command prints the default configurations, in the TOML format, on the terminal. One can `pipe (>)` this to a file (say `config.toml`) and use it to start bor.
|
||||||
|
|
||||||
- A toml file now can be used instead of flags and can contain all configuration for the node to run. To simply run bor with a configuration file, the following command can be used.
|
- A toml file now can be used instead of flags and can contain all configuration for the node to run. To simply run bor with a configuration file, the following command can be used.
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@
|
||||||
|
|
||||||
- [```server```](./server.md)
|
- [```server```](./server.md)
|
||||||
|
|
||||||
|
- [```snapshot```](./snapshot.md)
|
||||||
|
|
||||||
|
- [```snapshot prune-state```](./snapshot_prune-state.md)
|
||||||
|
|
||||||
- [```status```](./status.md)
|
- [```status```](./status.md)
|
||||||
|
|
||||||
- [```version```](./version.md)
|
- [```version```](./version.md)
|
||||||
|
|
@ -6,4 +6,4 @@ The ```account import``` command imports an account in Json format to the Bor da
|
||||||
|
|
||||||
- ```datadir```: Path of the data directory to store information
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
||||||
- ```keystore```: Path of the data directory to store information
|
- ```keystore```: Path of the data directory to store keys
|
||||||
|
|
@ -6,4 +6,4 @@ The `account list` command lists all the accounts in the Bor data directory.
|
||||||
|
|
||||||
- ```datadir```: Path of the data directory to store information
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
||||||
- ```keystore```: Path of the data directory to store information
|
- ```keystore```: Path of the data directory to store keys
|
||||||
|
|
@ -6,4 +6,4 @@ The `account new` command creates a new local account file on the Bor data direc
|
||||||
|
|
||||||
- ```datadir```: Path of the data directory to store information
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
||||||
- ```keystore```: Path of the data directory to store information
|
- ```keystore```: Path of the data directory to store keys
|
||||||
|
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```listen-addr```: listening address of bootnode (<ip>:<port>)
|
- ```listen-addr```: listening address of bootnode (<ip>:<port>) (default: 0.0.0.0:30303)
|
||||||
|
|
||||||
- ```v5```: Enable UDP v5
|
- ```v5```: Enable UDP v5 (default: false)
|
||||||
|
|
||||||
- ```log-level```: Log level (trace|debug|info|warn|error|crit)
|
- ```log-level```: Log level (trace|debug|info|warn|error|crit) (default: info)
|
||||||
|
|
||||||
- ```nat```: port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
|
- ```nat```: port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: none)
|
||||||
|
|
||||||
- ```node-key```: file or hex node key
|
- ```node-key```: file or hex node key
|
||||||
|
|
||||||
- ```save-key```: path to save the ecdsa private key
|
- ```save-key```: path to save the ecdsa private key
|
||||||
|
|
||||||
- ```dry-run```: validates parameters and prints bootnode configurations, but does not start bootnode
|
- ```dry-run```: validates parameters and prints bootnode configurations, but does not start bootnode (default: false)
|
||||||
|
|
@ -8,6 +8,6 @@ The ```chain sethead <number>``` command sets the current chain to a certain blo
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```yes```: Force set head
|
- ```yes```: Force set head (default: false)
|
||||||
|
|
@ -4,6 +4,6 @@ The ```bor debug block <number>``` command will create an archive containing tra
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```output```: Output directory
|
- ```output```: Output directory
|
||||||
|
|
@ -4,8 +4,8 @@ The ```debug pprof <enode>``` command will create an archive containing bor ppro
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```seconds```: seconds to trace
|
- ```seconds```: seconds to trace (default: 2)
|
||||||
|
|
||||||
- ```output```: Output directory
|
- ```output```: Output directory
|
||||||
|
|
@ -4,6 +4,6 @@ The ```peers add <enode>``` command joins the local client to another remote pee
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```trusted```: Add the peer as a trusted
|
- ```trusted```: Add the peer as a trusted (default: false)
|
||||||
|
|
@ -4,4 +4,4 @@ The ```peers list``` command lists the connected peers.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
@ -4,6 +4,6 @@ The ```peers remove <enode>``` command disconnects the local client from a conne
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```trusted```: Add the peer as a trusted
|
- ```trusted```: Add the peer as a trusted (default: false)
|
||||||
|
|
@ -4,4 +4,4 @@ The ```peers status <peer id>``` command displays the status of a peer by its id
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
@ -4,6 +4,6 @@ The ```bor removedb``` command will remove the blockchain and state databases at
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```address```: Address of the grpc endpoint
|
- ```address```: Address of the grpc endpoint (default: 127.0.0.1:3131)
|
||||||
|
|
||||||
- ```datadir```: Path of the data directory to store information
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
@ -4,49 +4,53 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
- ```chain```: Name of the chain to sync ('mumbai', 'mainnet') or path to a genesis file
|
- ```chain```: Name of the chain to sync ('mumbai', 'mainnet') or path to a genesis file (default: mainnet)
|
||||||
|
|
||||||
- ```identity```: Name/Identity of the node
|
- ```identity```: Name/Identity of the node
|
||||||
|
|
||||||
- ```log-level```: Set log level for the server
|
- ```log-level```: Set log level for the server (default: INFO)
|
||||||
|
|
||||||
- ```datadir```: Path of the data directory to store information
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
||||||
|
- ```datadir.ancient```: Data directory for ancient chain segments (default = inside chaindata)
|
||||||
|
|
||||||
- ```keystore```: Path of the directory where keystores are located
|
- ```keystore```: Path of the directory where keystores are located
|
||||||
|
|
||||||
- ```config```: File for the config file
|
- ```config```: File for the config file
|
||||||
|
|
||||||
- ```syncmode```: Blockchain sync mode (only "full" sync supported)
|
- ```syncmode```: Blockchain sync mode (only "full" sync supported) (default: full)
|
||||||
|
|
||||||
- ```gcmode```: Blockchain garbage collection mode ("full", "archive")
|
- ```gcmode```: Blockchain garbage collection mode ("full", "archive") (default: full)
|
||||||
|
|
||||||
- ```eth.requiredblocks```: Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)
|
- ```eth.requiredblocks```: Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)
|
||||||
|
|
||||||
- ```snapshot```: Enables the snapshot-database mode (default = true)
|
- ```snapshot```: Enables the snapshot-database mode (default: true)
|
||||||
|
|
||||||
- ```bor.logs```: Enables bor log retrieval (default = false)
|
- ```bor.logs```: Enables bor log retrieval (default: false)
|
||||||
|
|
||||||
- ```bor.heimdall```: URL of Heimdall service
|
- ```bor.heimdall```: URL of Heimdall service (default: http://localhost:1317)
|
||||||
|
|
||||||
- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose)
|
- ```bor.withoutheimdall```: Run without Heimdall service (for testing purpose) (default: false)
|
||||||
|
|
||||||
|
- ```bor.heimdallgRPC```: Address of Heimdall gRPC service
|
||||||
|
|
||||||
- ```ethstats```: Reporting URL of a ethstats service (nodename:secret@host:port)
|
- ```ethstats```: Reporting URL of a ethstats service (nodename:secret@host:port)
|
||||||
|
|
||||||
- ```gpo.blocks```: Number of recent blocks to check for gas prices
|
- ```gpo.blocks```: Number of recent blocks to check for gas prices (default: 20)
|
||||||
|
|
||||||
- ```gpo.percentile```: Suggested gas price is the given percentile of a set of recent transaction gas prices
|
- ```gpo.percentile```: Suggested gas price is the given percentile of a set of recent transaction gas prices (default: 60)
|
||||||
|
|
||||||
- ```gpo.maxprice```: Maximum gas price will be recommended by gpo
|
- ```gpo.maxprice```: Maximum gas price will be recommended by gpo (default: 5000000000000)
|
||||||
|
|
||||||
- ```gpo.ignoreprice```: Gas price below which gpo will ignore transactions
|
- ```gpo.ignoreprice```: Gas price below which gpo will ignore transactions (default: 2)
|
||||||
|
|
||||||
- ```disable-bor-wallet```: Disable the personal wallet endpoints
|
- ```disable-bor-wallet```: Disable the personal wallet endpoints (default: true)
|
||||||
|
|
||||||
- ```grpc.addr```: Address and port to bind the GRPC server
|
- ```grpc.addr```: Address and port to bind the GRPC server (default: :3131)
|
||||||
|
|
||||||
- ```dev```: Enable developer mode with ephemeral proof-of-authority network and a pre-funded developer account, mining enabled
|
- ```dev```: Enable developer mode with ephemeral proof-of-authority network and a pre-funded developer account, mining enabled (default: false)
|
||||||
|
|
||||||
- ```dev.period```: Block period to use in developer mode (0 = mine only if transaction pending)
|
- ```dev.period```: Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)
|
||||||
|
|
||||||
### Account Management Options
|
### Account Management Options
|
||||||
|
|
||||||
|
|
@ -54,111 +58,113 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
- ```password```: Password file to use for non-interactive password input
|
- ```password```: Password file to use for non-interactive password input
|
||||||
|
|
||||||
- ```allow-insecure-unlock```: Allow insecure account unlocking when account-related RPCs are exposed by http
|
- ```allow-insecure-unlock```: Allow insecure account unlocking when account-related RPCs are exposed by http (default: false)
|
||||||
|
|
||||||
- ```lightkdf```: Reduce key-derivation RAM & CPU usage at some expense of KDF strength
|
- ```lightkdf```: Reduce key-derivation RAM & CPU usage at some expense of KDF strength (default: false)
|
||||||
|
|
||||||
### Cache Options
|
### Cache Options
|
||||||
|
|
||||||
- ```cache```: Megabytes of memory allocated to internal caching (default = 4096 mainnet full node)
|
- ```cache```: Megabytes of memory allocated to internal caching (default: 1024)
|
||||||
|
|
||||||
- ```cache.database```: Percentage of cache memory allowance to use for database io
|
- ```cache.database```: Percentage of cache memory allowance to use for database io (default: 50)
|
||||||
|
|
||||||
- ```cache.trie```: Percentage of cache memory allowance to use for trie caching (default = 15% full mode, 30% archive mode)
|
- ```cache.trie```: Percentage of cache memory allowance to use for trie caching (default: 15)
|
||||||
|
|
||||||
- ```cache.trie.journal```: Disk journal directory for trie cache to survive node restarts
|
- ```cache.trie.journal```: Disk journal directory for trie cache to survive node restarts (default: triecache)
|
||||||
|
|
||||||
- ```cache.trie.rejournal```: Time interval to regenerate the trie cache journal
|
- ```cache.trie.rejournal```: Time interval to regenerate the trie cache journal (default: 1h0m0s)
|
||||||
|
|
||||||
- ```cache.gc```: Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)
|
- ```cache.gc```: Percentage of cache memory allowance to use for trie pruning (default: 25)
|
||||||
|
|
||||||
- ```cache.snapshot```: Percentage of cache memory allowance to use for snapshot caching (default = 10% full mode, 20% archive mode)
|
- ```cache.snapshot```: Percentage of cache memory allowance to use for snapshot caching (default: 10)
|
||||||
|
|
||||||
- ```cache.noprefetch```: Disable heuristic state prefetch during block import (less CPU and disk IO, more time waiting for data)
|
- ```cache.noprefetch```: Disable heuristic state prefetch during block import (less CPU and disk IO, more time waiting for data) (default: false)
|
||||||
|
|
||||||
- ```cache.preimages```: Enable recording the SHA3/keccak preimages of trie keys
|
- ```cache.preimages```: Enable recording the SHA3/keccak preimages of trie keys (default: false)
|
||||||
|
|
||||||
- ```txlookuplimit```: Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)
|
- ```cache.triesinmemory```: Number of block states (tries) to keep in memory (default = 128) (default: 128)
|
||||||
|
|
||||||
|
- ```txlookuplimit```: Number of recent blocks to maintain transactions index for (default: 2350000)
|
||||||
|
|
||||||
### JsonRPC Options
|
### JsonRPC Options
|
||||||
|
|
||||||
- ```rpc.gascap```: Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)
|
- ```rpc.gascap```: Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite) (default: 50000000)
|
||||||
|
|
||||||
- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)
|
- ```rpc.txfeecap```: Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default: 5)
|
||||||
|
|
||||||
- ```ipcdisable```: Disable the IPC-RPC server
|
- ```ipcdisable```: Disable the IPC-RPC server (default: false)
|
||||||
|
|
||||||
- ```ipcpath```: Filename for IPC socket/pipe within the datadir (explicit paths escape it)
|
- ```ipcpath```: Filename for IPC socket/pipe within the datadir (explicit paths escape it)
|
||||||
|
|
||||||
- ```http.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
- ```http.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced) (default: localhost)
|
||||||
|
|
||||||
- ```http.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
|
- ```http.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: localhost)
|
||||||
|
|
||||||
- ```ws.origins```: Origins from which to accept websockets requests
|
- ```ws.origins```: Origins from which to accept websockets requests (default: localhost)
|
||||||
|
|
||||||
- ```graphql.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
- ```graphql.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced) (default: localhost)
|
||||||
|
|
||||||
- ```graphql.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
|
- ```graphql.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: localhost)
|
||||||
|
|
||||||
- ```http```: Enable the HTTP-RPC server
|
- ```http```: Enable the HTTP-RPC server (default: false)
|
||||||
|
|
||||||
- ```http.addr```: HTTP-RPC server listening interface
|
- ```http.addr```: HTTP-RPC server listening interface (default: localhost)
|
||||||
|
|
||||||
- ```http.port```: HTTP-RPC server listening port
|
- ```http.port```: HTTP-RPC server listening port (default: 8545)
|
||||||
|
|
||||||
- ```http.rpcprefix```: HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
|
- ```http.rpcprefix```: HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
|
||||||
|
|
||||||
- ```http.api```: API's offered over the HTTP-RPC interface
|
- ```http.api```: API's offered over the HTTP-RPC interface (default: eth,net,web3,txpool,bor)
|
||||||
|
|
||||||
- ```ws```: Enable the WS-RPC server
|
- ```ws```: Enable the WS-RPC server (default: false)
|
||||||
|
|
||||||
- ```ws.addr```: WS-RPC server listening interface
|
- ```ws.addr```: WS-RPC server listening interface (default: localhost)
|
||||||
|
|
||||||
- ```ws.port```: WS-RPC server listening port
|
- ```ws.port```: WS-RPC server listening port (default: 8546)
|
||||||
|
|
||||||
- ```ws.rpcprefix```: HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
|
- ```ws.rpcprefix```: HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.
|
||||||
|
|
||||||
- ```ws.api```: API's offered over the WS-RPC interface
|
- ```ws.api```: API's offered over the WS-RPC interface (default: net,web3)
|
||||||
|
|
||||||
- ```graphql```: Enable GraphQL on the HTTP-RPC server. Note that GraphQL can only be started if an HTTP server is started as well.
|
- ```graphql```: Enable GraphQL on the HTTP-RPC server. Note that GraphQL can only be started if an HTTP server is started as well. (default: false)
|
||||||
|
|
||||||
### P2P Options
|
### P2P Options
|
||||||
|
|
||||||
- ```bind```: Network binding address
|
- ```bind```: Network binding address (default: 0.0.0.0)
|
||||||
|
|
||||||
- ```port```: Network listening port
|
- ```port```: Network listening port (default: 30303)
|
||||||
|
|
||||||
- ```bootnodes```: Comma separated enode URLs for P2P discovery bootstrap
|
- ```bootnodes```: Comma separated enode URLs for P2P discovery bootstrap
|
||||||
|
|
||||||
- ```maxpeers```: Maximum number of network peers (network disabled if set to 0)
|
- ```maxpeers```: Maximum number of network peers (network disabled if set to 0) (default: 50)
|
||||||
|
|
||||||
- ```maxpendpeers```: Maximum number of pending connection attempts
|
- ```maxpendpeers```: Maximum number of pending connection attempts (default: 50)
|
||||||
|
|
||||||
- ```nat```: NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
|
- ```nat```: NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: any)
|
||||||
|
|
||||||
- ```nodiscover```: Disables the peer discovery mechanism (manual peer addition)
|
- ```nodiscover```: Disables the peer discovery mechanism (manual peer addition) (default: false)
|
||||||
|
|
||||||
- ```v5disc```: Enables the experimental RLPx V5 (Topic Discovery) mechanism
|
- ```v5disc```: Enables the experimental RLPx V5 (Topic Discovery) mechanism (default: false)
|
||||||
|
|
||||||
### Sealer Options
|
### Sealer Options
|
||||||
|
|
||||||
- ```mine```: Enable mining
|
- ```mine```: Enable mining (default: false)
|
||||||
|
|
||||||
- ```miner.etherbase```: Public address for block mining rewards
|
- ```miner.etherbase```: Public address for block mining rewards
|
||||||
|
|
||||||
- ```miner.extradata```: Block extra data set by the miner (default = client version)
|
- ```miner.extradata```: Block extra data set by the miner (default = client version)
|
||||||
|
|
||||||
- ```miner.gaslimit```: Target gas ceiling (gas limit) for mined blocks
|
- ```miner.gaslimit```: Target gas ceiling (gas limit) for mined blocks (default: 30000000)
|
||||||
|
|
||||||
- ```miner.gasprice```: Minimum gas price for mining a transaction
|
- ```miner.gasprice```: Minimum gas price for mining a transaction (default: 1000000000)
|
||||||
|
|
||||||
### Telemetry Options
|
### Telemetry Options
|
||||||
|
|
||||||
- ```metrics```: Enable metrics collection and reporting
|
- ```metrics```: Enable metrics collection and reporting (default: false)
|
||||||
|
|
||||||
- ```metrics.expensive```: Enable expensive metrics collection and reporting
|
- ```metrics.expensive```: Enable expensive metrics collection and reporting (default: false)
|
||||||
|
|
||||||
- ```metrics.influxdb```: Enable metrics export/push to an external InfluxDB database (v1)
|
- ```metrics.influxdb```: Enable metrics export/push to an external InfluxDB database (v1) (default: false)
|
||||||
|
|
||||||
- ```metrics.influxdb.endpoint```: InfluxDB API endpoint to report metrics to
|
- ```metrics.influxdb.endpoint```: InfluxDB API endpoint to report metrics to
|
||||||
|
|
||||||
|
|
@ -170,11 +176,11 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
- ```metrics.influxdb.tags```: Comma-separated InfluxDB tags (key/values) attached to all measurements
|
- ```metrics.influxdb.tags```: Comma-separated InfluxDB tags (key/values) attached to all measurements
|
||||||
|
|
||||||
- ```metrics.prometheus-addr```: Address for Prometheus Server
|
- ```metrics.prometheus-addr```: Address for Prometheus Server (default: 127.0.0.1:7071)
|
||||||
|
|
||||||
- ```metrics.opencollector-endpoint```: OpenCollector Endpoint (host:port)
|
- ```metrics.opencollector-endpoint```: OpenCollector Endpoint (host:port) (default: 127.0.0.1:4317)
|
||||||
|
|
||||||
- ```metrics.influxdbv2```: Enable metrics export/push to an external InfluxDB v2 database
|
- ```metrics.influxdbv2```: Enable metrics export/push to an external InfluxDB v2 database (default: false)
|
||||||
|
|
||||||
- ```metrics.influxdb.token```: Token to authorize access to the database (v2 only)
|
- ```metrics.influxdb.token```: Token to authorize access to the database (v2 only)
|
||||||
|
|
||||||
|
|
@ -186,22 +192,22 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
- ```txpool.locals```: Comma separated accounts to treat as locals (no flush, priority inclusion)
|
- ```txpool.locals```: Comma separated accounts to treat as locals (no flush, priority inclusion)
|
||||||
|
|
||||||
- ```txpool.nolocals```: Disables price exemptions for locally submitted transactions
|
- ```txpool.nolocals```: Disables price exemptions for locally submitted transactions (default: false)
|
||||||
|
|
||||||
- ```txpool.journal```: Disk journal for local transaction to survive node restarts
|
- ```txpool.journal```: Disk journal for local transaction to survive node restarts (default: transactions.rlp)
|
||||||
|
|
||||||
- ```txpool.rejournal```: Time interval to regenerate the local transaction journal
|
- ```txpool.rejournal```: Time interval to regenerate the local transaction journal (default: 1h0m0s)
|
||||||
|
|
||||||
- ```txpool.pricelimit```: Minimum gas price limit to enforce for acceptance into the pool
|
- ```txpool.pricelimit```: Minimum gas price limit to enforce for acceptance into the pool (default: 1)
|
||||||
|
|
||||||
- ```txpool.pricebump```: Price bump percentage to replace an already existing transaction
|
- ```txpool.pricebump```: Price bump percentage to replace an already existing transaction (default: 10)
|
||||||
|
|
||||||
- ```txpool.accountslots```: Minimum number of executable transaction slots guaranteed per account
|
- ```txpool.accountslots```: Minimum number of executable transaction slots guaranteed per account (default: 16)
|
||||||
|
|
||||||
- ```txpool.globalslots```: Maximum number of executable transaction slots for all accounts
|
- ```txpool.globalslots```: Maximum number of executable transaction slots for all accounts (default: 32768)
|
||||||
|
|
||||||
- ```txpool.accountqueue```: Maximum number of non-executable transaction slots permitted per account
|
- ```txpool.accountqueue```: Maximum number of non-executable transaction slots permitted per account (default: 16)
|
||||||
|
|
||||||
- ```txpool.globalqueue```: Maximum number of non-executable transaction slots for all accounts
|
- ```txpool.globalqueue```: Maximum number of non-executable transaction slots for all accounts (default: 32768)
|
||||||
|
|
||||||
- ```txpool.lifetime```: Maximum amount of time non-executable transaction are queued
|
- ```txpool.lifetime```: Maximum amount of time non-executable transaction are queued (default: 3h0m0s)
|
||||||
5
docs/cli/snapshot.md
Normal file
5
docs/cli/snapshot.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
# snapshot
|
||||||
|
|
||||||
|
The ```snapshot``` command groups snapshot related actions:
|
||||||
|
|
||||||
|
- [```snapshot prune-state```](./snapshot_prune-state.md): Prune state databases at the given datadir location.
|
||||||
21
docs/cli/snapshot_prune-state.md
Normal file
21
docs/cli/snapshot_prune-state.md
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Prune state
|
||||||
|
|
||||||
|
The ```bor snapshot prune-state``` command will prune historical state data with the help of the state snapshot. All trie nodes and contract codes that do not belong to the specified version state will be deleted from the database. After pruning, only two version states are available: genesis and the specific one.
|
||||||
|
|
||||||
|
## Options
|
||||||
|
|
||||||
|
- ```datadir```: Path of the data directory to store information
|
||||||
|
|
||||||
|
- ```keystore```: Path of the data directory to store keys
|
||||||
|
|
||||||
|
- ```datadir.ancient```: Path of the ancient data directory to store information
|
||||||
|
|
||||||
|
- ```bloomfilter.size```: Size of the bloom filter (default: 2048)
|
||||||
|
|
||||||
|
### Cache Options
|
||||||
|
|
||||||
|
- ```cache```: Megabytes of memory allocated to internal caching (default: 1024)
|
||||||
|
|
||||||
|
- ```cache.trie```: Percentage of cache memory allowance to use for trie caching (default: 25)
|
||||||
|
|
||||||
|
- ```cache.trie.journal```: Path of the trie journal directory to store information (default: triecache)
|
||||||
|
|
@ -189,6 +189,16 @@ func Commands() map[string]MarkDownCommandFactory {
|
||||||
Meta2: meta2,
|
Meta2: meta2,
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
|
"snapshot": func() (MarkDownCommand, error) {
|
||||||
|
return &SnapshotCommand{
|
||||||
|
UI: ui,
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
|
"snapshot prune-state": func() (MarkDownCommand, error) {
|
||||||
|
return &PruneStateCommand{
|
||||||
|
Meta: meta,
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,7 +258,7 @@ func (m *Meta) NewFlagSet(n string) *flagset.Flagset {
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "keystore",
|
Name: "keystore",
|
||||||
Value: &m.keyStoreDir,
|
Value: &m.keyStoreDir,
|
||||||
Usage: "Path of the data directory to store information",
|
Usage: "Path of the data directory to store keys",
|
||||||
})
|
})
|
||||||
|
|
||||||
return f
|
return f
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,10 @@ func NewFlagSet(name string) *Flagset {
|
||||||
}
|
}
|
||||||
|
|
||||||
type FlagVar struct {
|
type FlagVar struct {
|
||||||
Name string
|
Name string
|
||||||
Usage string
|
Usage string
|
||||||
Group string
|
Group string
|
||||||
|
Default any
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flagset) addFlag(fl *FlagVar) {
|
func (f *Flagset) addFlag(fl *FlagVar) {
|
||||||
|
|
@ -38,7 +39,11 @@ func (f *Flagset) Help() string {
|
||||||
|
|
||||||
items := []string{}
|
items := []string{}
|
||||||
for _, item := range f.flags {
|
for _, item := range f.flags {
|
||||||
items = append(items, fmt.Sprintf(" -%s\n %s", item.Name, item.Usage))
|
if item.Default != nil {
|
||||||
|
items = append(items, fmt.Sprintf(" -%s\n %s (default: %v)", item.Name, item.Usage, item.Default))
|
||||||
|
} else {
|
||||||
|
items = append(items, fmt.Sprintf(" -%s\n %s", item.Name, item.Usage))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return str + strings.Join(items, "\n\n")
|
return str + strings.Join(items, "\n\n")
|
||||||
|
|
@ -85,7 +90,11 @@ func (f *Flagset) MarkDown() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, item := range groups[k] {
|
for _, item := range groups[k] {
|
||||||
items = append(items, fmt.Sprintf("- ```%s```: %s", item.Name, item.Usage))
|
if item.Default != nil {
|
||||||
|
items = append(items, fmt.Sprintf("- ```%s```: %s (default: %v)", item.Name, item.Usage, item.Default))
|
||||||
|
} else {
|
||||||
|
items = append(items, fmt.Sprintf("- ```%s```: %s", item.Name, item.Usage))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,27 +119,39 @@ type BoolFlag struct {
|
||||||
|
|
||||||
func (f *Flagset) BoolFlag(b *BoolFlag) {
|
func (f *Flagset) BoolFlag(b *BoolFlag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: b.Name,
|
Name: b.Name,
|
||||||
Usage: b.Usage,
|
Usage: b.Usage,
|
||||||
Group: b.Group,
|
Group: b.Group,
|
||||||
|
Default: b.Default,
|
||||||
})
|
})
|
||||||
f.set.BoolVar(b.Value, b.Name, b.Default, b.Usage)
|
f.set.BoolVar(b.Value, b.Name, b.Default, b.Usage)
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringFlag struct {
|
type StringFlag struct {
|
||||||
Name string
|
Name string
|
||||||
Usage string
|
Usage string
|
||||||
Default string
|
Default string
|
||||||
Value *string
|
Value *string
|
||||||
Group string
|
Group string
|
||||||
|
HideDefaultFromDoc bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flagset) StringFlag(b *StringFlag) {
|
func (f *Flagset) StringFlag(b *StringFlag) {
|
||||||
f.addFlag(&FlagVar{
|
if b.Default == "" || b.HideDefaultFromDoc {
|
||||||
Name: b.Name,
|
f.addFlag(&FlagVar{
|
||||||
Usage: b.Usage,
|
Name: b.Name,
|
||||||
Group: b.Group,
|
Usage: b.Usage,
|
||||||
})
|
Group: b.Group,
|
||||||
|
Default: nil,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
f.addFlag(&FlagVar{
|
||||||
|
Name: b.Name,
|
||||||
|
Usage: b.Usage,
|
||||||
|
Group: b.Group,
|
||||||
|
Default: b.Default,
|
||||||
|
})
|
||||||
|
}
|
||||||
f.set.StringVar(b.Value, b.Name, b.Default, b.Usage)
|
f.set.StringVar(b.Value, b.Name, b.Default, b.Usage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,9 +165,10 @@ type IntFlag struct {
|
||||||
|
|
||||||
func (f *Flagset) IntFlag(i *IntFlag) {
|
func (f *Flagset) IntFlag(i *IntFlag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: i.Name,
|
Name: i.Name,
|
||||||
Usage: i.Usage,
|
Usage: i.Usage,
|
||||||
Group: i.Group,
|
Group: i.Group,
|
||||||
|
Default: i.Default,
|
||||||
})
|
})
|
||||||
f.set.IntVar(i.Value, i.Name, i.Default, i.Usage)
|
f.set.IntVar(i.Value, i.Name, i.Default, i.Usage)
|
||||||
}
|
}
|
||||||
|
|
@ -161,18 +183,20 @@ type Uint64Flag struct {
|
||||||
|
|
||||||
func (f *Flagset) Uint64Flag(i *Uint64Flag) {
|
func (f *Flagset) Uint64Flag(i *Uint64Flag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: i.Name,
|
Name: i.Name,
|
||||||
Usage: i.Usage,
|
Usage: i.Usage,
|
||||||
Group: i.Group,
|
Group: i.Group,
|
||||||
|
Default: fmt.Sprintf("%d", i.Default),
|
||||||
})
|
})
|
||||||
f.set.Uint64Var(i.Value, i.Name, i.Default, i.Usage)
|
f.set.Uint64Var(i.Value, i.Name, i.Default, i.Usage)
|
||||||
}
|
}
|
||||||
|
|
||||||
type BigIntFlag struct {
|
type BigIntFlag struct {
|
||||||
Name string
|
Name string
|
||||||
Usage string
|
Usage string
|
||||||
Value *big.Int
|
Value *big.Int
|
||||||
Group string
|
Group string
|
||||||
|
Default *big.Int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BigIntFlag) String() string {
|
func (b *BigIntFlag) String() string {
|
||||||
|
|
@ -204,9 +228,10 @@ func (b *BigIntFlag) Set(value string) error {
|
||||||
|
|
||||||
func (f *Flagset) BigIntFlag(b *BigIntFlag) {
|
func (f *Flagset) BigIntFlag(b *BigIntFlag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: b.Name,
|
Name: b.Name,
|
||||||
Usage: b.Usage,
|
Usage: b.Usage,
|
||||||
Group: b.Group,
|
Group: b.Group,
|
||||||
|
Default: b.Default,
|
||||||
})
|
})
|
||||||
f.set.Var(b, b.Name, b.Usage)
|
f.set.Var(b, b.Name, b.Usage)
|
||||||
}
|
}
|
||||||
|
|
@ -247,11 +272,21 @@ func (i *SliceStringFlag) Set(value string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flagset) SliceStringFlag(s *SliceStringFlag) {
|
func (f *Flagset) SliceStringFlag(s *SliceStringFlag) {
|
||||||
f.addFlag(&FlagVar{
|
if s.Default == nil || len(s.Default) == 0 {
|
||||||
Name: s.Name,
|
f.addFlag(&FlagVar{
|
||||||
Usage: s.Usage,
|
Name: s.Name,
|
||||||
Group: s.Group,
|
Usage: s.Usage,
|
||||||
})
|
Group: s.Group,
|
||||||
|
Default: nil,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
f.addFlag(&FlagVar{
|
||||||
|
Name: s.Name,
|
||||||
|
Usage: s.Usage,
|
||||||
|
Group: s.Group,
|
||||||
|
Default: strings.Join(s.Default, ","),
|
||||||
|
})
|
||||||
|
}
|
||||||
f.set.Var(s, s.Name, s.Usage)
|
f.set.Var(s, s.Name, s.Usage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,33 +300,39 @@ type DurationFlag struct {
|
||||||
|
|
||||||
func (f *Flagset) DurationFlag(d *DurationFlag) {
|
func (f *Flagset) DurationFlag(d *DurationFlag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
Usage: d.Usage,
|
Usage: d.Usage,
|
||||||
Group: d.Group,
|
Group: d.Group,
|
||||||
|
Default: d.Default,
|
||||||
})
|
})
|
||||||
f.set.DurationVar(d.Value, d.Name, d.Default, "")
|
f.set.DurationVar(d.Value, d.Name, d.Default, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
type MapStringFlag struct {
|
type MapStringFlag struct {
|
||||||
Name string
|
Name string
|
||||||
Usage string
|
Usage string
|
||||||
Value *map[string]string
|
Value *map[string]string
|
||||||
Group string
|
Group string
|
||||||
|
Default map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MapStringFlag) String() string {
|
func formatMapString(m map[string]string) string {
|
||||||
if m.Value == nil {
|
if len(m) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
ls := []string{}
|
ls := []string{}
|
||||||
for k, v := range *m.Value {
|
for k, v := range m {
|
||||||
ls = append(ls, k+"="+v)
|
ls = append(ls, k+"="+v)
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Join(ls, ",")
|
return strings.Join(ls, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MapStringFlag) String() string {
|
||||||
|
return formatMapString(*m.Value)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *MapStringFlag) Set(value string) error {
|
func (m *MapStringFlag) Set(value string) error {
|
||||||
if m.Value == nil {
|
if m.Value == nil {
|
||||||
m.Value = &map[string]string{}
|
m.Value = &map[string]string{}
|
||||||
|
|
@ -311,11 +352,21 @@ func (m *MapStringFlag) Set(value string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Flagset) MapStringFlag(m *MapStringFlag) {
|
func (f *Flagset) MapStringFlag(m *MapStringFlag) {
|
||||||
f.addFlag(&FlagVar{
|
if m.Default == nil || len(m.Default) == 0 {
|
||||||
Name: m.Name,
|
f.addFlag(&FlagVar{
|
||||||
Usage: m.Usage,
|
Name: m.Name,
|
||||||
Group: m.Group,
|
Usage: m.Usage,
|
||||||
})
|
Group: m.Group,
|
||||||
|
Default: nil,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
f.addFlag(&FlagVar{
|
||||||
|
Name: m.Name,
|
||||||
|
Usage: m.Usage,
|
||||||
|
Group: m.Group,
|
||||||
|
Default: formatMapString(m.Default),
|
||||||
|
})
|
||||||
|
}
|
||||||
f.set.Var(m, m.Name, m.Usage)
|
f.set.Var(m, m.Name, m.Usage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -329,9 +380,10 @@ type Float64Flag struct {
|
||||||
|
|
||||||
func (f *Flagset) Float64Flag(i *Float64Flag) {
|
func (f *Flagset) Float64Flag(i *Float64Flag) {
|
||||||
f.addFlag(&FlagVar{
|
f.addFlag(&FlagVar{
|
||||||
Name: i.Name,
|
Name: i.Name,
|
||||||
Usage: i.Usage,
|
Usage: i.Usage,
|
||||||
Group: i.Group,
|
Group: i.Group,
|
||||||
|
Default: i.Default,
|
||||||
})
|
})
|
||||||
f.set.Float64Var(i.Value, i.Name, i.Default, "")
|
f.set.Float64Var(i.Value, i.Name, i.Default, "")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,10 @@ type RemoveDBCommand struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
chaindataPath string = "chaindata"
|
chaindataPath string = "chaindata"
|
||||||
ancientPath string = "ancient"
|
ancientPath string = "ancient"
|
||||||
lightchaindataPath string = "lightchaindata"
|
trieCacheJournalPath string = "triecache"
|
||||||
|
lightchaindataPath string = "lightchaindata"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarkDown implements cli.MarkDown interface
|
// MarkDown implements cli.MarkDown interface
|
||||||
|
|
|
||||||
|
|
@ -686,7 +686,7 @@ func (c *Config) loadChain() error {
|
||||||
|
|
||||||
//nolint:gocognit
|
//nolint:gocognit
|
||||||
func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*ethconfig.Config, error) {
|
func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*ethconfig.Config, error) {
|
||||||
dbHandles, err := makeDatabaseHandles()
|
dbHandles, err := MakeDatabaseHandles()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -1075,7 +1075,7 @@ func (c *Config) Merge(cc ...*Config) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeDatabaseHandles() (int, error) {
|
func MakeDatabaseHandles() (int, error) {
|
||||||
limit, err := fdlimit.Maximum()
|
limit, err := fdlimit.Maximum()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1, err
|
return -1, err
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,11 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Default: c.cliConfig.Chain,
|
Default: c.cliConfig.Chain,
|
||||||
})
|
})
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "identity",
|
Name: "identity",
|
||||||
Usage: "Name/Identity of the node",
|
Usage: "Name/Identity of the node",
|
||||||
Value: &c.cliConfig.Identity,
|
Value: &c.cliConfig.Identity,
|
||||||
Default: c.cliConfig.Identity,
|
Default: c.cliConfig.Identity,
|
||||||
|
HideDefaultFromDoc: true,
|
||||||
})
|
})
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "log-level",
|
Name: "log-level",
|
||||||
|
|
@ -28,10 +29,11 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Default: c.cliConfig.LogLevel,
|
Default: c.cliConfig.LogLevel,
|
||||||
})
|
})
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "datadir",
|
Name: "datadir",
|
||||||
Usage: "Path of the data directory to store information",
|
Usage: "Path of the data directory to store information",
|
||||||
Value: &c.cliConfig.DataDir,
|
Value: &c.cliConfig.DataDir,
|
||||||
Default: c.cliConfig.DataDir,
|
Default: c.cliConfig.DataDir,
|
||||||
|
HideDefaultFromDoc: true,
|
||||||
})
|
})
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "datadir.ancient",
|
Name: "datadir.ancient",
|
||||||
|
|
@ -62,19 +64,20 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Default: c.cliConfig.GcMode,
|
Default: c.cliConfig.GcMode,
|
||||||
})
|
})
|
||||||
f.MapStringFlag(&flagset.MapStringFlag{
|
f.MapStringFlag(&flagset.MapStringFlag{
|
||||||
Name: "eth.requiredblocks",
|
Name: "eth.requiredblocks",
|
||||||
Usage: "Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)",
|
Usage: "Comma separated block number-to-hash mappings to require for peering (<number>=<hash>)",
|
||||||
Value: &c.cliConfig.RequiredBlocks,
|
Value: &c.cliConfig.RequiredBlocks,
|
||||||
|
Default: c.cliConfig.RequiredBlocks,
|
||||||
})
|
})
|
||||||
f.BoolFlag(&flagset.BoolFlag{
|
f.BoolFlag(&flagset.BoolFlag{
|
||||||
Name: "snapshot",
|
Name: "snapshot",
|
||||||
Usage: `Enables the snapshot-database mode (default = true)`,
|
Usage: `Enables the snapshot-database mode`,
|
||||||
Value: &c.cliConfig.Snapshot,
|
Value: &c.cliConfig.Snapshot,
|
||||||
Default: c.cliConfig.Snapshot,
|
Default: c.cliConfig.Snapshot,
|
||||||
})
|
})
|
||||||
f.BoolFlag(&flagset.BoolFlag{
|
f.BoolFlag(&flagset.BoolFlag{
|
||||||
Name: "bor.logs",
|
Name: "bor.logs",
|
||||||
Usage: `Enables bor log retrieval (default = false)`,
|
Usage: `Enables bor log retrieval`,
|
||||||
Value: &c.cliConfig.BorLogs,
|
Value: &c.cliConfig.BorLogs,
|
||||||
Default: c.cliConfig.BorLogs,
|
Default: c.cliConfig.BorLogs,
|
||||||
})
|
})
|
||||||
|
|
@ -208,10 +211,11 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Group: "Sealer",
|
Group: "Sealer",
|
||||||
})
|
})
|
||||||
f.BigIntFlag(&flagset.BigIntFlag{
|
f.BigIntFlag(&flagset.BigIntFlag{
|
||||||
Name: "miner.gasprice",
|
Name: "miner.gasprice",
|
||||||
Usage: "Minimum gas price for mining a transaction",
|
Usage: "Minimum gas price for mining a transaction",
|
||||||
Value: c.cliConfig.Sealer.GasPrice,
|
Value: c.cliConfig.Sealer.GasPrice,
|
||||||
Group: "Sealer",
|
Group: "Sealer",
|
||||||
|
Default: c.cliConfig.Sealer.GasPrice,
|
||||||
})
|
})
|
||||||
|
|
||||||
// ethstats
|
// ethstats
|
||||||
|
|
@ -236,20 +240,22 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Default: c.cliConfig.Gpo.Percentile,
|
Default: c.cliConfig.Gpo.Percentile,
|
||||||
})
|
})
|
||||||
f.BigIntFlag(&flagset.BigIntFlag{
|
f.BigIntFlag(&flagset.BigIntFlag{
|
||||||
Name: "gpo.maxprice",
|
Name: "gpo.maxprice",
|
||||||
Usage: "Maximum gas price will be recommended by gpo",
|
Usage: "Maximum gas price will be recommended by gpo",
|
||||||
Value: c.cliConfig.Gpo.MaxPrice,
|
Value: c.cliConfig.Gpo.MaxPrice,
|
||||||
|
Default: c.cliConfig.Gpo.MaxPrice,
|
||||||
})
|
})
|
||||||
f.BigIntFlag(&flagset.BigIntFlag{
|
f.BigIntFlag(&flagset.BigIntFlag{
|
||||||
Name: "gpo.ignoreprice",
|
Name: "gpo.ignoreprice",
|
||||||
Usage: "Gas price below which gpo will ignore transactions",
|
Usage: "Gas price below which gpo will ignore transactions",
|
||||||
Value: c.cliConfig.Gpo.IgnorePrice,
|
Value: c.cliConfig.Gpo.IgnorePrice,
|
||||||
|
Default: c.cliConfig.Gpo.IgnorePrice,
|
||||||
})
|
})
|
||||||
|
|
||||||
// cache options
|
// cache options
|
||||||
f.Uint64Flag(&flagset.Uint64Flag{
|
f.Uint64Flag(&flagset.Uint64Flag{
|
||||||
Name: "cache",
|
Name: "cache",
|
||||||
Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node)",
|
Usage: "Megabytes of memory allocated to internal caching",
|
||||||
Value: &c.cliConfig.Cache.Cache,
|
Value: &c.cliConfig.Cache.Cache,
|
||||||
Default: c.cliConfig.Cache.Cache,
|
Default: c.cliConfig.Cache.Cache,
|
||||||
Group: "Cache",
|
Group: "Cache",
|
||||||
|
|
@ -263,7 +269,7 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
})
|
})
|
||||||
f.Uint64Flag(&flagset.Uint64Flag{
|
f.Uint64Flag(&flagset.Uint64Flag{
|
||||||
Name: "cache.trie",
|
Name: "cache.trie",
|
||||||
Usage: "Percentage of cache memory allowance to use for trie caching (default = 15% full mode, 30% archive mode)",
|
Usage: "Percentage of cache memory allowance to use for trie caching",
|
||||||
Value: &c.cliConfig.Cache.PercTrie,
|
Value: &c.cliConfig.Cache.PercTrie,
|
||||||
Default: c.cliConfig.Cache.PercTrie,
|
Default: c.cliConfig.Cache.PercTrie,
|
||||||
Group: "Cache",
|
Group: "Cache",
|
||||||
|
|
@ -284,14 +290,14 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
})
|
})
|
||||||
f.Uint64Flag(&flagset.Uint64Flag{
|
f.Uint64Flag(&flagset.Uint64Flag{
|
||||||
Name: "cache.gc",
|
Name: "cache.gc",
|
||||||
Usage: "Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)",
|
Usage: "Percentage of cache memory allowance to use for trie pruning",
|
||||||
Value: &c.cliConfig.Cache.PercGc,
|
Value: &c.cliConfig.Cache.PercGc,
|
||||||
Default: c.cliConfig.Cache.PercGc,
|
Default: c.cliConfig.Cache.PercGc,
|
||||||
Group: "Cache",
|
Group: "Cache",
|
||||||
})
|
})
|
||||||
f.Uint64Flag(&flagset.Uint64Flag{
|
f.Uint64Flag(&flagset.Uint64Flag{
|
||||||
Name: "cache.snapshot",
|
Name: "cache.snapshot",
|
||||||
Usage: "Percentage of cache memory allowance to use for snapshot caching (default = 10% full mode, 20% archive mode)",
|
Usage: "Percentage of cache memory allowance to use for snapshot caching",
|
||||||
Value: &c.cliConfig.Cache.PercSnapshot,
|
Value: &c.cliConfig.Cache.PercSnapshot,
|
||||||
Default: c.cliConfig.Cache.PercSnapshot,
|
Default: c.cliConfig.Cache.PercSnapshot,
|
||||||
Group: "Cache",
|
Group: "Cache",
|
||||||
|
|
@ -319,7 +325,7 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
})
|
})
|
||||||
f.Uint64Flag(&flagset.Uint64Flag{
|
f.Uint64Flag(&flagset.Uint64Flag{
|
||||||
Name: "txlookuplimit",
|
Name: "txlookuplimit",
|
||||||
Usage: "Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)",
|
Usage: "Number of recent blocks to maintain transactions index for",
|
||||||
Value: &c.cliConfig.Cache.TxLookupLimit,
|
Value: &c.cliConfig.Cache.TxLookupLimit,
|
||||||
Default: c.cliConfig.Cache.TxLookupLimit,
|
Default: c.cliConfig.Cache.TxLookupLimit,
|
||||||
Group: "Cache",
|
Group: "Cache",
|
||||||
|
|
@ -582,10 +588,11 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Group: "Telemetry",
|
Group: "Telemetry",
|
||||||
})
|
})
|
||||||
f.MapStringFlag(&flagset.MapStringFlag{
|
f.MapStringFlag(&flagset.MapStringFlag{
|
||||||
Name: "metrics.influxdb.tags",
|
Name: "metrics.influxdb.tags",
|
||||||
Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements",
|
Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements",
|
||||||
Value: &c.cliConfig.Telemetry.InfluxDB.Tags,
|
Value: &c.cliConfig.Telemetry.InfluxDB.Tags,
|
||||||
Group: "Telemetry",
|
Group: "Telemetry",
|
||||||
|
Default: c.cliConfig.Telemetry.InfluxDB.Tags,
|
||||||
})
|
})
|
||||||
f.StringFlag(&flagset.StringFlag{
|
f.StringFlag(&flagset.StringFlag{
|
||||||
Name: "metrics.prometheus-addr",
|
Name: "metrics.prometheus-addr",
|
||||||
|
|
|
||||||
183
internal/cli/snapshot.go
Normal file
183
internal/cli/snapshot.go
Normal file
|
|
@ -0,0 +1,183 @@
|
||||||
|
// Snapshot related commands
|
||||||
|
|
||||||
|
package cli
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/core/state/pruner"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/cli/flagset"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/cli/server"
|
||||||
|
"github.com/ethereum/go-ethereum/log"
|
||||||
|
"github.com/ethereum/go-ethereum/node"
|
||||||
|
|
||||||
|
"github.com/mitchellh/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SnapshotCommand is the command to group the snapshot commands
|
||||||
|
type SnapshotCommand struct {
|
||||||
|
UI cli.Ui
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarkDown implements cli.MarkDown interface
|
||||||
|
func (a *SnapshotCommand) MarkDown() string {
|
||||||
|
items := []string{
|
||||||
|
"# snapshot",
|
||||||
|
"The ```snapshot``` command groups snapshot related actions:",
|
||||||
|
"- [```snapshot prune-state```](./snapshot_prune-state.md): Prune state databases at the given datadir location.",
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(items, "\n\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Help implements the cli.Command interface
|
||||||
|
func (c *SnapshotCommand) Help() string {
|
||||||
|
return `Usage: bor snapshot <subcommand>
|
||||||
|
|
||||||
|
This command groups snapshot related actions.
|
||||||
|
|
||||||
|
Prune the state trie:
|
||||||
|
|
||||||
|
$ bor snapshot prune-state`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Synopsis implements the cli.Command interface
|
||||||
|
func (c *SnapshotCommand) Synopsis() string {
|
||||||
|
return "Snapshot related commands"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run implements the cli.Command interface
|
||||||
|
func (c *SnapshotCommand) Run(args []string) int {
|
||||||
|
return cli.RunResultHelp
|
||||||
|
}
|
||||||
|
|
||||||
|
type PruneStateCommand struct {
|
||||||
|
*Meta
|
||||||
|
|
||||||
|
datadirAncient string
|
||||||
|
cache uint64
|
||||||
|
cacheTrie uint64
|
||||||
|
cacheTrieJournal string
|
||||||
|
bloomfilterSize uint64
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarkDown implements cli.MarkDown interface
|
||||||
|
func (c *PruneStateCommand) MarkDown() string {
|
||||||
|
items := []string{
|
||||||
|
"# Prune state",
|
||||||
|
"The ```bor snapshot prune-state``` command will prune historical state data with the help of the state snapshot. All trie nodes and contract codes that do not belong to the specified version state will be deleted from the database. After pruning, only two version states are available: genesis and the specific one.",
|
||||||
|
c.Flags().MarkDown(),
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.Join(items, "\n\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Help implements the cli.Command interface
|
||||||
|
func (c *PruneStateCommand) Help() string {
|
||||||
|
return `Usage: bor snapshot prune-state <datadir>
|
||||||
|
|
||||||
|
This command will prune state databases at the given datadir location` + c.Flags().Help()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Synopsis implements the cli.Command interface
|
||||||
|
func (c *PruneStateCommand) Synopsis() string {
|
||||||
|
return "Prune state databases"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flags: datadir, datadir.ancient, cache.trie.journal, bloomfilter.size
|
||||||
|
func (c *PruneStateCommand) Flags() *flagset.Flagset {
|
||||||
|
flags := c.NewFlagSet("prune-state")
|
||||||
|
|
||||||
|
flags.StringFlag(&flagset.StringFlag{
|
||||||
|
Name: "datadir.ancient",
|
||||||
|
Value: &c.datadirAncient,
|
||||||
|
Usage: "Path of the ancient data directory to store information",
|
||||||
|
Default: "",
|
||||||
|
})
|
||||||
|
|
||||||
|
flags.Uint64Flag(&flagset.Uint64Flag{
|
||||||
|
Name: "cache",
|
||||||
|
Usage: "Megabytes of memory allocated to internal caching",
|
||||||
|
Value: &c.cache,
|
||||||
|
Default: 1024.0,
|
||||||
|
Group: "Cache",
|
||||||
|
})
|
||||||
|
|
||||||
|
flags.Uint64Flag(&flagset.Uint64Flag{
|
||||||
|
Name: "cache.trie",
|
||||||
|
Usage: "Percentage of cache memory allowance to use for trie caching",
|
||||||
|
Value: &c.cacheTrie,
|
||||||
|
Default: 25,
|
||||||
|
Group: "Cache",
|
||||||
|
})
|
||||||
|
|
||||||
|
flags.StringFlag(&flagset.StringFlag{
|
||||||
|
Name: "cache.trie.journal",
|
||||||
|
Value: &c.cacheTrieJournal,
|
||||||
|
Usage: "Path of the trie journal directory to store information",
|
||||||
|
Default: trieCacheJournalPath,
|
||||||
|
Group: "Cache",
|
||||||
|
})
|
||||||
|
|
||||||
|
flags.Uint64Flag(&flagset.Uint64Flag{
|
||||||
|
Name: "bloomfilter.size",
|
||||||
|
Value: &c.bloomfilterSize,
|
||||||
|
Usage: "Size of the bloom filter",
|
||||||
|
Default: 2048,
|
||||||
|
})
|
||||||
|
|
||||||
|
return flags
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run implements the cli.Command interface
|
||||||
|
func (c *PruneStateCommand) Run(args []string) int {
|
||||||
|
flags := c.Flags()
|
||||||
|
|
||||||
|
if err := flags.Parse(args); err != nil {
|
||||||
|
c.UI.Error(err.Error())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
datadir := c.dataDir
|
||||||
|
if datadir == "" {
|
||||||
|
c.UI.Error("datadir is required")
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the node
|
||||||
|
node, err := node.New(&node.Config{
|
||||||
|
DataDir: datadir,
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
c.UI.Error(err.Error())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
dbHandles, err := server.MakeDatabaseHandles()
|
||||||
|
if err != nil {
|
||||||
|
c.UI.Error(err.Error())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
chaindb, err := node.OpenDatabaseWithFreezer(chaindataPath, int(c.cache), dbHandles, c.datadirAncient, "", false)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
c.UI.Error(err.Error())
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
pruner, err := pruner.NewPruner(chaindb, node.ResolvePath(""), node.ResolvePath(c.cacheTrieJournal), c.bloomfilterSize)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Failed to open snapshot tree", "err", err)
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = pruner.Prune(common.Hash{}); err != nil {
|
||||||
|
log.Error("Failed to prune state", "err", err)
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
@ -819,20 +819,6 @@ func (s *PublicBlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.H
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getAuthor: returns the author of the Block
|
|
||||||
func (s *PublicBlockChainAPI) getAuthor(head *types.Header) *common.Address {
|
|
||||||
// get author using Author() function from: /consensus/clique/clique.go
|
|
||||||
// In Production: get author using Author() function from: /consensus/bor/bor.go
|
|
||||||
author, err := s.b.Engine().Author(head)
|
|
||||||
// make sure we don't send error to the user, return 0x0 instead
|
|
||||||
if err != nil {
|
|
||||||
add := common.HexToAddress("0x0000000000000000000000000000000000000000")
|
|
||||||
return &add
|
|
||||||
}
|
|
||||||
// change the coinbase (0x0) with the miner address
|
|
||||||
return &author
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlockByNumber returns the requested canonical block.
|
// GetBlockByNumber returns the requested canonical block.
|
||||||
// - When blockNr is -1 the chain head is returned.
|
// - When blockNr is -1 the chain head is returned.
|
||||||
// - When blockNr is -2 the pending chain head is returned.
|
// - When blockNr is -2 the pending chain head is returned.
|
||||||
|
|
@ -841,7 +827,6 @@ func (s *PublicBlockChainAPI) getAuthor(head *types.Header) *common.Address {
|
||||||
func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) {
|
func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) {
|
||||||
block, err := s.b.BlockByNumber(ctx, number)
|
block, err := s.b.BlockByNumber(ctx, number)
|
||||||
if block != nil && err == nil {
|
if block != nil && err == nil {
|
||||||
|
|
||||||
response, err := s.rpcMarshalBlock(ctx, block, true, fullTx)
|
response, err := s.rpcMarshalBlock(ctx, block, true, fullTx)
|
||||||
if err == nil && number == rpc.PendingBlockNumber {
|
if err == nil && number == rpc.PendingBlockNumber {
|
||||||
// Pending blocks need to nil out a few fields
|
// Pending blocks need to nil out a few fields
|
||||||
|
|
@ -850,12 +835,6 @@ func (s *PublicBlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.B
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil && number != rpc.PendingBlockNumber {
|
|
||||||
author := s.getAuthor(block.Header())
|
|
||||||
|
|
||||||
response["miner"] = author
|
|
||||||
}
|
|
||||||
|
|
||||||
// append marshalled bor transaction
|
// append marshalled bor transaction
|
||||||
if err == nil && response != nil {
|
if err == nil && response != nil {
|
||||||
response = s.appendRPCMarshalBorTransaction(ctx, block, response, fullTx)
|
response = s.appendRPCMarshalBorTransaction(ctx, block, response, fullTx)
|
||||||
|
|
@ -874,10 +853,6 @@ func (s *PublicBlockChainAPI) GetBlockByHash(ctx context.Context, hash common.Ha
|
||||||
response, err := s.rpcMarshalBlock(ctx, block, true, fullTx)
|
response, err := s.rpcMarshalBlock(ctx, block, true, fullTx)
|
||||||
// append marshalled bor transaction
|
// append marshalled bor transaction
|
||||||
if err == nil && response != nil {
|
if err == nil && response != nil {
|
||||||
author := s.getAuthor(block.Header())
|
|
||||||
|
|
||||||
response["miner"] = author
|
|
||||||
|
|
||||||
return s.appendRPCMarshalBorTransaction(ctx, block, response, fullTx), err
|
return s.appendRPCMarshalBorTransaction(ctx, block, response, fullTx), err
|
||||||
}
|
}
|
||||||
return response, err
|
return response, err
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
VersionMajor = 0 // Major version component of the current release
|
VersionMajor = 0 // Major version component of the current release
|
||||||
VersionMinor = 3 // Minor version component of the current release
|
VersionMinor = 3 // Minor version component of the current release
|
||||||
VersionPatch = 1 // Patch version component of the current release
|
VersionPatch = 2 // Patch version component of the current release
|
||||||
VersionMeta = "mumbai" // Version metadata to append to the version string
|
VersionMeta = "beta" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue