The forest process has a set of configurable values which determine the behavior of the node. All values can be set through process flags or through a configuration file. If a configuration is provided through the flag and the configuration file, the flag value will be given preference.


When starting forest you can configure the behavior of the process through the use of the following flags:

--configOS File PathPath to TOML file containing configuration
--genesisOS File PathCAR file with genesis state
--rpcBooleanToggles the RPC API on
--portIntegerPort for JSON-RPC communication
--tokenStringClient JWT token to use for JSON-RPC authentication
--metrics-portIntegerPort used for metrics collection server
--kademliaBooleanDetermines whether Kademilia is allowed
--mdnsBooleanDetermines whether MDNS is allowed
--import-snapshotOS File PathPath to snapshot CAR file
--import-chainOS File PathPath to chain CAR file
--skip-loadBooleanSkips loading CAR File and uses header to index chain
--req-windowIntegerSets the number of tipsets requested over chain exchange
--tipset-sample-sizeIntegerNumber of tipsets to include in the sample which determines the network head during synchronization
--target-peer-countIntegerAmount of peers the node should maintain a connection with
--encrypt-keystoreBooleanControls whether the keystore is encrypted

Configuration File

Alternatively, when starting forest you can define a TOML configuration file and provide it to the process with the --config flag or through the FOREST_CONFIG_PATH environment variable.

The following is an sample configuration file:

genesis = "/path/to/genesis/file"
rpc = true
port = 1234
token = "0394j3094jg0394jg34g"
metrics-port = 2345
kademlia = true
mdns = true
import-snapshot = /path/to/snapshot/file
import-chain = /path/to/chain/file
skip-load = false
req-window = 100
tipset-sample-size = 10
target-peer-count = 100
encrypt-keystore = false