Initia: upgrade guide

Initia  guide  upgrade 

Upgrade History

The following table presents a list of the initiation-1 testnet upgrades history.

Each version is identified by a specific id, tag, block height and software upgrade proposal.

ID Tag Starting Block Release Proposal
`` v0.2.15 0 Release N.A. (Genesis)
initiation-stage-2 v0.2.23-stage-2 2470000 Release 159

Upgrade binaries

v0.2.15 (this prebuilt binaries are absent)
{
  "binaries": {
    "darwin/arm64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.15_Darwin_aarch64.tar.gz",
    "darwin/amd64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.15_Darwin_x86_64.tar.gz",
    "linux/arm64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.15_Linux_aarch64.tar.gz",
    "linux/amd64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.15_Linux_x86_64.tar.gz",	
  }}
v0.2.23-stage-2
{
  "binaries": {
    "darwin/arm64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.23-stage-2_Darwin_aarch64.tar.gz",
    "darwin/amd64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.23-stage-2_Darwin_x86_64.tar.gz",
    "linux/arm64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.23-stage-2_Linux_aarch64.tar.gz",
    "linux/amd64": "https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_v0.2.23-stage-2_Linux_x86_64.tar.gz",	
  }}

Upgrade preparations

Option 1. Download prebuilt binaries

Choose the right binary to download, depends on your system and architecture. For example, for Linux/Amd64 it will be:

vers="v0.2.23-stage-2";
sys="Linux";
arch=x86_64;

url_for_download="https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/initia_${vers}_${sys}_${arch}.tar.gz";

Create directory for download bin:

mkdir -vp ${HOME}/prebuilt_bin/

Download and unzip binaries:

wget -O "${HOME}/prebuilt_bin/initia_${vers}_${sys}_${arch}.tar.gz" ${url_for_download}

tar -xzf ${HOME}/prebuilt_bin/initia_${vers}_${sys}_${arch}.tar.gz -C ${HOME}/prebuilt_bin/ && \
rm ${HOME}/prebuilt_bin/initia_${vers}_${sys}_${arch}.tar.gz

chmod +x ${HOME}/prebuilt_bin/initiad

Option 2. Build binary from the source code

Here you can find how to build Initia node with pebbledb. Below we will describe goleveldb upgrade process.

Fetch new data from the Initia' Repo:

git clone https://github.com/initia-labs/initia.git
cd $HOME/initia;
git pull;
git fetch;
git reset --hard;

Ceckout new version and confirm the branch:

vers="v0.2.23-stage-2" 
git checkout ${vers}
git log -1 --pretty=oneline ;
>2f01bedf12e0fa2be0a21a6f183aadf6ac0cddb7 (HEAD, tag: v0.2.23-stage-2, origin/initiation-stage-2) update swagger

Build binary and check version & commit

make build;

cd $HOME/initia/build ;
./initiad version --long;
#output
>commit: 2f01bedf12e0fa2be0a21a6f183aadf6ac0cddb7
>cosmos_sdk_version: v0.0.0-20240514173001-c037b6c44d98
>go: go version go1.22.2 linux/amd64
>name: initia
>server_name: initia
>version: v0.2.23-stage-2

During the upgrade.

  1. Stop the Initia/cosmovisor service file.
sudo systemctl stop initiad.service && systemctl status initiad.service
  1. Save current binary (just in case):
bin_path=$(which initiad) && echo ${bin_path}
# example of the output
>~/go/bin/initiad

current_vers=$(initiad version) && echo ${current_vers}
# example of the output
>v0.2.21

#save old binary (just in case)
mv ${bin_path} ${bin_path}_${current_vers}
  1. Replace old binary with the new one:
Option 1.

mv ${HOME}/prebuilt_bin/initiad ${bin_path};

## IMPORTANT NOTE
# If arhive containde extra libraries for correct work of Binary you should move them to the "LD_LIBRARY_PATH". Usually it is:
lib_path="/usr/lib"

sudo mv ${HOME}/prebuilt_bin/libmovevm.*.so ${lib_path};
sudo mv ${HOME}/prebuilt_bin/libcompiler.*.so ${lib_path};


Option 2.

mv $HOME/initia/build/initiad ${bin_path}

and confirm the new version:

initiad version
#output
>v0.2.23-stage-2
  1. Restart the service file:
sudo systemctl restart initiad.service &&  journalctl -u initiad -f -o cat
  1. During the consensus phase backup your current priv_validator_state.json (just in case)
cp "$HOME/.initia/data/priv_validator_state.json" $HOME
  1. Checkout your prevote:
data_folder=initia
PORT=<YOUR_INITIA_NODE_RPC_PORT>

# find out the current round:
round=$(jq '.round | tonumber ' $HOME/.${data_folder}/data/priv_validator_state.json) && echo "current round you have voted for: ${round}"

curl -s localhost:${PORT}/consensus_state -s | jq '' | grep $(curl -s localhost:${PORT}/status | jq -r .result.validator_info.address[:12]) 

If you see your prevote, then you are ok! Well Done!