How to Upgrade my node
This guide describes instructions specific to each planned Upgrade of the cored
binary.
Before the Upgrade
Prerequisites
You should run the node with cosmovisor(not with the cored
binary directly),
since the cosmovisor takes care of stopping the node and replacing the binary version automatically when an Upgrade
should be applied.
If you run a validator using cored
, you should rerun it with cosmovisor
by
following this instruction.
Proposal
When a new version of the binary is released, a proposal is created using governance.
You can check all proposals in two ways:
- At the
proposal
section at the block explorer - By using CLI
cored q gov proposals
query.
Voting
All the stakeholders and delegators may vote to support or decline the Upgrade proposal. If the delegator doesn't vote, its voting power supports the vote made by the validator.
Vote command usage:
cored tx gov vote [proposal-id] [option] [flags]
# where
# proposal-id is a `proposal_id` field from the `cored q gov proposals` query
# option values are yes/no/no_with_veto/abstain
Getting the Upgrade plan info
If more than 50% of the voting power votes "yes"(and "no with veto" is less than 30%), a new Upgrade plan is created.
You may query the pending Upgrade plan by issuing the command:
cored q upgrade plan
The result is like this:
height: "30012" # denotes the height when the Upgrade will be applied
info: "binary version" # provides more details, especially the version of the binary to install for that Upgrade
name: vX # is the name of the Upgrade
time: "0001-01-01T00:00:00Z"
upgraded_client_state: null
Warning
Your node must be prepared for the Upgrade before the specified height
.
Otherwise, after reaching that height, your validator will stop and risk to be slashed for being offline.
Upgrades
Mainnet v4patch1 upgrade
Steps
- Set the next environment variables:
export COREUM_BINARY_NAME=$(arch | sed s/aarch64/cored-linux-arm64/ | sed s/x86_64/cored-linux-amd64/)
export COREUM_CHAIN_ID="coreum-mainnet-1"
export NEW_CORED_VERSION="v4.1.0"
export UPGRADE="v4patch1"
# If you used your custom path to coreum, change it correspondingly
export COREUM_HOME=$HOME/.core/"$COREUM_CHAIN_ID"
- Download and verify the binary:
cd $HOME
curl -LO https://github.com/CoreumFoundation/coreum/releases/download/$NEW_CORED_VERSION/$COREUM_BINARY_NAME
# make it an executable.
# NOTE: This is super important to set binary's executable permission to everyone (`a+x`), not only for the owner (`u+x`).
# Otherwise `cosmovisor` will refuse to start the binary.
chmod a+x $HOME/$COREUM_BINARY_NAME
# Then verify the version:
$HOME/$COREUM_BINARY_NAME version
The printed version should match v4.1.0
. If the version doesn't match stop following this tutorial immediately!
Continuing will lead to serious problems.
-
Verify that the
cored
binary is executable by the user you used to run cosmovisor. -
Move the
cored
binary:
# Cosmovisor requires a new binary to be placed in the precise location. Create appropriate directory:
mkdir -p "$COREUM_HOME/cosmovisor/upgrades/$UPGRADE/bin"
# Replace the new binary there
mv $HOME/$COREUM_BINARY_NAME "$COREUM_HOME/cosmovisor/upgrades/$UPGRADE/bin/cored"
Testnet v4patch1 upgrade
Steps
- Set the next environment variables:
export COREUM_BINARY_NAME=$(arch | sed s/aarch64/cored-linux-arm64/ | sed s/x86_64/cored-linux-amd64/)
export COREUM_CHAIN_ID="coreum-testnet-1"
export NEW_CORED_VERSION="v4.1.0"
export UPGRADE="v4patch1"
# If you used your custom path to coreum, change it correspondingly
export COREUM_HOME=$HOME/.core/"$COREUM_CHAIN_ID"
- Download and verify the binary:
cd $HOME
curl -LO https://github.com/CoreumFoundation/coreum/releases/download/$NEW_CORED_VERSION/$COREUM_BINARY_NAME
# make it an executable.
# NOTE: This is super important to set binary's executable permission to everyone (`a+x`), not only for the owner (`u+x`).
# Otherwise `cosmovisor` will refuse to start the binary.
chmod a+x $HOME/$COREUM_BINARY_NAME
# Then verify the version:
$HOME/$COREUM_BINARY_NAME version
The printed version should match v4.1.0
. If the version doesn't match stop following this tutorial immediately!
Continuing will lead to serious problems.
-
Verify that the
cored
binary is executable by the user you used to run cosmovisor. -
Move the
cored
binary:
# Cosmovisor requires a new binary to be placed in the precise location. Create appropriate directory:
mkdir -p "$COREUM_HOME/cosmovisor/upgrades/$UPGRADE/bin"
# Replace the new binary there
mv $HOME/$COREUM_BINARY_NAME "$COREUM_HOME/cosmovisor/upgrades/$UPGRADE/bin/cored"