Upgrade from 1.26.1 to 1.26.2

quick update guide for 1.26.2 (from 1.26.1) This update is required for block producing nodes.

Quick update guide for SPOs who have the previous version already installed 1.26.1 If you are installing from scratch, then follow the installation guide: https://cardano-node-installation.stakepool247.eu/

  1. Let's start with backing up current binaries

cd ~/.local/bin/
# let's create a folder with the version number
mkdir -p $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')
# copying files to the created folder
cp cardano-node $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')/
cp cardano-cli $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')/

2. Let's move forward with upgrading the system packages

# let's update the system first
sudo bash -c 'sudo apt-get update -y;sudo apt-get upgrade -y'

3. Preparing to download the cardano-node source files

# let's create directory where we will be downloading sourece code
cd ~
mkdir -p source
cd source
# just in case you already had a sourece direcotry with cardano-node source code - let's delete it and download fresh one.
rm -rf cardano-node
# let's clone source code from git
git clone https://github.com/input-output-hk/cardano-node.git
cd cardano-node
git fetch --all --recurse-submodules --tags
# checking out the 1.26.2 version
git checkout tags/1.26.2
# let's update cabal
cabal clean
cabal update
# ensuring that we are using cabal 8.10.2 version
# by specifying the particular compiler to be used.
cabal configure --with-compiler=ghc-8.10.2
# addinng extra flages for libsodium library
echo "package cardano-crypto-praos" >> cabal.project.local
echo " flags: -external-libsodium-vrf" >> cabal.project.local
# now let's compile the code
cabal build all

Before the next step - STOP your node so it doesn't lock the carano-node file for overwriting

# moving the freshly compiled binaries to bin folder
mkdir -p ~/.local/bin/
cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-cli-1.26.2/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-node-1.26.2/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
# let's check if we have successfully installed the latst cardano-node and cardano-cli versions.
which cardano-node && which cardano-cli
cardano-node --version
cardano-cli --version

you should now have similar output:

[email protected]:~/cnode/scripts$ which cardano-node && which cardano-cli /home/cardano/.local/bin/cardano-node /home/cardano/.local/bin/cardano-cli

[email protected]:~/cnode/scripts$ cardano-node --version cardano-node 1.26.1 - linux-x86_64 - ghc-8.10 git rev 9a7331cce5e8bc0ea9c6bfa1c28773f4c5a7000f

[email protected]:~/cnode/scripts$ cardano-cli --version cardano-cli 1.26.1 - linux-x86_64 - ghc-8.10 git rev 9a7331cce5e8bc0ea9c6bfa1c28773f4c5a7000f

That's it - now just start your node and wait till the DB is updated

if you want to copy the cardano-node and cardano-cli to another server, then you need to compress the binary files using this command:

tar -czvf cardano-node-1-26-2.tar.gz ~/.local/bin/cardano-node ~/.local/bin/cardano-cli

The next step is to copy the file to the destination server (replace it with your remote server's IP address)

scp cardano-node-1-26-2.tar.gz [email protected]_remote_server_ip:/home/cardano/

if you want to specify the ssh private key for connecting to the server, then use this syntax (replace also the public key with your filename)

scp -i ~/.ssh/id_rsa cardano-node-1-26-2.tar.gz [email protected]_ip:.

then connect to the server where you copied the files and untar (unzip) the files using the following command:

tar -xvf cardano-node-1-26-2.tar.gz

Now it's time to stop the Cardano node after that execute the commands

# replacing binaries
mv home/cardano/.local/bin/* ~/.local/bin

and don't forget to start the node!

that's it - you have upgraded your node to 1.26.2, now do the same update on all of your other production servers.

Need help? 👉🏼 Join our Telegram support Group: https://t.me/StakePool247help