# Upgrade Node
Learn how to upgrade your full node to the latest software version
With every new software release, we strongly recommend validators to perform a software upgrade, in order to prevent double signing or halting the chain during consensus (opens new window).
You can upgrade your node by 1) upgrading your software version and 2) upgrading your node to that version. In this guide, you can find out how to automatically upgrade your node with Cosmovisor or perform the update manually.
# Software Upgrade
These instructions are for full nodes that have ran on previous versions of and would like to upgrade to the latest testnet.
First, stop your instance of uptickd
. Next, upgrade the software:
If you have issues at this step, please check that you have the latest stable version of GO installed.
You will need to ensure that the version installed matches the one needed for th testnet. Check the Uptick release page (opens new window) for details on each release.
Verify that everything is OK. If you get something like the following, you've successfully installed Uptick on your system.
If the software version does not match, then please check your $PATH to ensure the correct uptickd is running.
# Upgrade Node
We highly recommend validators use Cosmovisor to run their nodes. This will make low-downtime upgrades smoother, as validators don't have to manually upgrade binaries during the upgrade. Instead users can preinstall new binaries, and cosmovisor will automatically update them based on on-chain Software Upgrade proposals.
You should review the docs for Cosmovisor located here (opens new window)
If you choose to use Cosmovisor, please continue with these instructions. If you choose to upgrade your node manually instead, skip to the the instructions without Cosmovisor
# Upgrade with Cosmovisor
cosmovisor
is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, cosmovisor can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary.
# Install and Setup
To get started with Cosmovisor (opens new window) first download it
Set up the Cosmovisor environment variables. We recommend setting these in your .profile
so it is automatically set in every session.
After this, you must make the necessary folders for cosmosvisor in your daemon home directory (~/.uptickd).
# Preparing an Upgrade
Cosmovisor will continually poll the $DAEMON_HOME/data/upgrade-info.json
for new upgrade instructions. When an upgrade is ready, node operators can download the new binary and place it under $DAEMON_HOME/cosmovisor/upgrades/<name>/bin
where <name>
is the URI-encoded name of the upgrade as specified in the upgrade module plan.
It is possible to have Cosmovisor automatically download the new binary. To do this set the following environment variable.
# Download Genesis File
You can now download the "genesis" file for the chain. It is pre-filled with the entire genesis state and gentxs.
We recommend using sha256sum
to check the hash of the genesis.
# Reset Chain Database
There shouldn't be any chain database yet, but in case there is for some reason, you should reset it. This is a good idea especially if you ran uptickd start
on an old, broken genesis file.
# Ensure that you have set peers
In ~/.uptickd/config/config.toml
you can set your peers. See the peers.txt (opens new window) file for a list of up to date peers.
See the Add persistent peers section (opens new window) in our docs for an automated method, but field should look something like a comma separated string of peers (do not copy this, just an example):
You can share your peer with
Peer Format: node-id@ip:port
Example: 3d892cfa787c164aca6723e689176207c1a42025@143.198.224.124:26656
If you are relying on just seed node and no persistent peers or a low amount of them, please increase the following params in config.toml
:
# Start your node
Now that everything is setup and ready to go, you can start your node.
You will need some way to keep the process always running. If you're on linux, you can do this by creating a service.
Then update and start the node
You can check the status with:
# Upgrade Manually
# Upgrade Genesis File
If the new version you are upgrading to has breaking changes, you will have to export the state and restart your node.
If it is not breaking (eg. from v0.1.x
to v0.1.<x+1>
), you can skip to Restart after installing the new version.
To upgrade the genesis file, you can either fetch it from a trusted source or export it locally using the uptickd export
command.
# Fetch from a Trusted Source
If you are joining an existing testnet, you can fetch the genesis from the appropriate testnet source/repository where the genesis file is hosted.
Save the new genesis as new_genesis.json
. Then, replace the old genesis.json
with new_genesis.json
.
# Export State
Uptick can dump the entire application state to a JSON file. This, besides upgrades, can be useful for manual analysis of the state at a given height.
Export state with:
You can also export state from a particular height (at the end of processing the block of that height):
If you plan to start a new network for 0 height (i.e genesis) from the exported state, export with the --for-zero-height
flag:
Then, replace the old genesis.json
with new_genesis.json
.
At this point, you might want to run a script to update the exported genesis into a genesis state that is compatible with your new version.
You can use the migrate
command to migrate from a given version to the next one (eg: v0.X.X
to v1.X.X
):
# Restart Node
To restart your node once the new genesis has been updated, use the start
command: