Config
An example configuration file that includes all possible fields.
{
"network": "mainnet",
"keystate": "./keystate.sk",
"interactive": false,
"known_nodes": [],
"bootstrap_nodes": [
"https://p2p.tangent.cash:18420?consensus=1"
],
"consensus": {
"address": "0.0.0.0",
"port": 18418,
"accounts": [],
"max_inbound_connections": 64,
"max_outbound_connections": 8,
"inventory_timeout": 300000,
"inventory_size": 65536,
"aggregation_cooldown": 2000,
"aggregation_attempts": 6,
"coordination_attempts": 15,
"dispatch_retry_interval": 120000,
"hashes_per_query": 2048,
"headers_per_query": 128,
"reorganizable": false,
"miner": true,
"server": true,
"logging": true
},
"rpc": {
"address": "0.0.0.0",
"port": 18419,
"username": null,
"password": null,
"sandbox": true,
"server": false,
"logging": true
},
"discovery": {
"address": "0.0.0.0",
"port": 18420,
"server": false,
"logging": true
},
"superchain": {
"polling_frequency": 90000,
"cache1_size": 32768,
"cache2_size": 131072,
"listener": false,
"logging": true,
"protocols": {
"BTC": {
"peers": [
{
"url": "http://admin:pass@127.0.0.1:8332",
"headers": { "key": "value" },
"rps": 2
}
],
"strategy": {
"props": null,
"batching": null,
"linker": false,
"tip": null
}
}
}
},
"tcp": {
"tls_trusted_peers": 100,
"mbps_per_socket": 24,
"keep_alive": 5000,
"timeout": 30000
},
"storage": {
"path": "./",
"module_cache_path": null,
"optimization": "speed",
"checkpoint_size": 128,
"max_tree_queue_size": 65536,
"max_tree_vector_size": 48,
"module_cache_size": 8192,
"blob_cache_size": 134217728,
"index_page_size": 65536,
"index_cache_size": -2000,
"flush_threads_ratio": 0.25,
"compaction_threads_ratio": 0.25,
"computation_threads_ratio": 0.00,
"transaction_to_account_index": true,
"transaction_to_rollup_index": true,
"logging": false
},
"logs": {
"info": null,
"error": null,
"query": null,
"archive_size": 8388608,
"archive_repack_interval": 1800000,
"control_logging": false
}
}
Basic Configuration
- network:
"mainnet"|"testnet"|"regtest"Specifies the consensus network type.mainnetis the main network,testnetis for testing purposes, andregtestis a local regression test mode. - keystate:
stringPath to the keystate file containing cryptographic keys for data encryption. - keystate_for_encryption:
stringPath to the keystate file that is not encrypted and can be used to create a new keystate with encryption applied. - interactive:
booleanEnable interactive encryption of a keystate file that would require a password to be prompted at startup. - known_nodes:
string[]An array of consensus nodes considered always reachable. Example:tcp://127.0.0.1:18418. - bootstrap_nodes:
string[]An array of discovery nodes used for consensus node discovery.
Consensus Service Configuration
The consensus section defines how the node participates in achieving agreement on the state of the blockchain:
- address:
stringIP address of the consensus server. - port:
numberPort number for the consensus server. - accounts:
string[]Array of account keys used by the node. If empty, a new random account will be created if none exists. Accepts secret keys and mnemonic phrases. - max_inbound_connections:
numberLimit on incoming connections. - max_outbound_connections:
numberLimit on outgoing connections. - inventory_timeout:
number (ms)Time-to-live for cached broadcast messages. - inventory_size:
numberSize of the broadcast messages cache. - aggregation_cooldown:
number (ms)Wait time between MPC aggregation attempts. - aggregation_attempts:
numberNumber of MPC aggregation attempts before giving up. - coordination_attempts:
numberNumber of MPC coordination attempts before giving up. - dispatch_retry_interval:
number (ms)Interval for block re-dispatching. - hashes_per_query:
numberNumber of hashes requested per P2P query. - headers_per_query:
numberNumber of headers requested per P2P query. - reorganizable:
booleanEnables deep reorganizations that can make the node unresponsive for long periods. - miner:
booleanEnables block production if one or more accounts are participating in governance. - server:
booleanEnables a consensus server. - logging:
booleanEnables logging for consensus-related activities.
RPC Service Configuration
The RPC section defines how external applications can interact with the node:
- address:
stringIP address of the RPC server. - port:
numberPort number for the RPC server. - username:
string | nullAuthorization username if not null. - password:
string | nullAuthorization password if not null. - sandbox:
booleanEnables sandbox mode that restricts administrative operations. - logging:
booleanEnables logging for RPC activities.
Discovery Service Configuration
The discovery section relates to node discovery on the network:
- port:
numberPort number for the discovery server. - server:
booleanEnables a discovery server. - logging:
booleanEnables logging for discovery activities.
Superchain Service Configuration
The superchain section relates to interactions with other blockchains:
- polling_frequency:
number (ms)Frequency of polling for new blocks. - cache1_size:
numberSize of the first cache level. - cache2_size:
numberSize of the second cache level. - listener:
booleanEnables an array of superchain listeners managed by a consensus server. - logging:
booleanEnables logging for superchain activities.
Protocols
- (network):
- peers:
{ url: string, headers?: Record<string, string>, rps?: number }[]An array of off-chain relay peer URLs several optional parameters such as headers mapping and RPS limiter. - strategy.props:
anyCustom configuration for specific protocol if applicable. - strategy.batching:
number | nullOptimizes amount of requests to an off-chain node by fetching more than 1 block per request. - strategy.linker:
boolean | nullInstead of going block by block, only scan blocks that certanly contain one or more relevant transactions. Can be much better in terms of requests per day, can be much worse: depends severely on amount and kind of bridge accounts active on-chain. Currently, works only for Solana, will become worse than simple scanning when there are more than 150 bridge accounts. - strategy.tip:
number | nullSpecifies the initial tip of the chain that the scanner must start from.
TCP Configuration
The TCP section configures low-level network settings:
- tls_trusted_peers:
numberNumber of TLS trusted peers. - mbps_per_socket:
number (mbps)Maximum bandwidth per socket in Mbps (only applies to download speed). - keep_alive:
number (ms)Keep-alive interval for TCP connections. - timeout:
number (ms)General timeout for TCP operations.
Storage Configuration
The storage section defines how data is stored and managed:
- path:
stringThe base path for all storage-related files. - module_cache_path:
string | nullCache path of compiled VM byte code for smart contracts. - optimization:
"speed" | "safety"Storage integrity vs performance. Safety mode is very conservative. - checkpoint_size:
numberMax reorganization depth (in blocks) before reaching deep reorganization. - max_tree_queue_size:
numberSize of the tree cache queue that affects JSON parser performance significantly as well as memory usage (inverse correlation). - max_tree_vector_size:
numberSize of the each element in tree queue cache. - module_cache_size:
numberSize of the module cache. - blob_cache_size:
number (bytes)Rocksdb LRU cache size. - index_page_size:
numberSqlite page_size value. - index_cache_size:
numberSqlite cache_size value. - flush_threads_ratio:
numberRocksdb ratio of threads dedicated to flushing data. - compaction_threads_ratio:
numberRocksdb ratio of threads dedicated to compaction. - computation_threads_ratio:
numberScheduler ratio of threads dedicated to computation. Zero will allocate threads without relying on Rocksdb threads count. - transaction_to_account_index:
booleanEnables account transactions indexer (possible to query all transactions relevant to an account). - transaction_to_rollup_index:
booleanEnables internal transactions indexer (transactions inside a rollup transaction). - logging:
booleanEnables logging for storage activities.
Logs Configuration
The logs section configures logging behavior:
- info:
nullThe file path of info level logs. - error:
nullThe file path of error level logs. - query:
nullThe file path of query level logs. - archive_size:
number (bytes)Min log file size eligible to be packed in a historic log. - archive_repack_interval:
number (ms)Interval for repacking log files into a historic log. - control_logging:
falseEnables control logging of internal tasks.