Documentation Index
Fetch the complete documentation index at: https://cosmos-docs-evm-upgrade-7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The chain-id of Cosmos Hub mainnet is
cosmoshub-4.Release History
- use
gaia v5.0.x(Delta) for queries of state between height6,910,000and8,695,000 - use
gaia v6.0.x(Vega) between8,695,000and10,085,397 - use
gaia v7.0.x(Theta) between10,085,397and14,099,412 - use
gaia v8.0.x(Rho) between14,099,412and14,470,501 - use
gaia v9.0.x(Lambda) between14,470,501and15,213,800 - use
gaia v9.1.xbetween15,213,800and15,816,200 - use
gaia v10.0.xbetween15,816,200and16,596,000 - use
gaia v11.xbetween16,596,000and16,985,500 - use
gaia v12.xbetween16,985,500and17,380,000 - use
gaia v13.xbetween17,380,000and18,262,000 - use
gaia v14.1.xbetween18,262,000and19,639,600 - use
gaia v15.1.xbetween19,639,600and19,939,000 - use
gaia v15.2.xbetween19,939,000and20,440,500 - use
gaia v16.xfrom20,440,500and20,739,800 - use
gaia v17.1.xfrom20,739,800
Overview
- Release History
- Explorers
- Getting Started
- Hardware
- General Configuration
- Sync Options
- Snapshots
- Cosmovisor
- Running via Background Process
- Exporting State
- Verify Mainnet
Explorers
There are many explorers for the Cosmos Hub. For reference while setting up a node, here are a few recommendations:Getting Started
Make sure the following prerequisites are completed:- Choose the proper hardware/server configuration. See the hardware guide.
- Ensure Gaia is properly installed. See the installation guide for a walk-through.
- Follow the configuration guide to initialize and prepare the node to sync with the network.
Hardware
Running a full archive node can be resource intensive as the full currentcosmoshub-4 state is over 1.4TB. For those who wish to run state sync or use quicksync, the following hardware configuration is recommended:
| Node Type | RAM | Storage |
|---|---|---|
| Validator | 32GB | 500GB-2TB* |
| Full | 16GB | 2TB |
| Default | 16GB | 1TB |
General Configuration
Make sure to walk through the basic setup and configuration. Operators will need to initializegaiad, download the genesis file for cosmoshub-4, and set persistent peers and/or seeds for startup.
Initialize Chain
Choose a custom moniker for the node and initialize. By default, theinit command creates the ~/.gaia directory with subfolders config and data. In the /config directory, the most important files for configuration are app.toml and config.toml.
Note: Monikers can contain only ASCII characters. Using Unicode characters is not supported and renders the node unreachable.The
moniker can be edited in the ~/.gaia/config/config.toml file:
Genesis File
Once the node is initialized, download the genesis file and move to the/config directory of the Gaia home directory.
Seeds & Peers
Upon startup the node will need to connect to peers. If there are specific nodes a node operator is interested in setting as seeds or as persistent peers, this can be configured in~/.gaia/config/config.toml
~/.gaia/config/addrbook.json.
Gas & Fees
On Cosmos Hub mainnet, the accepted denom isuatom, where 1atom = 1.000.000uatom
Transactions on the Cosmos Hub network need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following:
Gas is the smallest unit or pricing value required to perform a transaction. Different transactions require different amounts of gas. The gas amount for a transaction is calculated as it is being processed, but it can be estimated beforehand by using the auto value for the gas flag. The gas estimate can be adjusted with the flag --gas-adjustment (default 1.0) to ensure enough gas is provided for the transaction.
The gasPrice is the price of each unit of gas. Each validator sets a min-gas-price value, and will only include transactions that have a gasPrice greater than their min-gas-price.
The transaction fees are the product of gas and gasPrice. The higher the gasPrice/fees, the higher the chance that a transaction will get included in a block.
For mainnet, the recommended gas-prices is 0.0025uatom.
A full-node keeps unconfirmed transactions in its mempool. In order to protect it from spam, it is better to set a minimum-gas-prices that the transaction must meet in order to be accepted in the node’s mempool. This parameter can be set in ~/.gaia/config/app.toml.
min-gas-prices is 0.0025uatom, but this can be changed later.
Pruning of State
Note: This is an optional configuration.There are four strategies for pruning state. These strategies apply only to state and do not apply to block storage. A node operator may want to consider custom pruning if node storage is a concern or there is an interest in running an archive node. To set pruning, adjust the
pruning parameter in the ~/.gaia/config/app.toml file.
The following pruning state settings are available:
everything: Prune all saved states other than the current state.nothing: Save all states and delete nothing.default: Save the last 100 states and the state of every 10,000th block.custom: Specify pruning settings with thepruning-keep-recent,pruning-keep-every, andpruning-intervalparameters.
default mode which is the recommended setting for most environments.
If a node operator wants to change their node’s pruning strategy then this must be done before the node is initialized.
In ~/.gaia/config/app.toml
gaia will always override settings in the app.toml file. To change the node’s pruning setting to everything mode then pass the ---pruning everything flag when running gaiad start.
Note: If running the node with pruned state, it will not be possible to query the heights that are not in the node’s store.
REST API
Note: This is an optional configuration.By default, the REST API is disabled. To enable the REST API, edit the
~/.gaia/config/app.toml file, and set enable to true in the [api] section.
swagger to true or change the port of the REST API in the parameter address.
After restarting the application, access the REST API on <NODE IP>:1317.
GRPC
Note: This is an optional configuration.By default, gRPC is enabled on port
9090. The ~/.gaia/config/app.toml file is where changes can be made in the gRPC section. To disable the gRPC endpoint, set enable to false. To change the port, use the address parameter.
Sync Options
There are three main ways to sync a node on the Cosmos Hub; Blocksync, State Sync, and Quicksync. See the matrix below for the Hub’s recommended setup configuration. This guide will focus on syncing two types of common nodes; full and pruned. For further information on syncing to run a validator node, see the section on Validators. There are two types of concerns when deciding which sync option is right. Data integrity refers to how reliable the data provided by a subset of network participants is. Historical data refers to how robust and inclusive the chain’s history is.| Low Data Integrity | High Data Integrity | |
|---|---|---|
| Minimal Historical Data | Quicksync - Pruned | State Sync |
| Moderate Historical Data | Quicksync - Default | |
| Full Historical Data | Quicksync - Archive | Blocksync |
cosmoshub-4 can also leverage Quicksync’s available archive history.
For operators interested in bootstrapping a pruned node, either Quicksync or State Sync would be sufficient.
Make sure to consult the hardware section for guidance on the best configuration for the type of node operating.
Blocksync
Blocksync is faster than traditional consensus and syncs the chain from genesis by downloading blocks and verifying against the merkle tree of validators. For more information see CometBFT’s Blocksync Docs When syncing via Blocksync, node operators will either need to manually upgrade the chain or set up Cosmovisor to upgrade automatically. It is possible to sync from previous versions of the Cosmos Hub. See the matrix below for the correctgaia version. See the mainnet archive for historical genesis files.
| Chain Id | Gaia Version |
|---|---|
cosmoshub-4 | v4.2.1 |
cosmoshub-3 | v2.0.x |
cosmoshub-2 | v1.0.x |
cosmoshub-1 | v0.0.x |
Getting Started
Start Gaia to begin syncing with theskip-invariants flag. For more information on this see Verify Mainnet.
6910000. If Cosmovisor is set up then there’s nothing else to do besides wait, otherwise the node operator will need to perform the manual upgrade twice.
State Sync
State Sync is an efficient and fast way to bootstrap a new node, and it works by replaying larger chunks of application state directly rather than replaying individual blocks or consensus rounds. For more information, see CometBFT’s State Sync docs. To enable state sync, visit an explorer to get a recent block height and corresponding hash. A node operator can choose any height/hash in the current bonding period, but as the recommended snapshot period is1000 blocks, it is advised to choose something close to current height - 1000.
With the block height and hash selected, update the configuration in ~/.gaia/config/config.toml to set enable = true, and populate the trust_height and trust_hash. Node operators can configure the rpc servers to a preferred provider, but there must be at least two entries. It is important that these are two rpc servers the node operator trusts to verify component parts of the chain state. While not recommended, uniqueness is not currently enforced, so it is possible to duplicate the same server in the list and still sync successfully.
Note: In the future, the RPC server requirement will be deprecated as state sync is moved to the p2p layer in Tendermint 0.38.
State sync failed err="state sync aborted", either try restarting gaiad or running gaiad unsafe-reset-all (make sure to backup any configuration and history before doing this).
Quicksync
Quicksync.io offers several daily snapshots of the Cosmos Hub with varying levels of pruning (archive 1.4TB, default 540GB, and pruned 265GB). For downloads and installation instructions, visit the Cosmos Quicksync guide.
Snapshots
Saving and serving snapshots helps nodes rapidly join the network. Snapshots are now enabled by default effective1/20/21.
While not advised, if a node operator needs to customize this feature, it can be configured in ~/.gaia/config/app.toml. The Cosmos Hub recommends setting this value to match pruning-keep-every in config.toml.
Note: It is highly recommended that node operators use the same value for snapshot-interval in order to aid snapshot discovery. Discovery is easier when more nodes are serving the same snapshots.In
app.toml
Cosmovisor
Cosmovisor is a process manager developed to relieve node operators of having to manually intervene every time there is an upgrade. Cosmovisor monitors the governance module for upgrade proposals; it will take care of downloading the new binary, stopping the old one, switching to the new one, and restarting. For more information on how to run a node via Cosmovisor, check out the docs.Running via Background Process
To run the node in a background process with automatic restarts, it’s recommended to use a service manager likesystemd. To set this up run the following:
LimitNOFILE line and replace $(which gaiad) with $(which cosmovisor).
Run the following to setup the daemon:
Exporting State
Gaia can dump the entire application state into a JSON file. This application state dump is useful for manual analysis and can also be used as the genesis file of a new network.
Note: The node can’t be running while exporting state, otherwise the operator can expect a resource temporarily unavailable error.
Export state with:
--for-zero-height flag:
Verify Mainnet
Help to prevent a catastrophe by running invariants on each block on your full node. In essence, by running invariants the node operator ensures that the state of mainnet is the correct expected state. One vital invariant check is that no atoms are being created or destroyed outside of expected protocol, however there are many other invariant checks each unique to their respective module. Because invariant checks are computationally expensive, they are not enabled by default. To run a node with these checks start your node without the--x-crisis-skip-assert-invariants flag: