# 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
haqqd. 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 Haqq 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 Haqq on your system.
If the software version does not match, then please check your $PATH to ensure the correct haqqd 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
cosmovisoris 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 (~/.haqqd).
# 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
<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
haqqd start on an old, broken genesis file.
# Ensure that you have set peers
~/.haqqd/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
If you are relying on just seed node and no persistent peers or a low amount of them, please increase the following params in
# 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 it is not breaking (eg. from
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
haqqd 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
# Export State
Haqq 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
Then, replace the old
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:
# Restart Node
To restart your node once the new genesis has been updated, use the