# Upgrade Guide v2.0

This document provides guidelines for node operators upgrading from Regen Ledger v1.0 to v2.0. For a general overview of the upgrade process, please refer to Upgrade Overview.

Update: A patch release (v2.1.0) was released soon-after the v2.0 upgrade. This document has been updated to use the v2.1.0 as the upgrade binary rather than v2.0.0.

# Upgrade Details

# Regen Ledger v2.0

# Regen Mainnet

  • Upgrade Height: 3003343

# Redwood Testnet

  • Upgrade Height: 548703

# Upgrade Guidelines

# Update Go

The latest version of Go (1.17) is required. For more information, see Go (opens new window).

# Option 1: Using Cosmovisor

The following instructions assume the regen and cosmovisor binaries are already installed and cosmovisor is set up as a systemd service. If this is not the case, please refer to Run a Full Node for instructions on how to install and set up the binaries.

Cosmovisor 1.0 with the auto-download option disabled is required. Node operators must prepare the upgrade binary in advance.

WARNING

The auto-download option is not supported in Cosmovisor v1.0 when upgrading from Regen Ledger 1.0 (because it uses Cosmos SDK v0.42). Enabling the auto-download option will result in an error and a failed restart at the time of the upgrade.

# Configure Cosmovisor

Note: The following steps are not required if Cosmovisor v1.0 is already installed and configured to your preferred settings.

To install cosmovisor, run the following command:

go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0

Check to ensure the installation was successful:

cosmovisor version

Update cosmovisor systemd service file and make sure the environment variables are set to the appropriate values (the following example includes the recommended settings):

echo "[Unit]
Description=Cosmovisor daemon
After=network-online.target
[Service]
Environment="DAEMON_NAME=regen"
Environment="DAEMON_HOME=${HOME}/.regen"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="UNSAFE_SKIP_BACKUP=false"
User=${USER}
ExecStart=${GOBIN}/cosmovisor start
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
" >cosmovisor.service

Cosmovisor will automatically create a backup of the data directory at the time of the upgrade and before the migration. If you would like to disable the auto-backup, update the following environment variable in the systemd configuration file:

Environment="UNSAFE_SKIP_BACKUP=true"

Move the file to the systemd directory:

sudo mv cosmovisor.service /lib/systemd/system/cosmovisor.service

Restart cosmovisor to ensure the environment variables have been updated:

sudo systemctl stop cosmovisor
sudo systemctl daemon-reload
sudo systemctl start cosmovisor

Check the status of the cosmovisor service:

sudo systemctl status cosmovisor

Enable cosmovisor to start automatically when the machine reboots:

sudo systemctl enable cosmovisor.service

# Prepare Upgrade Binary

Either download the upgrade binary (v2.1.0) or build it from source:

cd regen-ledger
git fetch --all
git checkout v2.1.0
make build

Create the folder for the upgrade binary (v2.1.0) and copy the regen binary into the folder. This next step assumes that the regen binary was built from source and stored in the build directory:

mkdir -p $HOME/.regen/cosmovisor/upgrades/v2.0-upgrade/bin
cp $HOME/regen-ledger/build/regen $HOME/.regen/cosmovisor/upgrades/v2.0-upgrade/bin

At the proposed block height, cosmovisor will automatically stop the current binary (v1.0.0), set the upgrade binary as the new current binary (v2.1.0), and then restart the node.

# Option 2: Without Cosmovisor

Using Cosmovisor to perform the upgrade is not mandatory. Node operators also have the option to manually update the regen binary at the time of the upgrade.

When the chain halts at the proposed upgrade height, stop the current process running regen.

Either download the upgrade binary (v2.1.0) or build it from source:

cd regen-ledger
git fetch --all
git checkout v2.1.0
make install

Ensure the regen binary has been updated:

regen version

Restart the process running regen.