Skip to main content

Getting Started

Looking to build a dApp on Sonr? Following this documentation and our academy you can learn how and become part of the rich ecosystem of EVM builders on Cosmos. Whether you are building new use cases on Sonr or porting an existing dApp from another chain, you’ll want to check out the sections on

Configuration

The app.toml file is used to configure the application state of the blockchain node.
minimum-gas-prices
string
default:"0stake"
The minimum gas prices a validator is willing to accept for processing a transaction.
query-gas-limit
string
default:"0"
The maximum gas a query coming over rest/grpc may consume.
pruning
string
default:"default"
Pruning strategy for historic states.
pruning-keep-recent
integer
default:"0"
Number of recent states to keep when using custom pruning strategy.
pruning-interval
integer
default:"0"
Interval for pruning when using custom pruning strategy.
halt-height
integer
default:"0"
Block height at which a node will gracefully halt and shutdown.
halt-time
integer
default:"0"
Minimum block time (in Unix seconds) at which a node will gracefully halt and shutdown.
min-retain-blocks
integer
default:"0"
Minimum block height offset from the current block being committed for pruning.
inter-block-cache
boolean
default:"true"
Enables inter-block caching.
index-events
array
default:"[]"
Set of events to index.
iavl-cache-size
integer
default:"781250"
Size of the IAVL tree cache (in number of nodes).
iavl-disable-fastnode
boolean
default:"false"
Enables or disables the fast node feature of IAVL.
app-db-backend
string
default:""
Database backend type to use for the application and snapshots DBs.
telemetry.service-name
string
default:""
Prefix for telemetry keys to separate services.
telemetry.enabled
boolean
default:"false"
Enables the application telemetry functionality.
telemetry.enable-hostname
boolean
default:"false"
Enable prefixing gauge values with hostname.
telemetry.enable-hostname-label
boolean
default:"false"
Enable adding hostname to labels.
telemetry.enable-service-label
boolean
default:"false"
Enable adding service to labels.
telemetry.prometheus-retention-time
integer
default:"0"
Enables a Prometheus metrics sink when positive.
telemetry.global-labels
array
default:"[]"
Global set of name/value label tuples applied to all metrics.
telemetry.metrics-sink
string
default:""
Type of metrics sink to use.
telemetry.statsd-addr
string
default:""
Address of a statsd server to send metrics to.
telemetry.datadog-hostname
string
default:""
Hostname to use when emitting metrics to Datadog.
api.enable
boolean
default:"false"
Defines if the API server should be enabled.
api.swagger
boolean
default:"false"
Defines if swagger documentation should automatically be registered.
api.address
string
default:"tcp://localhost:1317"
API server address to listen on.
api.max-open-connections
integer
default:"1000"
Number of maximum open connections.
api.rpc-read-timeout
integer
default:"10"
CometBFT RPC read timeout (in seconds).
api.rpc-write-timeout
integer
default:"0"
CometBFT RPC write timeout (in seconds).
api.rpc-max-body-bytes
integer
default:"1000000"
CometBFT maximum request body (in bytes).
api.enabled-unsafe-cors
boolean
default:"false"
Defines if CORS should be enabled (unsafe - use it at your own risk).
grpc.enable
boolean
default:"true"
Defines if the gRPC server should be enabled.
grpc.address
string
default:"localhost:9090"
gRPC server address to bind to.
grpc.max-recv-msg-size
string
default:"10485760"
Max message size in bytes the server can receive.
grpc.max-send-msg-size
string
default:"2147483647"
Max message size in bytes the server can send.
grpc-web.enable
boolean
default:"true"
Defines if the gRPC-web should be enabled.
state-sync.snapshot-interval
integer
default:"0"
Block interval at which local state sync snapshots are taken.
state-sync.snapshot-keep-recent
integer
default:"2"
Number of recent snapshots to keep and serve.
streaming.abci.keys
array
default:"[]"
List of kv store keys to stream out via gRPC.
streaming.abci.plugin
string
default:""
Plugin name used for streaming via gRPC.
streaming.abci.stop-node-on-err
boolean
default:"true"
Specifies whether to stop the node on message delivery error.
mempool.max-txs
integer
default:"5000"
Maximum number of transactions in the mempool.
The client.toml file configures the client when using the sonrd binary to interact with the network.
chain-id
string
default:"local-1"
required
The network chain ID
keyring-backend
string
default:"test"
required
The keyring’s backend, where the keys are stored (os|file|kwallet|pass|test|memory)
output
string
default:"text"
required
CLI output format (text|json)
node
string
default:"tcp://localhost:26657"
required
<host>:<port> to CometBFT RPC interface for this chain
broadcast-mode
string
default:"sync"
required
Transaction broadcasting mode (sync|async)
The config.toml file is used to configure the blockchain node.
version
string
default:"0.38.6"
required
The version of the CometBFT binary that created or last modified the config file. Do not modify this.
proxy_app
string
default:"tcp://127.0.0.1:26658"
required
TCP or UNIX socket address of the ABCI application, or the name of an ABCI application compiled in with the CometBFT binary.
moniker
string
default:"MBP-von-Prad"
required
A custom human readable name for this node.
db_backend
string
default:"goleveldb"
required
Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb.
db_dir
string
default:"data"
required
Database directory.
log_level
string
default:"info"
required
Output level for logging, including package level options.
log_format
string
default:"plain"
required
Output format: ‘plain’ (colored text) or ‘json’.
genesis_file
string
default:"config/genesis.json"
required
Path to the JSON file containing the initial validator set and other meta data.
priv_validator_key_file
string
default:"config/priv_validator_key.json"
required
Path to the JSON file containing the private key to use as a validator in the consensus protocol.
priv_validator_state_file
string
default:"data/priv_validator_state.json"
required
Path to the JSON file containing the last sign state of a validator.
priv_validator_laddr
string
default:""
required
TCP or UNIX socket address for CometBFT to listen on for connections from an external PrivValidator process.
node_key_file
string
default:"config/node_key.json"
required
Path to the JSON file containing the private key to use for node authentication in the p2p protocol.
abci
string
default:"socket"
required
Mechanism to connect to the ABCI application: socket | grpc.
filter_peers
boolean
default:"false"
required
If true, query the ABCI app on connecting to a new peer so the app can decide if we should keep the connection or not.
rpc.laddr
string
default:"tcp://127.0.0.1:26657"
required
TCP or UNIX socket address for the RPC server to listen on.
rpc.cors_allowed_origins
array
default:"[]"
required
A list of origins a cross-domain request can be executed from. Default value ’[]’ disables cors support. Use ’[”*”]’ to allow any origin.
rpc.cors_allowed_methods
array
default:"[\"HEAD\", \"GET\", \"POST\"]"
required
A list of methods the client is allowed to use with cross-domain requests.
rpc.cors_allowed_headers
array
required
A list of non simple headers the client is allowed to use with cross-domain requests.
rpc.grpc_laddr
string
default:""
required
TCP or UNIX socket address for the gRPC server to listen on. NOTE: This server only supports /broadcast_tx_commit.
rpc.grpc_max_open_connections
integer
default:"900"
required
Maximum number of simultaneous connections. Does not include RPC (HTTP&WebSocket) connections. See max_open_connections.
rpc.unsafe
boolean
default:"false"
required
Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool.
rpc.max_open_connections
integer
default:"900"
required
Maximum number of simultaneous connections (including WebSocket). Does not include gRPC connections. See grpc_max_open_connections.
rpc.max_subscription_clients
integer
default:"100"
required
Maximum number of unique clientIDs that can /subscribe. If you’re using /broadcast_tx_commit, set to the estimated maximum number of broadcast_tx_commit calls per block.
rpc.max_subscriptions_per_client
integer
default:"5"
required
Maximum number of unique queries a given client can /subscribe to. If you’re using GRPC (or Local RPC client) and /broadcast_tx_commit, set to the estimated maximum number of broadcast_tx_commit calls per block.
rpc.experimental_subscription_buffer_size
integer
default:"200"
required
Experimental parameter to specify the maximum number of events a node will buffer, per subscription, before returning an error and closing the subscription. Must be set to at least 100, but higher values will accommodate higher event throughput rates (and will use more memory).
rpc.experimental_websocket_write_buffer_size
integer
default:"200"
required
Experimental parameter to specify the maximum number of RPC responses that can be buffered per WebSocket client. If clients cannot read from the WebSocket endpoint fast enough, they will be disconnected, so increasing this parameter may reduce the chances of them being disconnected (but will cause the node to use more memory).
rpc.experimental_close_on_slow_client
boolean
default:"false"
required
Enabling this experimental parameter will cause the WebSocket connection to be closed instead if it cannot read fast enough, allowing for greater predictability in subscription behavior.
rpc.timeout_broadcast_tx_commit
string
default:"10s"
required
How long to wait for a tx to be committed during /broadcast_tx_commit. WARNING: Using a value larger than 10s will result in increasing the global HTTP write timeout, which applies to all connections and endpoints.
rpc.max_body_bytes
integer
default:"1000000"
required
Maximum size of request body, in bytes.
rpc.max_header_bytes
integer
default:"1048576"
required
Maximum size of request header, in bytes.
rpc.tls_cert_file
string
default:""
required
The path to a file containing certificate that is used to create the HTTPS server. Might be either absolute path or path related to CometBFT’s config directory. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server’s certificate, any intermediates, and the CA’s certificate.
rpc.tls_key_file
string
default:""
required
The path to a file containing matching private key that is used to create the HTTPS server. Might be either absolute path or path related to CometBFT’s config directory.
rpc.pprof_laddr
string
default:"localhost:6060"
required
p2p.laddr
string
default:"tcp://0.0.0.0:26656"
required
Address to listen for incoming connections.
p2p.external_address
string
default:""
required
Address to advertise to peers for them to dial. If empty, will use the same port as the laddr, and will introspect on the listener to figure out the address. IP and port are required.
p2p.seeds
string
default:""
required
Comma separated list of seed nodes to connect to.
p2p.persistent_peers
string
default:""
required
Comma separated list of nodes to keep persistent connections to.
p2p.addr_book_file
string
default:"config/addrbook.json"
required
Path to address book.
p2p.addr_book_strict
boolean
default:"true"
required
Set true for strict address routability rules. Set false for private or local networks.
p2p.max_num_inbound_peers
integer
default:"40"
required
Maximum number of inbound peers.
p2p.max_num_outbound_peers
integer
default:"10"
required
Maximum number of outbound peers to connect to, excluding persistent peers.
p2p.unconditional_peer_ids
string
default:""
required
List of node IDs, to which a connection will be (re)established ignoring any existing limits.
p2p.persistent_peers_max_dial_period
string
default:"0s"
required
Maximum pause when redialing a persistent peer (if zero, exponential backoff is used).
p2p.flush_throttle_timeout
string
default:"100ms"
required
Time to wait before flushing messages out on the connection.
p2p.max_packet_msg_payload_size
integer
default:"1024"
required
Maximum size of a message packet payload, in bytes.
p2p.send_rate
integer
default:"5120000"
required
Rate at which packets can be sent, in bytes/second.
p2p.recv_rate
integer
default:"5120000"
required
Rate at which packets can be received, in bytes/second.
p2p.pex
boolean
default:"true"
required
Set true to enable the peer-exchange reactor.
p2p.seed_mode
boolean
default:"false"
required
Seed mode, in which node constantly crawls the network and looks for peers. If another node asks it for addresses, it responds and disconnects. Does not work if the peer-exchange reactor is disabled.
p2p.private_peer_ids
string
default:""
required
Comma separated list of peer IDs to keep private (will not be gossiped to other peers).
p2p.allow_duplicate_ip
boolean
default:"false"
required
Toggle to disable guard against peers connecting from the same ip.
p2p.handshake_timeout
string
default:"20s"
required
Peer connection configuration.
p2p.dial_timeout
string
default:"3s"
required
Peer connection configuration.
mempool.type
string
default:"flood"
required
The type of mempool for this node to use.
mempool.recheck
boolean
default:"true"
required
Recheck (default: true) defines whether CometBFT should recheck the validity for all remaining transaction in the mempool after a block.
mempool.broadcast
boolean
default:"true"
required
Broadcast (default: true) defines whether the mempool should relay transactions to other peers.
mempool.wal_dir
string
default:""
required
WalPath (default: "") configures the location of the Write Ahead Log (WAL) for the mempool.
mempool.size
integer
default:"5000"
required
Maximum number of transactions in the mempool.
mempool.max_txs_bytes
integer
default:"1073741824"
required
Limit the total size of all txs in the mempool.
mempool.cache_size
integer
default:"10000"
required
Size of the cache (used to filter transactions we saw earlier) in transactions.
mempool.keep_invalid_txs_in_cache
boolean
default:"false"
required
Do not remove invalid transactions from the cache (default: false).
mempool.max_tx_bytes
integer
default:"1048576"
required
Maximum size of a single transaction.
mempool.max_batch_bytes
integer
default:"0"
required
Maximum size of a batch of transactions to send to a peer.
mempool.experimental_max_gossip_connections_to_persistent_peers
integer
default:"0"
required
Experimental parameters to limit gossiping txs to up to the specified number of peers.
mempool.experimental_max_gossip_connections_to_non_persistent_peers
integer
default:"0"
required
Experimental parameters to limit gossiping txs to up to the specified number of peers.
statesync.enable
boolean
default:"false"
required
State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine snapshot from peers instead of fetching and replaying historical blocks.
statesync.rpc_servers
string
default:""
required
RPC servers (comma-separated) for light client verification of the synced state machine and retrieval of state data for node bootstrapping.
statesync.trust_height
integer
default:"0"
required
Trusted height for state sync.
statesync.trust_hash
string
default:""
required
Trusted hash for state sync.
statesync.trust_period
string
default:"168h0m0s"
required
Trust period for state sync.
statesync.discovery_time
string
default:"15s"
required
Time to spend discovering snapshots before initiating a restore.
statesync.temp_dir
string
default:""
required
Temporary directory for state sync snapshot chunks.
statesync.chunk_request_timeout
string
default:"10s"
required
The timeout duration before re-requesting a chunk, possibly from a different peer.
statesync.chunk_fetchers
integer
default:"4"
required
The number of concurrent chunk fetchers to run.
blocksync.version
string
default:"v0"
required
Block Sync version to use.
consensus.wal_file
string
default:"data/cs.wal/wal"
required
WAL file for consensus.
consensus.timeout_propose
string
default:"3s"
required
How long we wait for a proposal block before prevoting nil.
consensus.timeout_propose_delta
string
default:"500ms"
required
How much timeout_propose increases with each round.
consensus.timeout_prevote
string
default:"1s"
required
How long we wait after receiving +2/3 prevotes for “anything”.
consensus.timeout_prevote_delta
string
default:"500ms"
required
How much the timeout_prevote increases with each round.
consensus.timeout_precommit
string
default:"1s"
required
How long we wait after receiving +2/3 precommits for “anything”.
consensus.timeout_precommit_delta
string
default:"500ms"
required
How much the timeout_precommit increases with each round.
consensus.timeout_commit
string
default:"5s"
required
How long we wait after committing a block, before starting on the new height.
consensus.double_sign_check_height
integer
default:"0"
required
How many blocks to look back to check existence of the node’s consensus votes before joining consensus.
consensus.skip_timeout_commit
boolean
default:"false"
required
Make progress as soon as we have all the precommits (as if TimeoutCommit = 0).
consensus.create_empty_blocks
boolean
default:"true"
required
EmptyBlocks mode and possible interval between empty blocks.
consensus.create_empty_blocks_interval
string
default:"0s"
required
EmptyBlocks mode and possible interval between empty blocks.
consensus.peer_gossip_sleep_duration
string
default:"100ms"
required
Reactor sleep duration parameters.
consensus.peer_query_maj23_sleep_duration
string
default:"2s"
required
Reactor sleep duration parameters.
storage.discard_abci_responses
boolean
default:"false"
required
Set to true to discard ABCI responses from the state store, which can save a considerable amount of disk space.
tx_index.indexer
string
default:"kv"
required
What indexer to use for transactions.
tx_index.psql_conn
string
default:""
required
The PostgreSQL connection configuration, the connection format: postgresql://<user>:<password>@<host>:<port>/<db>?<opts>.
instrumentation.prometheus
boolean
default:"false"
required
When true, Prometheus metrics are served under /metrics on PrometheusListenAddr.
instrumentation.prometheus_listen_addr
string
default:":26660"
required
Address to listen for Prometheus collector(s) connections.
instrumentation.max_open_connections
integer
default:"3"
required
Maximum number of simultaneous connections.
instrumentation.namespace
string
default:"cometbft"
required
Instrumentation namespace.
I