How To Configure

CodeChain can be configured with either CLI options or a config file. When it comes to which options take precedence, it goes from CLI, user’s own config.toml file, and in that order.

CLI options can be listed by running the command $codechain --help. By using the CLI options, or custom config files, the user can overwrite’s configurations.

Config File

The default preset file can be located in codechain/config/presets/

Config files can be customized by the user and its location can be designated by using the CLI command --config. Custom config files created by the user must have the proper custom path.


The following represents the default configuration values of

quiet = false
db_path = "db"
keys_path = "keys"
chain = "solo"


disable = false
port = 3485
max_peers = 30
min_peers = 10
bootstrap_addresses = []
sync = true
parcel_relay = true
discovery = true
discovery_type = "unstructured"
discovery_refresh = 60000
discovery_bucket_size = 10

disable = false
port = 8080

disable = false
path = "/tmp/jsonrpc.ipc"

disable = false
path = "snapshot"

CodeChain is set to use the Solo consensus algorithm by default. Tendermint is not suitable for solo testing purposes, since it requires a minimum of 4 users to function properly.

In order to test CodeChain alone, you may want to change chain to Solo. To do this, use --chain solo.

CLI Options for CodeChain client

Specify the certain config file path that you want to use to configure CodeChain to your needs.
Listen for connections on PORT. (default: 3485)
Bootstrap addresses to connect.
Do not open network socket.
Set the minimum number of connections the user would like. (default: 10)
Set the maximum number of connections the user would like. (default: 30)
Specify instance id for logging. Used when running multiple instances of CodeChain.
Do not show any synchronization information in the console.
Set the blockchain type out of solo, solo_authority, tendermint or a path to chain spec file. (default: solo)
Specify the database directory path.
Specify the path for JSON key files to be found.
Specify the snapshot directory path.
Do not run block sync extension.
Do not relay parcels.
Listen for rpc connections on PORT. (default: 8080)
Do not run JSON-RPC over IPC service.
Specify custom path for JSON-RPC over IPC service
Do not run jsonrpc.
Specify the block’s author (aka “coinbase”) address for sending block rewards from sealed blocks.
Specify the address which should be used to sign consensus messages and issue blocks.
Maximum amount of memory that can be used by the mem pool. Setting this parameter to 0 disables limiting.
Maximum amount of parcels in the queue (waiting to be included in next block).
URLs to which work package notifications are pushed.
Force the node to author new blocks as if it were always sealing/mining.
Specify the minimum time between reseals from incoming parcels. MS is time measured in milliseconds.
Specify the maximum time since last block to enable force-sealing. MS is time measured in milliseconds.
Specify the number of historical work packages which are kept cached lest a solution is found for them later. High values take more memory but result in fewer unusable solutions.
Do not use discovery. No automated peer finding.
--discovery="kademlia" | "unstructured"
Decides which p2p discovery extension to use. Options are kademlia and unstructured. In a testing environment, an unstructured p2p network is desirable because it is more than sufficient when there are a few users. (default: unstructured)
Bucket size for discovery. Choose how many addresses to exchange at a time during discovery.
Refresh timeout of discovery (ms). It may conflict with:`` –no-discovery``.
Disable snapshots