Options
This reference describes the syntax of the Besu configuration 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
--rpc-http-enabledusing theBESU_RPC_HTTP_ENABLEDenvironment 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.
block-txs-selection-max-time
- Syntax
- Example
- Environment variable
- Example configuration file
--block-txs-selection-max-time=<INTEGER>
--block-txs-selection-max-time=1700
BESU_BLOCK_TXS_SELECTION_MAX_TIME=1700
block-txs-selection-max-time=1700
The maximum time, in milliseconds, that can be spent selecting transactions to be included in a block.
This value must be less than or equal to the default, 5000.
This option only applies to proof-of-stake and proof-of-work networks.
For proof-of-authority networks, see
--poa-block-txs-selection-max-time.
bonsai-historical-block-limit
- Syntax
- Example
- Environment variable
- Example configuration file
--bonsai-historical-block-limit=<INTEGER>
--bonsai-historical-block-limit=256
BESU_BONSAI_HISTORICAL_BLOCK_LIMIT=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.
If you plan on querying historical blocks or state using the JSON-RPC API, you might need to adjust the default value or your configured value to avoid errors.
bonsai-limit-trie-logs-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--bonsai-limit-trie-logs-enabled=[=<true|false>]
--bonsai-limit-trie-logs-enabled=false
BESU_BONSAI_LIMIT_TRIE_LOGS_ENABLED=false
bonsai-limit-trie-logs-enabled=false
Enables or disables limiting the number of
Bonsai Trie logs that are retained.
When enabled, this limit is set to the value of
--bonsai-historical-block-limit.
The default is true, unless --sync-mode=FULL is set, in which case this option is
disallowed and must be set to false.
bonsai-trie-logs-pruning-window-size
- Syntax
- Example
- Environment variable
- Example configuration file
--bonsai-trie-logs-pruning-window-size=<INTEGER>
--bonsai-trie-logs-pruning-window-size=100000
BESU_BONSAI_TRIE_LOGS_PRUNING_WINDOW_SIZE=100000
bonsai-trie-logs-pruning-window-size=100000
When using --bonsai-limit-trie-logs-enabled, the number of trie
logs to prune during one pruning operation.
A larger value might impact node performance.
The default is 30000.
bootnodes
- Syntax
- Example
- Environment variable
- Example configuration file
--bootnodes[=<source>[,<source>...]...]
--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 sources for P2P discovery bootstrap, where each source can be one of the following:
- A direct enode URL:
enode://<id>@<host>:<port> - A local file path:
/path/to/bootnodes.txt - A file URI:
file:///path/to/bootnodes.txt - An HTTP(S) URL:
https://example.com/bootnodes.txt
Each file or URL must contain one enode URL per line. Blank lines and lines starting with # are ignored.
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.
cache-last-blocks
- Syntax
- Example
- Environment variable
- Example configuration file
--cache-last-blocks=<INTEGER>
--cache-last-blocks=2048
BESU_CACHE_LAST_BLOCKS=2048
cache-last-blocks=2048
The number of recent blocks to cache.
Using this option can improve the performance of several RPC calls including: eth_getBlockByNumber, eth_getBlockByHash, eth_getTransactionReceipt, and especially eth_feeHistory.
The default is 0.
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.
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=FOREST
BESU_DATA_STORAGE_FORMAT=FOREST
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 BONSAI.
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.
era1-data-uri
- Syntax
- Example
- Environment variable
- Configuration file
--era1-data-uri=<URI>
--era1-data-uri=https://mainnet.era1.nimbus.team/
BESU_ERA1_DATA_URI=https://mainnet.era1.nimbus.team/
era1-data-uri="https://mainnet.era1.nimbus.team/"
The URI or local path to attempt to import ERA1 files from. For local files, a simple path may be used
(for example, /home/user/era1). The default is https://mainnet.era1.nimbus.team/.
era1-import-prepipeline-concurrency
- Syntax
- Example
- Environment variable
- Configuration file
--era1-import-prepipeline-concurrency=<INTEGER>
--era1-import-prepipeline-concurrency=2
BESU_ERA1_IMPORT_PREPIPELINE_CONCURRENCY=2
era1-import-prepipeline-concurrency=2
Number of parallel processes used to import ERA1 archive files before full synchronization begins.
Increasing this may improve performance when loading files from remote sources or on systems with
high I/O capacity. The default is 1.
In most cases, we recommend using the default unless slow file downloads are a limiting factor.
era1-import-prepipeline-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--era1-import-prepipeline-enabled[=<Boolean>]
--era1-import-prepipeline-enabled=true
BESU_ERA1_IMPORT_PREPIPELINE_ENABLED=true
era1-import-prepipeline-enabled=true
Enables importing pre-merge blocks from ERA1 archive files before full sync begins. Files are loaded from the location specified by--era1-data-uri (supports local paths and HTTP URLs).
This option only applies when --sync-mode=FULL; it has no effect in other sync modes. The default is false.
Use this to accelerate syncing from genesis or to restore full historical data without relying on peer-to-peer downloads.
estimate-gas-tolerance-ratio
- Syntax
- Example
- Environment variable
- Configuration file
--estimate-gas-tolerance-ratio=<DECIMAL>
--estimate-gas-tolerance-ratio=0.015
BESU_ESTIMATE_GAS_TOLERANCE_RATIO=0.015
estimate-gas-tolerance-ratio=0.015
Defines the tolerance used when estimating gas for the eth_estimateGas JSON-RPC method.
Lower values increase accuracy but take longer to compute.
Higher values speed up estimation but might provide less precise results.
The default is 0.015. Set to 0.0 to disable tolerance and prioritize maximum accuracy.
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.
ethstats-report-interval
- Syntax
- Example
- Environment variable
- Configuration file
--ethstats-report-interval=<INTEGER>
--ethstats-report-interval=10
BESU_ETHSTATS_REPORT_INTERVAL=10
ethstats-report-interval=10
Interval (in seconds) at which Besu sends status updates to the EthStats server.
The default is 5.
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.
genesis-state-hash-cache-enabled
- Syntax
- Example
- Environment variable
- Example configuration file
--genesis-state-hash-cache-enabled=[=<true|false>]
--genesis-state-hash-cache-enabled=true
BESU_GENESIS_STATE_HASH_CACHE_ENABLED=true
genesis-state-hash-cache-enabled=true
Enables or disables fast startup from an existing genesis state hash. The default is false.
Enabling this option avoids validating the genesis state hash, trading off security for faster node startup times. We only recommend using this option if you are certain that you have not modified your genesis file or database and understand the security implications.
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.
graphql-mtls-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-mtls-enabled[=<true|false>]
--graphql-mtls-enabled=true
BESU_GRAPHQL_MTLS_ENABLED=true
graphql-mtls-enabled=true
Enables or disables mTLS for the GraphQL HTTP service.
The default is false.
--graphql-http-enabled must be enabled.
graphql-tls-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-tls-enabled[=<true|false>]
--graphql-tls-enabled=true
BESU_GRAPHQL_TLS_ENABLED=true
graphql-tls-enabled=true
Enables or disables TLS for the GraphQL HTTP service.
The default is false.
--graphql-http-enabled must be enabled.
graphql-tls-keystore-file
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-tls-keystore-file=<FILE>
--graphql-tls-keystore-file=/home/me/me_node/keystore.pfx
BESU_GRAPHQL_TLS_KEYSTORE_FILE=/home/me/me_node/keystore.pfx
graphql-tls-keystore-file="/home/me/me_node/keystore.pfx"
Path to the keystore file when enabling TLS for the GraphQL HTTP service. The keystore file contains the private key and certificate presented to the client during authentication.
Specify the keystore password file using --graphql-tls-keystore-password-file.
graphql-tls-keystore-password-file
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-tls-keystore-password-file=<FILE>
--graphql-tls-keystore-password-file=/home/me/me_node/password
BESU_GRAPHQL_TLS_KEYSTORE_PASSWORD_FILE=/home/me/me_node/password
graphql-tls-keystore-password-file="/home/me/me_node/password"
Path to the file containing the password for the keystore specified in --graphql-tls-keystore-file,
when enabling TLS for the GraphQL HTTP service.
graphql-tls-truststore-file
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-tls-truststore-file=<FILE>
--graphql-tls-truststore-file=/home/me/me_node/truststore.pfx
BESU_GRAPHQL_TLS_TRUSTSTORE_FILE=/home/me/me_node/truststore.pfx
graphql-tls-truststore-file="/home/me/me_node/truststore.pfx"
Path to the truststore file when enabling TLS for the GraphQL HTTP service.
Specify the truststore password file using --graphql-tls-truststore-password-file.
graphql-tls-truststore-password-file
- Syntax
- Example
- Environment variable
- Configuration file
--graphql-tls-truststore-password-file=<FILE>
--graphql-tls-truststore-password-file=/home/me/me_node/password
BESU_GRAPHQL_TLS_TRUSTSTORE_PASSWORD_FILE=/home/me/me_node/password
graphql-tls-truststore-password-file="/home/me/me_node/password"
Path to the file containing the password for the truststore specified in --graphql-tls-truststore-file,
when enabling TLS for the GraphQL HTTP service.
help
- Syntax
-h, --help
Show the help message and exit.
history-expiry-prune
- Syntax
- Example
- Environment variable
- Example configuration file
--history-expiry-prune[=<true|false>]
--history-expiry-prune=true
BESU_HISTORY_EXPIRY_PRUNE=true
history-expiry-prune=true
Enables or disables online pruning of historical block data for pre-merge Proof of Work (PoW) blocks, retaining only the headers. The option also activates garbage collection settings that works for both online and offline pruning mechanisms, so that the reclaimed storage is compacted quickly, freeing disk space without manual intervention.
The default is false.
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.
kzg-trusted-setup
- Syntax
- Example
- Environment variable
- Configuration file
--kzg-trusted-setup=<PATH>
--kzg-trusted-setup=/etc/besu/kzg-trusted-setup.txt
BESU_KZG_TRUSTED_SETUP=/etc/besu/kzg-trusted-setup.txt
kzg-trusted-setup=/etc/besu/kzg-trusted-setup.txt
The path to the C-KZG-4844 trusted setup file. Use this option to pass a custom setup file for custom networks or to override the default setup file for named networks.
logging
- Syntax
- Example
- Environment variable
- Example configuration file
-l, --logging=<LEVEL>
--logging=DEBUG
BESU_LOGGING=DEBUG
logging="DEBUG"
Sets logging verbosity. Log levels are OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL. The default is INFO.
max-peers
- Syntax
- Example
- Environment variable
- Configuration file
--max-peers=<INTEGER>
--max-peers=42
BESU_MAX_PEERS=42
max-peers=42
The maximum number of P2P connections you can establish. The default is 25.
metrics-category
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-category=<metrics-category>[,metrics-category...]...
--metrics-category=BLOCKCHAIN,PEERS,PROCESS
BESU_METRICS_CATEGORY=BLOCKCHAIN,PEERS,PROCESS
metrics-category=["BLOCKCHAIN","PEERS","PROCESS"]
A comma-separated list of categories for which to track metrics. The defaults are BLOCKCHAIN, ETHEREUM, EXECUTORS, JVM, NETWORK, PEERS, PERMISSIONING, PROCESS, PRUNER, RPC, SYNCHRONIZER, and TRANSACTION_POOL.
Other categories are KVSTORE_ROCKSDB, KVSTORE_PRIVATE_ROCKSDB, KVSTORE_ROCKSDB_STATS, and KVSTORE_PRIVATE_ROCKSDB_STATS.
metrics-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-enabled[=<true|false>]
--metrics-enabled
BESU_METRICS_ENABLED=true
metrics-enabled=true
Enables or disables the metrics exporter. The default is false.
You can't specify --metrics-enabled with --metrics-push-enabled. That is, you can enable either Prometheus polling or Prometheus push gateway support, but not both at once.
metrics-host
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-host=<HOST>
--metrics-host=127.0.0.1
BESU_METRICS_HOST=127.0.0.1
metrics-host="127.0.0.1"
The host on which Prometheus accesses Besu metrics. The metrics server respects the --host-allowlist option.
The default is 127.0.0.1.
metrics-port
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-port=<PORT>
--metrics-port=6174
BESU_METRICS_PORT=6174
metrics-port="6174"
The port (TCP) on which Prometheus accesses Besu metrics. The default is 9545. Ports must be exposed appropriately.
metrics-protocol
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-protocol=<metrics-protocol>
--metrics-protocol=OPENTELEMETRY
BESU_METRICS_PROTOCOL=OPENTELEMETRY
metrics-protocol="OPENTELEMETRY"
Metrics protocol to use: PROMETHEUS, OPENTELEMETRY, or NONE. The default is PROMETHEUS.
metrics-push-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-push-enabled[=<true|false>]
--metrics-push-enabled=true
BESU_METRICS_PUSH_ENABLED=true
metrics-push-enabled=true
Enables or disables push gateway integration.
You can't specify --metrics-push-enabled with --metrics-enabled. That is, you can enable either Prometheus polling or Prometheus push gateway support, but not both at once.
metrics-push-host
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-push-host=<HOST>
--metrics-push-host=127.0.0.1
BESU_METRICS_PUSH_HOST=127.0.0.1
metrics-push-host="127.0.0.1"
The host of the Prometheus Push Gateway. The default is 127.0.0.1. The metrics server respects the --host-allowlist option.
When pushing metrics, ensure you set --metrics-push-host to the machine on which the push gateway is. Generally, this is a different machine to the machine on which Besu is running.
metrics-push-interval
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-push-interval=<INTEGER>
--metrics-push-interval=30
BESU_METRICS_PUSH_INTERVAL=30
metrics-push-interval=30
The interval, in seconds, to push metrics when in push mode. The default is 15.
metrics-push-port
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-push-port=<PORT>
--metrics-push-port=6174
BESU_METRICS_PUSH_PORT=6174
metrics-push-port="6174"
The port (TCP) of the Prometheus Push Gateway. The default is 9001. Ports must be exposed appropriately.
metrics-push-prometheus-job
- Syntax
- Example
- Environment variable
- Configuration file
--metrics-push-prometheus-job=<metricsPrometheusJob>
--metrics-push-prometheus-job="my-custom-job"
BESU_METRICS_PUSH_PROMETHEUS_JOB="my-custom-job"
metrics-push-prometheus-job="my-custom-job"
The job name when in push mode. The default is besu-client.
min-block-occupancy-ratio
- Syntax
- Example
- Environment variable
- Configuration file
--min-block-occupancy-ratio=<minBlockOccupancyRatio>
--min-block-occupancy-ratio=0.5
BESU_MIN_BLOCK_OCCUPANCY_RATIO=0.5
min-block-occupancy-ratio="0.5"
Minimum occupancy ratio for a mined block if the transaction pool is not empty. When filling a block during mining, the occupancy ratio indicates the threshold at which the node stops waiting for smaller transactions to fill the remaining space. The default is 0.8.
Besu ignores the --min-block-occupancy-ratio option for proof-of-stake networks, such as Ethereum Mainnet.
min-gas-price
- Syntax
- Example
- Environment variable
- Configuration file
--min-gas-price=<minTransactionGasPrice>
--min-gas-price=1337
BESU_MIN_GAS_PRICE=1337
min-gas-price=1337
The minimum price (in wei) a transaction offers to include it in a mined block.
The minimum gas price is the lowest value eth_gasPrice can return.
The default is 1000.
For a running node, use:
miner_getMinGasPriceto get the value.miner_setMinGasPriceto change the value.
In a free gas network, ensure the minimum
gas price is set to zero for every node.
Any node with a minimum gas price set higher than zero will silently drop transactions with a zero
gas price.
You can query a node's gas configuration using eth_gasPrice.
min-priority-fee
- Syntax
- Example
- Environment variable
- Configuration file
--min-priority-fee=<minPriorityFeePerGas>
--min-priority-fee=7
BESU_MIN_PRIORITY_FEE=7
min-priority-fee=7
The minimum priority fee per gas (in wei) offered by a transaction to be included in a block.
The default is 0.
For a running node, use:
miner_getMinPriorityFeeto get the value.miner_setMinPriorityFeeto change the value.
miner-extra-data
- Syntax
- Example
- Environment variable
- Configuration file
--miner-extra-data=<Extra data>
--miner-extra-data=0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021
BESU_MINER_EXTRA_DATA=0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021
miner-extra-data="0x444F4E27542050414E4943202120484F444C2C20484F444C2C20484F444C2021"
A hex string representing the 32 bytes included in the extra data field of a created block.
The default is 0x.
nat-method
- Syntax
- Example configuration file
--nat-method=UPNP
nat-method="UPNP"
Specify the method for handling NAT environments. The options are:
The default is AUTO. NONE disables NAT functionality.
UPnP support is often disabled by default in networking firmware. If disabled by default, explicitly enable UPnP support.
Use UPNPP2PONLY if you wish to enable UPnP for P2P traffic but not JSON-RPC.
Specifying UPNP might introduce delays during node startup, especially on networks without a UPnP gateway device.
You must specify DOCKER when using the Besu Docker image.
net-restrict
- Syntax
- Example
- Environment variable
- Example configuration file
--net-restrict=<subnet>[,<subnet>,...]
--net-restrict=192.168.1.0/24,10.0.0.0/8
BESU_NET_RESTRICT=192.168.1.0/24,10.0.0.0/8
net-restrict=["192.168.1.0/24","10.0.0.0/8"]
A comma-separated list of allowed IP subnets. Peers whose IP addresses fall within the specified subnets are granted permission to interact with the node. If not specified, no subnet-based peer permission restrictions are applied.
network
- Syntax
- Example
- Environment variable
- Configuration file
--network=<NETWORK>
--network=sepolia
BESU_NETWORK=sepolia
network="sepolia"
The predefined network configuration. The default is mainnet.
Possible values include the following:
| Network | Chain | Type | Default sync mode | Consensus mechanism | Description |
|---|---|---|---|---|---|
mainnet | ETH | Production | SNAP | PoS network | The main Ethereum network |
hoodi | ETH | Test | SNAP | PoS network | Multi-client Ethereum testnet Hoodi |
sepolia | ETH | Test | SNAP | PoS network | Multi-client Ethereum testnet Sepolia |
dev | ETH | Development | FULL | PoW network | Development network with low difficulty to enable local CPU mining |
ephemery | ETH | Test | SNAP | PoS network | Multi-client Ethereum testnet Ephemery |
linea_mainnet | Linea | Production | SNAP | Sequencer-based (zkEVM rollup) | The main Linea network |
linea_sepolia | Linea | Test | SNAP | Sequencer-based (zkEVM rollup) | Linea Sepolia testnet |
lukso | Lukso | Production | SNAP | PoS network | Network for the Lukso chain |
Values are case-insensitive, so either mainnet or MAINNET works.
-
You can't use the
--networkand--genesis-fileoptions at the same time. -
The following networks and testnets are deprecated: ETC Classic, Holesky, and Mordor.
network-id
- Syntax
- Example
- Environment variable
- Configuration file
--network-id=<INTEGER>
--network-id=8675309
BESU_NETWORK_ID=8675309
network-id="8675309"
Use this option to override the default network ID. The default value is the same as the chain ID defined in the genesis file.
node-private-key-file
- Syntax
- Example
- Environment variable
- Configuration file
--node-private-key-file=<FILE>
--node-private-key-file=/home/me/me_node/myPrivateKey
BESU_NODE_PRIVATE_KEY_FILE=/home/me/me_node/myPrivateKey
node-private-key-file="/home/me/me_node/myPrivateKey"
The private key file for the node. The default is the key file in the data directory. If no key file exists, Besu creates a key file containing the generated private key, otherwise, the existing key file specifies the node private key.
The private key is not encrypted.
This option is ignored if --security-module is set to a non-default value.
p2p-enabled
- Syntax
- Example
- Environment variable
- Configuration file
--p2p-enabled[=<true|false>]
--p2p-enabled=false
BESU_P2P_ENABLED=false
p2p-enabled=false
Enables or disables all P2P communication. The default is true.
p2p-host
- Syntax
- Example
- Environment variable
- Configuration file
--p2p-host=<HOST>
# to listen on all interfaces
--p2p-host=0.0.0.0
# to listen on all interfaces
BESU_P2P_HOST=0.0.0.0
p2p-host="0.0.0.0"
The advertised host that can be used to access the node from outside the network in P2P communication. The default is 127.0.0.1.
If --nat-method is set to NONE, --p2p-host is not overridden and must be specified for the node to be accessed from outside the network.
p2p-interface
- Syntax
- Example
- Environment variable
- Configuration file
--p2p-interface=<HOST>
--p2p-interface=192.168.1.132
BESU_P2P_INTERFACE=192.168.1.132
p2p-interface="192.168.1.132"
The network interface on which the node listens for P2P communication. Use the option to specify the required network interface when the device that Besu is running on has multiple network interfaces. The default is 0.0.0.0 (all interfaces).
p2p-port
- Syntax
- Example
- Environment variable
- Configuration file
--p2p-port=<PORT>
# to listen on port 1789
--p2p-port=1789
# to listen on port 1789
BESU_P2P_PORT=1789
p2p-port="1789"
The P2P listening ports (UDP and TCP). The default is 30303. You must expose ports appropriately.