Updates and additional settings
Upgrade the testnet
These instructions are for full nodes running older testnets that would like to upgrade to the latest testnet.
1. Create Backups
Before you may upgrade your node to the latest version of testnet, you will first need to reset your data. However, resetting your data will affect your original priv_validator.json
and cargo.toml
files.
Make sure to create a backup of both of these files and then proceed to the next step.
2. Reset data
Remove the outdated files and reset the data:
Your node is now in a pristine state. Be aware that the original priv_validator.json
and config.toml
files will be affected by this command. If you had any sentry nodes or full nodes set up before, your node will still try to connect to them, but may fail if they haven't also been upgraded.
Make sure that every node has a unique priv_validator.json
. Do not copy the priv_validator.json
from an old node to multiple new nodes. Running two nodes with the same priv_validator.json
will cause you to double sign.
3. Software upgrade
Now it is time to upgrade the software. Go to the project directory and run:
If you have issues at this step, please check that you have a compatible version of GO installed (v1.18+).
The previous command uses master
as it contains the latest stable release. See the testnet repo for details on which version is needed for which testnet, and the Terra Core release page for details on each release.
Your full node is now cleanly upgraded!
Exporting state
Terra can export the entire application state to a JSON file. You can use this file for manual analysis or as the genesis file of a new network.
Export state:
You can also export a state from a particular height. The following command will export the state after the block height you specify:
If you plan to start a new network from the exported state, export with the --for-zero-height
flag:
For more information on seeds and peers, visit the Tendermint documentation.
Optimizing Memory Management
Some users of the Terra node software may experience abnormal memory usage. This behaviour is endemic in the Cosmos SDK.
You can install jemalloc
to assist in managing this issue.
Jemalloc provides better memory management than linux out of the box. You can learn more at
To install jemalloc, run the following command:
After installation, edit your terrad.service
to match the following configuration.
_28_28[Unit]_28_28Description=Terrad_28_28[Service]_28_28Type=simple_28_28User=ubuntu_28_28ExecStart=/home/ubuntu/go/bin/terrad start --home /home/ubuntu/.terra --log_level error_28_28WorkingDirectory=/home/ubuntu/.terra_28_28Restart=always_28_28RestartSec=1s_28_28SyslogIdentifier=terrad_28_28LimitNOFILE=65535_28_28Environment=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so_28_28[Install]_28_28WantedBy=multi-user.target
Additional Settings
seed_mode
In seed mode, your node constantly crawls the network and looks for peers. If another node requests addresses, it responds and disconnects. Seed mode will not work if the peer-exchange reactor is disabled.
_1seed_mode = true
seeds
To manually identify seed nodes, edit the following setting in config.toml
.
_2# Comma separated list of seed nodes to connect to_2seeds = "id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:4444"
persistent_peers
The nodes you specify are the trusted persistent peers that can help anchor your node in the p2p network. If the connection fails, they are dialed and automatically redialed for 24 hours. The automatic redial functionality uses exponential backoff and stops after 24 hours of trying to connect.
If the value of persistent_peers_max_dial_period
is more than zero, the pause between each call to each persistent peer will not exceed persistent_peers_max_dial_period
during exponential backoff, and the automatic redial process continues.
_2# Comma separated list of nodes to keep persistent connections to._2persistent_peers = "id100000000000000000000000000000000@1.2.3.4:26656,id200000000000000000000000000000000@2.3.4.5:26656"
Rosetta
Rosetta is an open-source API that organizes blockchain data into a standardized format, making it easy for developers to build cross-chain applications. Instead of creating specific code for each chain, Rosetta allows different blockchains to integrate into any exchange that uses the Rosetta API.
For more information, visit the Rosetta docs site.