Skip to main content

Upgrading to Cardano Node 1.30.1

Important
Important

Cardano Node 1.30.1 and was released on September 28, 2021 and is no longer supported.

🎉 Introduction​

info

This latest update brought to you by the generous donations by BEBOP stake pool.

If you want to support this free educational Cardano content or found this helpful, visit cointr.ee to find our donation addresses. Much appreciated in advance. 🙏

tip

As of Oct 1 2021, this guide is written for mainnet with release v1.30.1 😁

📡 How to Perform an Upgrade​

From time to time, there will be new versions of cardano-node. Follow the Official Cardano-Node Github Repo by enabling notifications with the watch functionality.

danger

Read the patch notes for any other special updates or dependencies that may be required for the latest release.

Full release notes: https://github.com/input-output-hk/cardano-node/releases/tag/1.30.1

Upgrading Release Dependencies​

CNCLI

If you use CNCLI for leaderlogs and sendslots, then you must upgrade to cncli version 4.0.1


RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
echo "Installing release ${RELEASETAG}"
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/

To confirm that the new version of CNCLI is installed, type:

cncli -V

It should return the updated version number.

gLiveView

cd ${NODE_HOME}
curl -s -o gLiveView.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/gLiveView.sh
curl -s -o env https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/env
chmod 755 gLiveView.sh
# Update env file with the stake pools configuration.
sed -i env \
-e "s/\#CONFIG=\"\${CNODE_HOME}\/files\/config.json\"/CONFIG=\"\${NODE_HOME}\/mainnet-config.json\"/g" \
-e "s/\#SOCKET=\"\${CNODE_HOME}\/sockets\/node0.socket\"/SOCKET=\"\${NODE_HOME}\/db\/socket\"/g"

Compiling the New Binaries​

To update with $HOME/git/cardano-node as the current binaries directory, clone a new git repo named cardano-node2 so that you have a backup in case of rollback. Remove the old binaries.

cd $HOME/git
rm -rf cardano-node-old/
git clone https://github.com/input-output-hk/cardano-node.git cardano-node2
cd cardano-node2/

Run the following command to pull and build the latest binaries. Change the checkout tag or branch as needed.

cd $HOME/git/cardano-node2
cabal update
git fetch --all --recurse-submodules --tags
git checkout $(curl -s https://api.github.com/repos/input-output-hk/cardano-node/releases/latest | jq -r .tag_name)
cabal configure -O0 -w ghc-8.10.4
cabal build all
cabal build cardano-cli
info

Build process may take a few minutes up to a few hours depending on your computer's processing power.

Verify your cardano-cli and cardano-node were updated to the expected version.

$(find $HOME/git/cardano-node2/dist-newstyle/build -type f -name "cardano-cli") version
$(find $HOME/git/cardano-node2/dist-newstyle/build -type f -name "cardano-node") version
danger

Stop your node before updating the binaries.

sudo systemctl stop cardano-node

Copy cardano-cli and cardano-node files into bin directory.

sudo cp $(find $HOME/git/cardano-node2/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
sudo cp $(find $HOME/git/cardano-node2/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node

Verify your cardano-cli and cardano-node were copied successfully and updated to the expected version.

cardano-node version
cardano-cli version
info

Optional Best Practice: Now is an opportune time to update/upgrade and reboot your Ubuntu operating system.

sudo apt-get update && sudo apt-get upgrade -y && sudo reboot
tip

Now restart your node to use the updated binaries. If you used the previously mentioned optional best practice, your binaries should've already auto-started.

sudo systemctl start cardano-node

Finally, the following sequence will switch-over to your newly built cardano-node folder while keeping the old directory for backup.

cd $HOME/git
mv cardano-node/ cardano-node-old/
mv cardano-node2/ cardano-node/

Verify that your node is working successfully by either checking gLiveView, your other journalctl logs, or grafana dashboard.

cd ${NODE_HOME}
./gLiveView.sh
info

It may take some time to start a node, sometimes up to 30 minutes. gLiveView may appear stuck on "Starting..." but this is normal behavior and simply requires time.

danger

🤖 Important Reminder: Don't forget to update your air-gapped offline machine (cold environment) with the new Cardano CLI binaries.

tip

Congrats on completing the update. ✨

Did you find our guide useful? Send us a signal with a tip and we'll keep updating it.

It really energizes us to keep creating the best crypto guides.

Use cointr.ee to find our donation addresses. 🙏

Any feedback and all pull requests much appreciated.

Hang out and chat with our stake pool community on Telegram @ https://t.me/coincashew

Troubleshooting​

🛣 Forked off​

Forget to update your node and now your node is stuck on an old chain?

Reset your database files and be sure to grab the latest genesis, config, topology json files.

cd $NODE_HOME
rm -rf db

Reverting to a Previous Version Using a Backup​

danger

Stop your node before updating the binaries.

sudo systemctl stop cardano-node

Restore the old repository.

cd $HOME/git
mv cardano-node/ cardano-node-rolled-back/
mv cardano-node-old/ cardano-node/

Copy the binaries to /usr/local/bin

sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node

Verify the binaries are the correct version.

/usr/local/bin/cardano-cli version
/usr/local/bin/cardano-node version
tip

Now restart your node to use the updated binaries.

sudo systemctl start cardano-node

🤖 Last Resort: Rebuild the Stake Pool​

Repeat the steps to set up your stake pool.