Upgrading Nodes

This is a special section dedicated to tips related to updating Cardano nodes.

NOTES: This section is specific to nodes that were created manually or with the use of Coincashew tutorials. For instructions on how to upgrade nodes created using automated tools like CNTOOLS, please refer to the instructions in the respective tool pages.

Note also that we made a script for nodes that already have the necessary pre-requisites installed (e.g. libsodium, secp256k1, cabal 3.6.2, ghc 8.10.7). You may want to check that out first before proceeding with the full manual steps below. The script can be found in this link: http://github.com/bclens/scripts/blob/main/jupgradenode.sh

Upgrading Cardano nodes to 1.35 and above

These are my compiled steps to upgrade nodes to Cardano 1.35 and above for nodes built using Coincashew or manual methods. This is NOT meant for nodes that were built using CNTOOLS. Some good reference material have already been built for that.

While there has been material for Coincashew/manual builds, I have not seen a complete compilation yet which includes backup steps, dependency installation, and some procedures that can reduce total downtime.

As of this writing, Coincashew still had the steps to upgrade to a previous version which was mostly parameterized. This makes it easy to update but not as easy to follow. Hopefully, this sharing can help people who need it.

Credits go to the incredible people/organizations from whom I copied large portions to create this procedure including IOHK, Coincashew, Jack7E and jf3110

DISCLAIMER:

These upgrade steps are shared in good faith. While I have done multiple tests to ensure it is working before I shared it, you may encounter issues unique to your setup. For example, it is likely that your directories and currently installed apps are different from mine.

Therefore, please do your own checks and adjust the commands accordingly to suit your environment.

To be safe, I suggest that you backup your node first before doing the upgrade so you can easily fall back to your backup if something goes wrong. As usual, try the upgrade on your testnet nodes first and make sure they are working before updating mainnet. Good luck!

Start of upgrade procedures

Install new dependencies and update apps

sudo apt-get install nano llvm-12 numactl libnuma-dev autoconf automake libtool -y 
sudo apt update 
sudo apt upgrade -y
cd ~/git # Create this directory if not existing 
git clone https://github.com/bitcoin-core/secp256k1.git 
cd secp256k1 git reset --hard ac83be33d0956faf6b7f61a60ab524ef7d6a473a 
./autogen.sh 
./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental 
make 
make check 
sudo make install

Upgrade GHCup installer to latest version

Install ghc

Install cabal

Build New Binaries

Prepare for the Build

At this point, if you want to keep your node up as long as possible, I recommend you DO NOT shutdown your node and update your Config files yet. You can do this at a later stage after you have compiled the new binaries

Checkout the Build

Check out the version that you want to install. Choose from one of the options below:

Option 1: If you just want to install the latest suggested version, run the following:

Option 2: If you want instead to install a specific version (e.g. 1.35.2), run the following:

Build the Binaries

Continue building the binaries by running the following:

Backup Important Files

To save time, this section can be run while the previous command (cabal build cardano-node cardano-cli) is still running.

You must run this from another terminal window if you want to do this simultaneously with the previous command

Remember to change all items marked testnet to mainnet if you are upgrading Mainnet

Backup Current Config files

Backup binary files

Assuming /usr/local/bin is the location of your cardano-node and cardano-cli files.

If not, change the directory location below as needed.

This ends the section of the commands that should be run from another terminal window

Resume Upgrade

After the "cabal build cardano-node cardano-cli" command completes, verify that you have the correct version numbers:

Copy latest config files

Stop Cardano node before updating config files

Use these commands to refresh the config files from IOHK:

WARNING: You probably don't want to overwrite your current topology files (I don't recommend unless you know how to recover this). However, if for some reason you want to, you can run the command below (proceed with caution).

Install the new binary files

Copy the new binary files to /usr/local/bin

Verify versions are properly installed

Reboot to refresh the system

Start Cardano Service

The Cardano service should automatically start after rebooting. However, if you did not configure it to auto-start, you can start it manually using this command

Organize the git directory

That's it! You have completed the upgrade to Cardano 1.35.0

OPTIONAL:

Do this only if you are encountering "Could not resolve.." errors due to missing Libsodium:

Install Libsodium

Update .bashrc

Add the following to your ~/.bashrc file and source it:


Last updated

Was this helpful?