Set Node Configuration File

Before you can configure your Pocket Node to enhance your node's capabilities as well as giving you full control over your node and how it runs by changing some values in the config.json file (see below).

{
    "tendermint_config": {
        "RootDir": "<insert your root directory here>",
        "ProxyApp": "tcp://127.0.0.1:26658",
        "Moniker": "<your moniker here>",
        "FastSyncMode": true,
        "DBBackend": "cleveldb",
        "DBPath": "data",
        "LogLevel": "*:debug, *:info, *:error",
        "LogFormat": "plain",
        "Genesis": "config/genesis.json",
        "PrivValidatorKey": "priv_val_key.json",
        "PrivValidatorState": "priv_val_state.json",
        "PrivValidatorListenAddr": "",
        "NodeKey": "node_key.json",
        "ABCI": "socket",
        "ProfListenAddress": "",
        "FilterPeers": false,
        "RPC": {
            "RootDir": "<insert your root directory here>",
            "ListenAddress": "tcp://0.0.0.0:26657",
            "CORSAllowedOrigins": [],
            "CORSAllowedMethods": [
                "HEAD",
                "GET",
                "POST"
            ],
            "CORSAllowedHeaders": [
                "Origin",
                "Accept",
                "Content-Type",
                "X-Requested-With",
                "X-Server-Time"
            ],
            "GRPCListenAddress": "",
            "GRPCMaxOpenConnections": 2500,
            "Unsafe": false,
            "MaxOpenConnections": 2500,
            "MaxSubscriptionClients": 100,
            "MaxSubscriptionsPerClient": 5,
            "TimeoutBroadcastTxCommit": 10000000000,
            "MaxBodyBytes": 1000000,
            "MaxHeaderBytes": 1048576,
            "TLSCertFile": "",
            "TLSKeyFile": ""
        },
        "P2P": {
            "RootDir": "<insert your root directory here>",
            "ListenAddress": "tcp://0.0.0.0:26656",
            "ExternalAddress": "",
            "Seeds": "",
            "PersistentPeers": "",
            "UPNP": false,
            "AddrBook": "config/addrbook.json",
            "AddrBookStrict": false,
            "MaxNumInboundPeers": 250,
            "MaxNumOutboundPeers": 250,
            "FlushThrottleTimeout": 100000000,
            "MaxPacketMsgPayloadSize": 1024,
            "SendRate": 5120000,
            "RecvRate": 5120000,
            "PexReactor": true,
            "SeedMode": false,
            "PrivatePeerIDs": "",
            "AllowDuplicateIP": true,
            "HandshakeTimeout": 20000000000,
            "DialTimeout": 3000000000,
            "TestDialFail": false,
            "TestFuzz": false,
            "TestFuzzConfig": {
                "Mode": 0,
                "MaxDelay": 3000000000,
                "ProbDropRW": 0.2,
                "ProbDropConn": 0,
                "ProbSleep": 0
            }
        },
        "Mempool": {
            "RootDir": "<insert your root directory here>",
            "Recheck": true,
            "Broadcast": true,
            "WalPath": "",
            "Size": 9000,
            "MaxTxsBytes": 1073741824,
            "CacheSize": 9000,
            "MaxTxBytes": 1048576
        },
        "FastSync": {
            "Version": "v0"
        },
        "Consensus": {
            "RootDir": "<insert your root directory here>",
            "WalPath": "data/cs.wal/wal",
            "TimeoutPropose": 60000000000,
            "TimeoutProposeDelta": 10000000000,
            "TimeoutPrevote": 60000000000,
            "TimeoutPrevoteDelta": 10000000000,
            "TimeoutPrecommit": 60000000000,
            "TimeoutPrecommitDelta": 10000000000,
            "TimeoutCommit": 900000000000,
            "SkipTimeoutCommit": false,
            "CreateEmptyBlocks": true,
            "CreateEmptyBlocksInterval": 900000000000,
            "PeerGossipSleepDuration": 100000000,
            "PeerQueryMaj23SleepDuration": 2000000000
            
        },
        "TxIndex": {
            "Indexer": "kv",
            "IndexTags": "tx.hash,tx.height,message.sender,transfer.recipient",
            "IndexAllTags": false
        },
        "Instrumentation": {
            "Prometheus": false,
            "PrometheusListenAddr": ":26660",
            "MaxOpenConnections": 3,
            "Namespace": "tendermint"
        }
    },
    "pocket_config": {
        "data_dir": "<insert your root directory here>",
        "genesis_file": "genesis.json",
        "chains_name": "chains.json",
        "session_db_type": "cleveldb",
        "session_db_name": "session",
        "evidence_db_type": "cleveldb",
        "evidence_db_name": "pocket_evidence",
        "tendermint_uri": "tcp://localhost:26657",
        "keybase_name": "pocket-keybase",
        "rpc_port": "8081",
        "client_block_sync_allowance": 10,
        "max_evidence_cache_entries": 500,
        "max_session_cache_entries": 500,
        "json_sort_relay_responses": true,
        "remote_cli_url": "http://localhost:8081",
        "user_agent": "",
        "validator_cache_size": 500,
        "application_cache_size": 500
    }
}

