Command line options
This reference describes the syntax of the Hyperledger Besu command line interface (CLI) options.
This reference contains options that apply to both public and private networks. For private-network-specific options, see the private network options reference.
Specify options
You can specify Besu options:
-
On the command line.
besu [OPTIONS] [SUBCOMMAND]
-
As an environment variable. For each command line option, the equivalent environment variable is:
- Uppercase.
_
replaces-
.- Has a
BESU_
prefix.
For example, set
--miner-coinbase
using theBESU_MINER_COINBASE
environment variable. -
In a configuration file.
If you specify an option in more than one place, the order of priority is command line, environment variable, configuration file.
If using Bash or Z shell, you can view option suggestions by entering --
and pressing the Tab key twice.
besu --Tab+Tab
Characters such as smart quotes and long (em) hyphens don't work in Besu command line options. Ensure quotes aren't automatically converted to smart quotes, or double hyphens combined into em hyphens.
Options
api-gas-price-blocks
- Syntax
- Example
- Environment variable
- Example configuration file
--api-gas-price-blocks=<INTEGER>
--api-gas-price-blocks=50
BESU_API_GAS_PRICE_BLOCKS=50
api-gas-price-blocks=50
Number of blocks back from the head block to examine for eth_gasPrice
. The default is 100
.
api-gas-price-max
- Syntax
- Example
- Environment variable
- Example configuration file
--api-gas-price-max=<INTEGER>
--api-gas-price-max=20000
BESU_API_GAS_PRICE_MAX=20000
api-gas-price-max=20000
Maximum gas price to return for eth_gasPrice
, regardless of the percentile value measured. The default is 500000000000
(500 GWei).
api-gas-price-percentile
- Syntax
- Example
- Environment variable
- Example configuration file
--api-gas-price-percentile=<DOUBLE>
--api-gas-price-percentile=75
BESU_API_GAS_PRICE_PERCENTILE=75
api-gas-price-percentile=75
Percentile value to measure for eth_gasPrice
. The default is 50.0
.
For eth_gasPrice
, to return the:
- Highest gas price in
--api-gas-price-blocks
, set to100
. - Lowest gas price in
--api-gas-price-blocks
, set to0
.
auto-log-bloom-caching-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--auto-log-bloom-caching-enabled[=<true|false>]
--auto-log-bloom-caching-enabled=false
BESU_AUTO_LOG_BLOOM_CACHING_ENABLED=false
auto-log-bloom-caching-enabled=false
Enables or disables automatic log bloom caching. APIs such as eth_getLogs
and eth_getFilterLogs
use the cache for improved performance. The default is true
.
If automatic log bloom caching is enabled and a log bloom query reaches the end of the cache, Besu performs an uncached query for logs not yet written to the cache.
Automatic log bloom caching has a small impact on performance. If you are not querying logs blooms for a large number of blocks, you might want to disable automatic log bloom caching.
banned-node-ids
- Syntax
- Example
- Environment variable
- Configuration file
--banned-node-ids=<bannedNodeId>[,<bannedNodeId>...]...
--banned-node-ids=0xc35c3...d615f,0xf42c13...fc456
BESU_BANNED_NODE_IDS=0xc35c3...d615f,0xf42c13...fc456
banned-node-ids=["0xc35c3...d615f","0xf42c13...fc456"]
A list of node IDs with which this node will not peer. The node ID is the public key of the node. You can specify the banned node IDs with or without the 0x
prefix.
The singular --banned-node-id
and plural --banned-node-ids
are available and are two names for the same option.
bonsai-historical-block-limit
- Syntax
- Example
- Environment variable
- Example configuration file
--bonsai-historical-block-limit=256
--bonsai-historical-block-limit=256
BESU_BONSAI_MAXIMUM_BACK_LAYERS_TO_LOAD=256
bonsai-historical-block-limit=256
When using Bonsai Tries, the maximum number of previous blocks for which Bonsai can reconstruct a historical state. The default is 512.
bootnodes
- Syntax
- Example
- Environment variable
- Example configuration file
--bootnodes[=<enode://id@host:port>[,<enode://id@host:port>...]...]
--bootnodes=enode://c35c3...d615f@1.2.3.4:30303,enode://f42c13...fc456@1.2.3.5:30303
BESU_BOOTNODES=enode://c35c3...d615f@1.2.3.4:30303,enode://f42c13...fc456@1.2.3.5:30303
bootnodes=["enode://c35c3...d615f@1.2.3.4:30303","enode://f42c13...fc456@1.2.3.5:30303"]
A list of comma-separated enode URLs for P2P discovery bootstrap.
When connecting to Mainnet or public testnets, the default is a predefined list of enode URLs.
In private networks defined using --genesis-file
or when using --network=dev
, the default is an empty list of bootnodes.
color-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--color-enabled[=<true|false>]
--color-enabled=false
BESU_COLOR_ENABLED=false
color-enabled=false
Enables or disables color output to console. The default is true
.
compatibility-eth64-forkid-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--compatibility-eth64-forkid-enabled[=<true|false>]
--compatibility-eth64-forkid-enabled=true
BESU_COMPATIBILITY_ETH64_FORKID_ENABLED=true
compatibility-eth64-forkid-enabled=true
Enables or disables the legacy Eth/64 fork ID. For any networks with nodes using Besu v1.4 or earlier and nodes using Besu v20.10.1 or later, either:
- All nodes must be upgraded to v20.10.1 or later.
- All nodes using v20.10.1 or later must have
--compatibility-eth64-forkid-enabled
set totrue
.
The default is false
.
If networks have Besu nodes using v1.4 or earlier and other Besu nodes using v20.10.1 or later, the nodes on different versions cannot communicate unless --compatibility-eth64-forkid-enabled
is set to true
.
config-file
- Syntax
- Example
- Environment variable
--config-file=<FILE>
--config-file=/home/me/me_node/config.toml
BESU_CONFIG_FILE=/home/me/me_node/config.toml
The path to the TOML configuration file. The default is none
.
data-path
- Syntax
- Example
- Environment variable
- Configuration file
--data-path=<PATH>
--data-path=/home/me/me_node
BESU_DATA_PATH=/home/me/me_node
data-path="/home/me/me_node"
The path to the Besu data directory. The default is the directory you installed Besu in, or /opt/besu/database
if using the Besu Docker image.
data-storage-format
- Syntax
- Example
- Environment variable
- Configuration file
--data-storage-format=<FORMAT>
--data-storage-format=BONSAI
BESU_DATA_STORAGE_FORMAT=BONSAI
data-storage-format="BONSAI"
The data storage format to use. Set to BONSAI
for Bonsai Tries or FOREST
for Forest of Tries. The default is FOREST
.
discovery-dns-url
- Syntax
- Environment variable
- Example configuration file
--discovery-dns-url=<enrtree URL>
BESU_DISCOVERY_DNS_URL=enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org
discovery-dns-url="enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@nodes.example.org"
The enrtree
URL of the DNS node list for node discovery via DNS. The default is null
.
discovery-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--discovery-enabled[=<true|false>]
--discovery-enabled=false
BESU_DISCOVERY_ENABLED=false
discovery-enabled=false
Enables or disables P2P discovery. The default is true
.
You can override the default DNS server if it's unreliable or doesn't serve TCP DNS requests, using the early access option --Xp2p-dns-discovery-server=<HOST>
.
engine-host-allowlist
- Syntax
- Example
- Environment variable
- Configuration file
--engine-host-allowlist=<hostname>[,<hostname>...]... or "*"
--engine-host-allowlist=localhost,127.0.0.1
BESU_ENGINE_HOST_ALLOWLIST=localhost,127.0.0.1
engine-host-allowlist=["localhost","127.0.0.1"]
A comma-separated list of hostnames to allow for Engine API access (applies to both HTTP and WebSocket).
To allow all hostnames, use "*"
. We don't recommend allowing all hostnames in production environments.
engine-jwt-disabled
- Syntax
- Example
- Environment variable
- Configuration file
--engine-jwt-disabled[=<true|false>]
--engine-jwt-disabled=true
BESU_ENGINE_JWT_DISABLED=true
engine-jwt-disabled=true
Disables or enables authentication for Engine APIs. The default is false
(authentication is enabled by default).
engine-jwt-secret
- Syntax
- Example
- Environment variable
- Configuration file
--engine-jwt-secret=<FILE>
--engine-jwt-secret=jwt.hex
BESU_ENGINE_JWT_SECRET="jwt.hex"
engine-jwt-secret="jwt.hex"
Shared secret used to authenticate consensus clients when using the Engine JSON-RPC API (both HTTP and WebSocket). Contents of file must be at least 32 hex-encoded bytes and not begin with 0x
. May be a relative or absolute path. See an example of how to generate this.
engine-rpc-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--engine-rpc-enabled[=<true|false]>
--engine-rpc-enabled
BESU_ENGINE_RPC_ENABLED=true
engine-rpc-enabled=true
Enables or disables the Engine API. The default is true
.
engine-rpc-port
- Syntax
- Example
- Environment variable
- Configuration file
--engine-rpc-port=<PORT>
--engine-rpc-port=8551
BESU_ENGINE_RPC_PORT=8551
engine-rpc-port="8551"
The listening port for the Engine API calls (ENGINE
, ETH
) for JSON-RPC over HTTP and WebSocket. The default is 8551
.
ethstats
- Syntax
- Example
- Environment variable
- Configuration file
--ethstats=<[ws://|wss://]nodename:secret@host:[port]>
--ethstats=Dev-Node-1:secret@127.0.0.1:3001
BESU_ETHSTATS=Dev-Node-1:secret@127.0.0.1:3001
ethstats="Dev-Node-1:secret@127.0.0.1:3001"
Reporting URL of an Ethstats server. If specified without a port, the default port is 443 for SSL connections and 80 for non-SSL connections.
You can optionally specify ws://
or wss://
in the Ethstats URL.
If you specify this scheme, the connection doesn't need to switch from SSL to non-SSL on each retry logic.
ethstats-cacert-file
- Syntax
- Example
- Environment variable
- Configuration file
--ethstats-cacert-file=<FILE>
--ethstats-cacert-file=./root.cert
BESU_ETHSTATS_CACERT_FILE=./root.cert
ethstats-cacert-file="./root.cert"
Path to the root certificate authority (CA) certificate file of the Ethstats server specified by --ethstats
. This option is useful in non-production environments.
ethstats-contact
- Syntax
- Example
- Environment variable
- Configuration file
--ethstats-contact=<CONTACT>
--ethstats-contact=contact@mail.com
BESU_ETHSTATS_CONTACT=contact@mail.com
ethstats-contact="contact@mail.com"
Contact email address to send to the Ethstats server specified by --ethstats
.
fast-sync-min-peers
- Syntax
- Example
- Environment variable
- Example configuration file
--fast-sync-min-peers=<INTEGER>
--fast-sync-min-peers=8
BESU_FAST_SYNC_MIN_PEERS=8
fast-sync-min-peers=8
The minimum number of peers required before starting fast synchronization in proof of work networks. The default is 5.
This option only applies to proof of work networks.
genesis-file
- Syntax
- Example
- Environment variable
- Configuration file
--genesis-file=<FILE>
--genesis-file=/home/me/me_node/customGenesisFile.json
BESU_GENESIS_FILE=/home/me/me_node/customGenesisFile.json
genesis-file="/home/me/me_node/customGenesisFile.json"
The path to the genesis file.
You can't use the --genesis-file
and --network
options at the same time.
graphql-http-cors-origins
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-http-cors-origins=<graphQLHttpCorsAllowedOrigins>
--graphql-http-cors-origins="http://medomain.com","https://meotherdomain.com"
BESU_GRAPHQL_HTTP_CORS_ORIGINS="http://medomain.com","https://meotherdomain.com"
graphql-http-cors-origins=["http://medomain.com","https://meotherdomain.com"]
A list of comma-separated origin domain URLs for CORS validation. The default is none.
graphql-http-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-http-enabled[=<true|false>]
--graphql-http-enabled
BESU_GRAPHQL_HTTP_ENABLED=true
graphql-http-enabled=true
Enables or disables the GraphQL HTTP service. The default is false
.
The default GraphQL HTTP service endpoint is http://127.0.0.1:8547/graphql
if set to true
.
graphql-http-host
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-http-host=<HOST>
# to listen on all interfaces
--graphql-http-host=0.0.0.0
# to listen on all interfaces
BESU_GRAPHQL_HTTP_HOST=0.0.0.0
graphql-http-host="0.0.0.0"
The host on which GraphQL HTTP listens. The default is 127.0.0.1
.
To allow remote connections, set to 0.0.0.0
.
graphql-http-port
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-http-port=<PORT>
# to listen on port 6175
--graphql-http-port=6175
# to listen on port 6175
BESU_GRAPHQL_HTTP_PORT=6175
graphql-http-port="6175"
The port (TCP) on which GraphQL HTTP listens. The default is 8547
. Ports must be exposed appropriately.
help
- Syntax
-h, --help
Show the help message and exit.
host-allowlist
- Syntax
- Example
- Environment variable
- Configuration file
--host-allowlist=<hostname>[,<hostname>...]... or "*"
--host-allowlist=medomain.com,meotherdomain.com
BESU_HOST_ALLOWLIST=medomain.com,meotherdomain.com
host-allowlist=["medomain.com", "meotherdomain.com"]
A comma-separated list of hostnames to access the JSON-RPC API and pull Besu metrics. By default, Besu accepts requests from localhost
and 127.0.0.1
.
This isn't a permissioning feature. To restrict access to the API, we recommend using the Besu authentication mechanism with username and password authentication or JWT public key authentication.
If using Prometheus to pull metrics from a node, you must specify all the other nodes you want to pull metrics from in the list of allowed hostnames.
To allow all hostnames, use "*"
. We don't recommend allowing all hostnames for production environments.
identity
- Syntax
- Example
- Environment variable
- Configuration file
--identity=<String>
--identity=MyNode
BESU_IDENTITY=MyNode
identity="MyNode"
The name for the node. If specified, it's the second section of the client ID provided by some Ethereum network explorers. For example, in the client ID besu/MyNode/v1.3.4/linux-x86_64/oracle_openjdk-java-11
, the node name is MyNode
.
If a name is not specified, the name section is not included in the client ID. For example, besu/v1.3.4/linux-x86_64/oracle_openjdk-java-11
.
json-pretty-print-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--json-pretty-print-enabled[=<true|false>]
--json-pretty-print-enabled=true
BESU_JSON_PRETTY_PRINT_ENABLED=true
json-pretty-print-enabled=true
Enables or disables the pretty-print output for HTTP and WebSocket responses. The default is false
.
key-value-storage
- Syntax
- Example
- Environment variable
- Configuration file
--key-value-storage=<keyValueStorageName>
--key-value-storage=rocksdb
BESU_KEY_VALUE_STORAGE=rocksdb
key-value-storage="rocksdb"
The key-value storage to use. Use this option only if using a storage system provided with a plugin. The default is rocksdb
.
For development use only, the memory
option provides ephemeral storage for sync testing and debugging.