Configure node settings
You can customize many features and operations for any Chainweb node that you're responsible for managing, including local development nodes.
You can review the current configuration for a node by displaying or generating a configuration file using the --print-config command-line option.
For example, to display the current configuration settings as standard output, run the following command:
./chainweb-node --print-config
There are two ways you can modify chainweb-node configuration settings:
- By specifying command-line operations.
- By passing one or more configuraiton files when starting the node.
To generate a configuration file that you can then edit, run a command similar to the following:
./chainweb-node --print-config > chainweb-config.yaml
This section provides an overview of settings you can modify in a configuration file.
Configuration settings are loaded in order first from one or more configuration file locations that you specify using --config-file options, then from the command-line options in the order you specify them.
Configuration settings that are loaded later overwrite settings that were previously loaded.
You can specify configuration file locations by providing local file system paths or remote HTTP or HTTPS URLs.
Remote URLs must start with either "http://" or "https://".
For information about modifying configuration settings by specifying command-line options, see chainweb-node command-line.
Chainweb settings
The following settings are defined as properties under the chainweb key.
chainweb:
allowReadsInLocal: false
Set to true if you want to allow read operations in local execution mode.
backup:
api:
configuration: {}
enabled: false
directory: null
Set enabled to true to configure backup settings. By default, the backup API is disabled and there's no backup directory specified.
chainwebVersion: mainnet01
Specifies the Chainweb network identifier. The valid values are development, testnet04, testnet05, and mainnet01. The default is mainnet01.
cuts:
fastForwardBlockHeightLimit: null
fetchTimeout: 3000000
initialBlockHeightLimit: null
pruneChainDatabase: none
In the Kadena network, a cut height represents the distributed state from a Chainweb node.
You can use the settings under the cut key to control the following cut properties:
- fastForwardBlockHeightLimit to set a limit for fast-forwarding the block height (null means no limit).
- fetchTimeout to set a tmeout for fetching cuts in microseconds.
- initialBlockHeightLimit to set an initial block height limit (null means no limit).
- pruneChainDatabase to set a database pruning strategy. You can specify the pruning strategy as none, headers, headers-checked, or full.
enableLocalTimeout: false
Set to true to enable local timeout.
fullHistoricPactState: true
Set to true to maintain full historical Pact state.
gasLimitOfBlock: 150000
Sets the gas limit for each block.
headerStream: false
Set to true to enable header streaming for indexing or streaming data.
logGas: false
Set to true to log gas usage.
mempoolP2p:
configuration:
maxSessionCount: 6
pollInterval: 30
sessionTimeout: 300
enabled: true
You can use the settings under the mempoolP2p key to control the following peer-to-peer mempool properties:
- maxSessionCount to set the maximum number of concurrent sessions.
- pollInterval to set the interval for polling the mempool for pending transactions in seconds.
- sessionTimeout to set the session timeout in seconds.
- enabled to enable or disable the peer-to-peer mempool.
minGasPrice: 1.0e-8
Set the minimum gas price.
mining:
coordination:
enabled: false
limit: 1200
miners: []
payloadRefreshDelay: 15000000
updateStreamLimit: 2000
updateStreamTimeout: 240
nodeMining:
enabled: false
miner:
account: ''
predicate: keys-all
public-keys: []
You can use the settings under the mining key to control the coordinated mining and node mining properties.
In this example, mining is disabled for the node.
moduleCacheLimit: 62914560
Set the module cache limit in bytes.
onlySyncPact: false
Set to true to only synchronize Pact data.
p2p:
bootstrapReachability: 0.5
ignoreBootstrapNodes: false
maxPeerCount: 50
maxSessionCount: 10
peer:
certificateChain: null
certificateChainFile: null
hostaddress:
hostname: 0.0.0.0
port: 1789
interface: '*'
key: null
keyFile: null
peers: []
private: false
sessionTimeout: 240
You can use the settings under the p2p key to control the following peer-to-peer properties:
- bootstrapReachability to set a threshold for bootstrap node reachability.
- maxPeerCount to set the maximum number of peers for the node to communicate with.
- peer to define specific peer settings including host address and port.
- peers to sepcify a list of known peers (empty here).
- private to specify whether the node is private.
pactQueueSize: 2000
Set the size of the Pact queue.
preInsertCheckTimeout: 1000000
Set a timeout for pre-insert checks in microseconds.
readOnlyReplay: false
Set to true to enable read-only replay mode.
reintroTxs: true
Set to true to allow transactions to be reintroduced.
reorgLimit: 480
Set the limit for chain reorganizations.
serviceApi:
interface: '*'
payloadBatchLimit: 1000
port: 1848
validateSpec: false
You can use the settings under the serviceApi key to control the following service API properties:
- interface to specify the network interface to bind to ('*' means all interfaces).
- payloadBatchLimit to set the maximum number of payloads in a batch.
- port to specify the port number to use for the service API.
- validateSpec to specify whether to validate API specifications.
syncPactChains: null
Specify the Pact chains to synchronize (null means all).
throttling:
global: 50.0
mempool: 20.0
putPeer: 11
Set throttling limits for various operations.
Database settings
The following database settings are defined as top-level properties.
databaseDirectory: null
Specify the database directory to use (null means use default).
resetChainDatabases: false
Set to true to reset chain databases on startup.
Logging settings
The following settings are defined as properties under the logging key.
logging:
backend:
color: auto
format: text
handle: stdout
clusterId: null
filter:
default: debug
default-rate: 1
rules: []
logger:
exception_limit: 10
exception_wait: 1000
exit_timeout: 1000000
log_level: info
policy: discard
queue_size: 1000
scope: []
telemetryBackend:
configuration:
color: auto
format: text
handle: stdout
enabled: false
You can use the settings under the logging key to control the following logging properties:
- backend to control log output color, format, and location.
- filter to set log filtering rules.
- logger to set logging rules including log level and queue size.
- telemetryBackend to enable and control telemetry logging.