Understanding Tendermint and Pocket config:

Tendermint Config

Pocket Network utilizes Tendermint as it's engine for consensus and P2P networking. Pocket Core exposes tendermint's configuration in the config.json file located in the data directory (Default: $HOME/.pocket). Tendermint maintains it's own explanation of it's configuration, but may not always be in sync with the version of that Pocket Core is using. Below you will find our best effort explanation of the Tendermint configuration options.

Main

  • "RootDir": The data directory of Tendermint (should be the same directory as Pocket Core's data dir)
  • ProxyApp": Pocket Core is always run "in-process", so this typically isn't applicable. However, this configuration is the path of the the TCP connection exposed by Pocket Core.
  • Moniker": The P2P name that will be shown in `Tendermint Peers
  • "FastSyncMode": Fast sync allows you to process blocks faster when catching up to the latest height. With this mode true, the node checks the merkle tree of validators, and doesn't run the real-time consensus gossip protocol.
  • "DBBackend": The main DB backend provider. Options are shown here, but CLevelDB is recommended for running in production
  • "DBPath": Path of Tendermint databases local to data directory ("data")
  • "LogLevel": The setting for log output in Pocket Core. These levels can be filtered using a simple log level language: <Module>:<Level> in a comma separated list: main:info, state:debug, p2p:error, *:
  • "LogFormat": Colored text ("plain") or JSON format ("json")
  • "Genesis": The path of the genesis file local to the data directory (config/genesis.json)
  • "PrivValidatorKey": The path to the keyfile of your private validator (key Tendermint uses for validator operations) local to the data directory "priv_val_key.json"
  • "PrivValidatorState": The path to the validator state file (file Tendermint uses for validator state operations) local to the data directory "priv_val_state.json"
  • "PrivValidatorListenAddr": TCP or UNIX socket address for Tendermint to listen on for
  • connections from an external PrivValidator process. Pocket Core does not utilize the external validator feature, so likely this can be left blank.
  • "NodeKey": The path to the keyfile of your p2p node (key Tendermint uses for p2p operations) NOTE: In Pocket Core, this should always be the same key as the PrivvalKey file.
  • "ABCI": The type of connection between the proxy app and the Tendermint process (grpc or socket)
  • "ProfListenAddress": the path of the profiling server to listen on.
  • "FilterPeers": Allow the ABCI application to filter peers. Pocket Core currently does not utilize this feature of Tendermint (False)

RPC

  • "RootDir": The data directory of Tendermint's RPC (should be the same directory as Pocket Core's data dir)
  • "ListenAddress": Tendermint RPC's listening address ("tcp://127.0.0.1:26657")
  • "CORSAllowedOrigins": list of origins a cross-domain request can be executed from. The default value '[]' disables cors support while '["*"]' to allow any origin.
  • "CORSAllowedMethods": String array of allowed Cross Origin Methods ["POST", "GET"]
  • "CORSAllowedHeaders": String array of allowed Cross Origin Headers["Origin", "Accept",],
  • "GRPCListenAddress": TCP or UNIX socket address for the gRPC server to listen (Pocket Core does not utilize gRPC at this time)
  • "GRPCMaxOpenConnections": Maximum allowed conns to the gRPC server
  • "Unsafe": Activate Tendermint unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool.
  • "MaxOpenConnections": Max connections (including WebSocket) to process. (NOTE: this can greatly affect setting System File Descriptors). If set too low, this can affect Consensus participation at scale, if set too high, this can cause Too Many Open Files/Resource Consumption. See guides of the documentation to properly set your {ulimit -Sn} and subsequently this option.
  • "MaxSubscriptionClients": Maximum number of unique clientIDs that can /subscribe.
  • "MaxSubscriptionsPerClient": Maximum number of unique queries a given client can /subscribe to.
  • "TimeoutBroadcastTxCommit": How long to wait for a tx to be committed during /broadcast_tx_commit (in ns).
  • "MaxBodyBytes": Maximum size of request body, in bytes
  • "MaxHeaderBytes": Maximum size of request header, in bytes
  • "TLSCertFile": The path to a file containing a certificate that is used to create the HTTPS server. NOTE: this option does not affect Pocket Core RPC in any way.
  • "TLSKeyFile": The path to a file containing corresponding private_key that is used to create the HTTPS server. NOTE: this option does not affect Pocket Core RPC in any way.

