# Upgrade Guide v3.0
This document provides guidelines for node operators upgrading from Regen Ledger v2.1 to v3.0. For a general overview of the upgrade process, please refer to Upgrade Overview.
# Upgrade Details
# Regen Ledger v3.0
# Regen Mainnet
- Upgrade Height:
4623339
# Redwood Testnet
- Upgrade Height:
2459670
# 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 is required.
# 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 can be configured to automatically download upgrade binaries. It is recommended that validators do not use the auto-download option and that the upgrade binary is prepared manually. If you would like to enable the auto-download option, update the following environment variable in the systemd configuration file:
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
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
Note: The following steps are not required if the auto-download option was enabled.
Either download the upgrade binary (v3.0.0
) or build it from source:
cd regen-ledger
git fetch --all
git checkout v3.0.0
make build
Create the folder for the upgrade binary (v3.0.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/v3.0.0/bin
cp $HOME/regen-ledger/build/regen $HOME/.regen/cosmovisor/upgrades/v3.0.0/bin
At the proposed block height, cosmovisor
will automatically stop the current binary (v2.1.0
), set the upgrade binary as the new current binary (v3.0.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 (v3.0.0
) or build it from source:
cd regen-ledger
git fetch --all
git checkout v3.0.0
make install
Ensure the regen
binary has been updated:
regen version
Restart the process running regen
.