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.