P2P

  • "RootDir": The data directory of Tendermint's P2P config (should be the same directory as Pocket Core's data dir)
  • "ListenAddress": The listening address Tendermint will use for peer connections.
  • "ExternalAddress": Address to advertise to peers for them to dial. NOTE: If empty, will use the same port as the laddr
  • "Seeds": The seed nodes used to connect to the network. Must be a comma-separated list in this format: @ (Ex: [email protected]ork:20656). Click here to see a list of seed nodes on Mainnet or Testnet
  • "PersistentPeers": Comma separated list of nodes to keep persistent connections to. Must be a comma separated list in this format: @ (Ex: [email protected]ork:20656)
  • "UPNP": Enable or disable UPNP forwarding.
  • "AddrBook": The path to the addrbook.json file local to the datadir ("config/addrbook.json")
  • "AddrBookStrict": Set true for strict address routability rules, false for local nets.
  • "MaxNumInboundPeers": Maximum number of simultaneous peer inbound connections.
  • "MaxNumOutboundPeers": Maximum number of simultaneous peer outbound connections.
  • "FlushThrottleTimeout": Time to wait before flushing messages out on the connection in ns
  • "MaxPacketMsgPayloadSize": Maximum size of a message packet payload, in bytes
  • "SendRate": Rate at which packets can be sent, in bytes/second
  • "RecvRate": Rate at which packets can be received, in bytes/second
  • "PexReactor": Set true to enable the (peer-exchange reactor)[https://docs.tendermint.com/master/spec/reactors/pex/pex.html]
  • "SeedMode": Is this node a seed_node? (in which node constantly crawls the network and looks for peers. If another node asks it for addresses, it responds and disconnects)
  • "PrivatePeerIDs": Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
  • "AllowDuplicateIP": Allow peers with duplicated IP's (according to address book)
  • "HandshakeTimeout": Timeout in ns of peer handshaking
  • "DialTimeout": Timeout in ns of peer dialing
  • "TestDialFail": Testing params. Force dial to fail. Ignore if not testing Tendermint
  • TestFuzz": Testing params. FUzz connection. Ignore if not testing Tendermint.
  • "TestFuzzConfig": Testing params. Fuzz conn config. Ignore if not testing Tendermint.

Mempool

"RootDir": The data directory of Tendermint's Mempool config (should be the same directory as Pocket Core's data dir)
"Recheck": Recheck determines if the mempool rechecks all pending transactions after a block was committed. Once a block is committed, the mempool removes all valid transactions that were successfully included in the block.
"Broadcast": Determines whether this node gossips any valid transactions that arrive in mempool. Default is to gossip anything that passes checktx. If this is disabled, transactions are not gossiped, but instead stored locally and added to the next block this node is the proposer.
"WalPath": This defines the directory where mempool writes the write-ahead logs. These files can be used to reload unbroadcasted transactions if the node crashes.
"Size": MaxSize of mempool in Transactions
MaxTxsBytes": Max size of ALL Txs in bytes
"CacheSize": Max memory cache size of mempool in transactions.
"MaxTxBytes": Max size of Tx in bytes

FastSync (only if main/fastsync_mode=true)

Fast Sync version to use:
"Version": "v0"

  1. "v0" (default) - the legacy fast sync implementation
  2. "v1" - refactor of v0 version for better testability
  3. "v2" - complete redesign of v0, optimized for testability & readability

Consensus

  • "RootDir": The data directory of Tendermint's Consensus config (should be the same directory as Pocket Core's data dir)
  • "WalPath": Path to Conesusns WAL file relative to datadir. Consensus module writes every message to the WAL (write-ahead log) and will replay all the messages of the last height written to WAL before a crash (if such occurs). See More
  • "TimeoutPropose": The timeout in ns, to receive a proposal block from the designated proposer
  • "TimeoutProposeDelta": The timeout difference in ns between the current round and the last round (round is reset every valid proposal block)
  • "TimeoutPrevote": The timeout in ns to get 2/3 prevotes from validators
  • "TimeoutPrevoteDelta": The timeout difference in ns between the current round of prevoting and the last round (round is reset every valid proposal block)
  • "TimeoutPrecommit": The timeout in ns to get 2/3 precommits from validators
  • "TimeoutPrecommitDelta": The timeout difference in ns between the current round of prevoting and the last round (round is reset every valid proposal block)
  • "TimeoutCommit": The timeout in ns to get 2/3 commits from validators
  • "SkipTimeoutCommit": Make progress as soon as we have all the precommits and don't wait for the designated time. (Pocket Network maintains a steady blocktime by marking this option false)
  • "CreateEmptyBlocks": Create empty blocks if no transactions are submitted/in mempool during the interval.
  • "CreateEmptyBlocksInterval": The timeout that must pass in ns before creating an empty block
  • "PeerGossipSleepDuration": Sleep timer for consensus reactor More Here
  • "PeerQueryMaj23SleepDuration": Sleep timer for consensus reactor More Here

TxIndex

  • "Indexer": What indexer to use for transactions? (Pocket Core currently must use "KV")
  • "IndexTags": Tags (or events) used to index transactions (Pocket Core depends on this functionality for replay attacks)
  • "IndexAllTags": Would you like to index all tags (events)?

Instrumentation

  • "Prometheus": Are you using prometheus to track tendermint metrics?
  • "PrometheusListenAddr": If so, on what port?
  • "MaxOpenConnections": What is the maximum number of simultaneous connections you'd like to allow on prometheus?
  • "Namespace": What namespace would you like to use for prometheus?

Pocket Config

  • "data_dir": The data directory of Pocket Core (should be the same directory as Tendermint data dir)
  • "genesis_file": The name of the genesis file
  • "chains_name": The name of the chains file
  • "session_db_type": The DB backend type (Tendermint Compatible) of the sessionDB?
  • "session_db_name": The name of the SessionDB (where Pocket Core store's Sessions)
  • "evidence_db_type": The DB backend type (Tendermint Compatible) of the evidenceDB?
  • "evidence_db_name": The name of the EvidenceDB (where Pocket Core store's Relay Evidence)
  • "tendermint_uri": The RPC Port of Tendermint (also defined above in Tendermint/RPC)
  • "keybase_name": The name of the keybase
  • "rpc_port": The port of Pocket Core's RPC
  • "client_block_sync_allowance": The +/- allowance in blocks for of a relay request (security mechanism that can help filter misconfigured clients)
  • "max_evidence_cache_entries": Maximum number of relay evidence stored in cache memory
  • "max_session_cache_entries": Maximum number of sessions stored in cache memory
  • "json_sort_relay_responses": Detect and sort if relay response is in json (can help response comparisons if app client is configured for relay consensus)
  • "remote_cli_url": The URL of the CLI (default is local)
  • "user_agent": Custom user agents defined here during http requests
  • "validator_cache_size": Maximum number of validators stored in cache memory
  • "application_cache_size": Maximum number of applications stored in cache memory
  • "pocket_prometheus_port": Pocket port for Prometheus metrics (5.1 +)
  • "prometheus_max_open_files": Max connections to Pocket prometheus

Saving configuration File:

When you have completed editing your config.json file, you can store it in the default directory:
$HOME/.pocket/config/

Updated 9 days ago



Set Node Configuration File


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.