Configure cheqd node

There are two most important files when it comes to cheqd node configuration - app.toml and config.toml, located under your node's home directory (tipically /home/cheqd/.cheqdnode), in config/ directory.

These files get generated by cheqd-noded init command and most likely, and the whole process is covered by our interactive installer. For more details, see this section

For most operators, the default settings should be fine, but understanding these parameters should help for advanced setups and troubleshootings.

Also, note that some node operators need to update their config files with some new parameters, especially if they have been running their nodes for a long time.

app.toml Configuration File

This is Application-related configuration file, generated by cosmos-sdk. It should be used to configure your app, such as state pruning strategies, telemetry, gRPC and REST servers configuration, state sync and so on.

Here's an example file with most recent configuration keys and values:

###############################################################################
###                           Base Configuration                            ###
###############################################################################

# The minimum gas prices a validator is willing to accept for processing a
# transaction. On cheqd mainnet and testnet, this value should be set to 5000ncheq.
minimum-gas-prices = "5000ncheq"

# default: the last 362880 states are kept, pruning at 10 block intervals
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
# everything: 2 latest states will be kept; pruning at 10 block intervals.
# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval'
pruning = "default"

# These are applied if and only if the pruning strategy is custom.
pruning-keep-recent = "0"
pruning-interval = "0"

# HaltHeight contains a non-zero block height at which a node will gracefully
# halt and shutdown that can be used to assist upgrades and testing.
#
# Note: Commitment of state will be attempted on the corresponding block.
halt-height = 0

# HaltTime contains a non-zero minimum block time (in Unix seconds) at which
# a node will gracefully halt and shutdown that can be used to assist upgrades
# and testing.
#
# Note: Commitment of state will be attempted on the corresponding block.
halt-time = 0

# MinRetainBlocks defines the minimum block height offset from the current
# block being committed, such that all blocks past this offset are pruned
# from Tendermint. It is used as part of the process of determining the
# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates
# that no blocks should be pruned.
#
# This configuration value is only responsible for pruning Tendermint blocks.
# It has no bearing on application state pruning which is determined by the
# "pruning-*" configurations.
#
# Note: Tendermint block pruning is dependant on this parameter in conunction
# with the unbonding (safety threshold) period, state pruning and state sync
# snapshot parameters to determine the correct minimum value of
# ResponseCommit.RetainHeight.
min-retain-blocks = 0

# InterBlockCache enables inter-block caching.
inter-block-cache = true

# IndexEvents defines the set of events in the form {eventType}.{attributeKey},
# which informs Tendermint what to index. If empty, all events will be indexed.
#
# Example:
# ["message.sender", "message.recipient"]
index-events = []

# IavlCacheSize set the size of the iavl tree cache (in number of nodes).
# In most cases, use default value.
iavl-cache-size = 781250

# IAVLDisableFastNode enables or disables the fast node feature of IAVL. 
# Default is false.
iavl-disable-fastnode = false

# IAVLLazyLoading enable/disable the lazy loading of iavl store.
# Default is false.
iavl-lazy-loading = false

# AppDBBackend defines the database backend type to use for the application and snapshots DBs.
# An empty string indicates that a fallback will be used.
# The fallback is the db_backend value set in Tendermint's config.toml.
app-db-backend = ""

###############################################################################
###                         Telemetry Configuration                         ###
###############################################################################

[telemetry]

# Prefixed with keys to separate services.
service-name = "cheqd-mainnet-1"

# Enabled enables the application telemetry functionality. When enabled,
# an in-memory sink is also enabled by default. Operators may also enabled
# other sinks such as Prometheus.
enabled = true

# Enable prefixing gauge values with hostname.
enable-hostname = true

# Enable adding hostname to labels.
enable-hostname-label = true

# Enable adding service to labels.
enable-service-label = true

# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink.
prometheus-retention-time = 60

# GlobalLabels defines a global set of name/value label tuples applied to all
# metrics emitted using the wrapper functions defined in telemetry package.
#
# Example:
# [["chain_id", "cosmoshub-1"]]
global-labels = [
]

###############################################################################
###                           API Configuration                             ###
###############################################################################

[api]

# Enable defines if the API server should be enabled.
enable = true

# Swagger defines if swagger documentation should automatically be registered.
swagger = true

# Address defines the API server to listen on.
# Use 0.0.0.0 make it publicly available, or localhost to allow only local connections
address = "tcp://0.0.0.0:1317"

# MaxOpenConnections defines the number of maximum open connections.
max-open-connections = 1000

# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds).
rpc-read-timeout = 10

# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds).
rpc-write-timeout = 0

# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes).
rpc-max-body-bytes = 1000000

# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
enabled-unsafe-cors = false

###############################################################################
###                           Rosetta Configuration                         ###
###############################################################################

[rosetta]

# Enable defines if the Rosetta API server should be enabled.
enable = false

# Address defines the Rosetta API server to listen on.
address = ":8080"

# Network defines the name of the blockchain that will be returned by Rosetta.
blockchain = "app"

# Network defines the name of the network that will be returned by Rosetta.
network = "network"

# Retries defines the number of retries when connecting to the node before failing.
retries = 3

# Offline defines if Rosetta server should run in offline mode.
offline = false

