# Join the Public Testnet
Current Upgrade | Chain Id | Upgrade Block Height | Upgrade Date |
---|---|---|---|
Theta | theta-testnet-001 | 9283650 | March 17 2021 |
# Background
The current Cosmos Hub Testnet is running on the Theta Upgrade (opens new window). Visit the testnet explorer (opens new window) to view all on chain activity.
For those who just need instructions on performing the upgrade, see the Upgrade section.
# Releases
If syncing before the Theta update, checkout v6.0.0
(opens new window). Until a release is cut for the upgrade, feel free to track the theta-prepare
branch (opens new window).
# Prerequisites
Hardware
It's recommended that public testnet nodes are running on machines with at least 16GB
of RAM.
Make sure Go & Gaia are properly installed. The most recent Gaia version for the Theta Testnet is v7.0.0-rc0
(opens new window).
This tutorial will provide all necessary instructions for joining the current public testnet. If you're interested in more advanced configuration and synchronization options, see Join Mainnet for a detailed walkthrough.
# Sync Options
There are two ways to sync a testnet node, Blocksync and State Sync. Blocksync (opens new window) syncs the chain from genesis by downloading blocks in paralell and then verifying them. State Sync (opens new window) will look for snapshots from peers at a trusted height and then verifying a minimal set of snapshot chunks against the network.
State Sync is far faster and more efficient than Blocksync, but Blocksync offers higher data integrity and more robust history. For those who are concerned about storage and costs, State Sync can be the better option as it minimizes storage usage when rebuilding initial state.
# Configuration & Setup
To get started, you'll need to install and configure the Gaia binary using the script below. For Blocksync, it is important to checkout Gaia release/v6.0.0
. For State Sync checkout the most recent testnet release (opens new window) until the upgrade is performed
This example is using the Theta testnet genesis. For up to date values like seeds
, visit the testnet repository (opens new window).
Note: Cosmos Hub recommends running
gaiad
orcosmovisor
with the--x-crisis-skip-assert-invariants
flag. If checking for invariants, operators are likely to seerounding error withdrawing rewards from validator
. These are expected. For more information see Verify Mainnet
# State Sync
State Sync requires Gaia version v6.0.0
(opens new window) until the upgrade is performed.
Check out the quickstart script (opens new window) to bootstrap a Theta testnet node and configure as needed
There will need to be additional configuration to enable State Sync on the testnet. State Sync requires setting an initial list of persistent_peers
to fetch snapshots from. This will change and eventually move to the p2p layer when the Cosmos Hub upgrades to Tendermint v0.35
(opens new window). For the sake of simplicity, this step is already done in the Configuration & Setup section.
Visit a testnet explorer (opens new window) 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 is 1000 blocks, it is advised to choose something close to current height - 1000. Set these parameters in the code snippet below <BLOCK_HEIGHT>
and <BLOCK_HASH>
For up to date values like rpc_servers
, visit the current testnet repository (opens new window).
Now run gaiad start --x-crisis-skip-assert-invariants
or if using Cosmovisor, cosmovisor start --x-crisis-skip-assert-invariants
. Once a snapshot is found and verified, the chain will start syncing via regular consensus within minutes.
# Using Cosmovisor
Cosmovisor is a process manager that monitors the governance module for incoming chain upgrade proposals. When a proposal is approved, Cosmovisor can automatically download the new binary, stop the chain when it hits the upgrade height, switch to the new binary, and restart the daemon. This tutorial will provide instructions for the most efficient way to sync via Cosmovisor. For more information on configuration, check out the Cosmos SDK's Cosmovisor repository documentation (opens new window).
Cosmovisor can be used when syncing with Blocksync or State Sync. Make sure to follow the Cosmovisor setup below, and then run cosmovisor start
in place of gaiad start
.
Cosmovisor requires the creation the following directory structure:
It is possible to enable autodownload for the new binary, but for the purpose of this tutorial, the setup instructions will include how to do this manually. For more information on autodownload with Cosmovisor, see the full docs on setting up Cosmosvisor (opens new window).
The following script installs, configures and starts Cosmovisor:
# Prepare Theta upgrade directory
mkdir -p ~/.gaia/cosmovisor/upgrades/Theta/bin
# Download and install the new binary version.
cd $HOME/gaia
git pull
git checkout
# Move the new binary to the Theta upgrade directory
cp $GOPATH/bin/gaiad ~/.gaia/cosmovisor/upgrades/Theta/bin
cd $HOME/gaia
git checkout