# EnableDefaultSuggestedFee defines if the server should suggest fee by default.
# If 'construction/medata' is called without gas limit and gas price,
# suggested fee based on gas-to-suggest and denom-to-suggest will be given.
enable-fee-suggestion = true

# GasToSuggest defines gas limit when calculating the fee
gas-to-suggest = 360000

# DenomToSuggest defines the defult denom for fee suggestion.
minimum-gas-prices = "50ncheq"
denom-to-suggest = "ncheq"

###############################################################################
###                           gRPC Configuration                            ###
###############################################################################

[grpc]

# Enable defines if the gRPC server should be enabled.
enable = true

# Address defines the gRPC server address to bind to.
# Use 0.0.0.0 make it publicly available, or localhost to allow only local connections.
address = "0.0.0.0:9090"

# MaxRecvMsgSize defines the max message size in bytes the server can receive.
# The default value is 10MB.
max-recv-msg-size = "10485760"

# MaxSendMsgSize defines the max message size in bytes the server can send.
# The default value is math.MaxInt32.
max-send-msg-size = "2147483647"

###############################################################################
###                        gRPC Web Configuration                           ###
###############################################################################

[grpc-web]

# GRPCWebEnable defines if the gRPC-web should be enabled.
# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op.
enable = false

# Address defines the gRPC-web server address to bind to.
address = "localhost:9091"

# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk).
enable-unsafe-cors = false

###############################################################################
###                        State Sync Configuration                         ###
###############################################################################

# State sync snapshots allow other nodes to rapidly join the network without replaying historical
# blocks, instead downloading and applying a snapshot of the application state at a given height.
[state-sync]

# snapshot-interval specifies the block interval at which local state sync snapshots are
# taken (0 to disable).
snapshot-interval = 0

# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all).
snapshot-keep-recent = 2

###############################################################################
###                         Store / State Streaming                         ###
###############################################################################

[store]
streamers = []

[streamers]
[streamers.file]
keys = ["*", ]
write_dir = ""
prefix = ""

# output-metadata specifies if output the metadata file which includes the abci request/responses 
# during processing the block.
output-metadata = "true"

# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine.
stop-node-on-error = "true"

# fsync specifies if call fsync after writing the files.
fsync = "false"

###############################################################################
###                         Mempool                                         ###
###############################################################################

[mempool]
# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool.
# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool.
# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount.
#
# Note, this configuration only applies to SDK built-in app-side mempool
# implementations.
max-txs = 5000

Here are some of the most important parameters set in the config file above:

  • Set the minimal acceptable gas prices (5000ncheq).

  • Keep the default pruning. See more pruning options here.

  • Enable REST and gRPC servers.

  • Enable Prometheus server and reports some basic app-layer metrics.

  • Enable fee sugestion feature and applies correct config paramters. This is useful feature to enforce if you plan to serve API traffic from your nodes.

  • Keep the state sync off, unless you want to serve statesync snapshots from your node.

  • Set the mempool limit to 5000 txs. This should be sufficient to most use-cases.

See more details about cosmos-SDK configuration here.

config.toml Configuration file

config.toml file is used to configure CometBFT.

CometBFT is a blockchain application platform; it provides the equivalent of a web-server, database, and supporting libraries for blockchain applications written in any programming language. Like a web-server serving web applications, CometBFT serves blockchain applications.

Let's take a look at some of the most important CometBFT configuration parameters:

  • moniker - This is the public friendly name for your node. You will be asked to set this for your node during installation by interactive installer. If skipped, your hostname will be used instead.

  • log_level and log_format - Also set by interactive installer. We strongly suggest to keep log_level at error, to reduce noise and save up on storage. For log_format, we suggest using json.

  • priv_validator_* and node_key - In most cases, you should keep these as default. These contains paths to most critical files for your node's proper functioning. Renaming, removing, compromising integrity of those files and setting incorrect values here could result in data loss and validator jailing.

  • [rpc].laddr - Listen address for the RPC server. Make sure to match ports exposed on your firewall (if applied). Set host to 0.0.0.0 instead of 127.0.0.1 to expose it publicly.

  • [p2p].laddr - P2P listen address. 26656 is the default port.

  • external_address - External address for your node. Set by interactive installer to address provided by user (public IP lookup performed for default value).

  • seeds - Populated by interactive installer. Here are lists of mainnet and testnet seeds.

  • persistent_peers - Useful in multi-node setup. For example, you have sentry node exposed to the rest of the network (and internet) and keep persistent connection to your validator here, to make sure no blocks are missed. The format should be {node-ID}@{node-IP-address}:{port}, separated by commas.

  • unconditional_peer_ids - Useful for same use-case as above. Format is comma-separated node IDs.

  • private_peer_ids - Useful for same use-case as above. Format is comma-separated node IDs.

  • [statesync].* - Statesync configuration, useful when starting node from scratch (to save up on storage) or recovering. We have statesync servers available at https://eu-rpc.cheqd.net:443 and https://ap-rpc.cheqd.net:443 for mainnet and https://eu-rpc.cheqd.network:443 and https://ap-rpc.cheqd.network:443 for testnet.

  • consensus.double_sign_check_height - Some node operators experienced some issues during upgrades if this was set to any other value than 0.

See more details about CometBFT configuration here.

Last updated

Was this helpful?