Manual Upgrade to 1.33.0 for CNTOOLS users

I was missing Alex’s wonderful upgrade guide, so I’ve decided to write one up myself for version 1.33.0.
Although I have not used it, Alex has released a script for updating your nodes, which can be found here. This script has been met with positive response, and I’m sure he would like all the testing and feedback available.

I’m opting for the manual update process I am familiar with. I thought others may want to follow along.
Lets begin!

Cardano Node 1.33.0

Latest

@LaurenceIO LaurenceIO released this yesterday

· 14 commits to master since this release

1.33.0

814df2c

Cardano Node version 1.33.0 is a performance-focused release, bringing significant improvements in sync time, block propagation time, and reduced memory usage. Incremental stake aggregation and reward calculation allows much more uniform computation across the epoch, reducing the likelihood of spikes in CPU usage during the reward calculation period and so improving the consistency of block production.

In addition, more information is provided during node initialisation, and changes have been made to improve the handling of unexpected shutdowns when initialising the node. DNS support for IPv6 has been added. Tracing has been provided for Plutus scripts, making it easier to debug failure conditions.

Breaking Changes

With this version, the ledger state will need to be replayed from the genesis block, meaning that the initial synchronisation may be slow. Users should account for this when deploying the node.

** Note the Breaking Changes will require extra time for the initial synchronization. You’ll want to allow 2 - 4 hours for the ledger to sync. After you’ve completed the sync on 1 relay, it is possible to copy the ledger to subsequent nodes. This will decrease your sync time to around 10 mins/node after the initial node.

Prepare for Upgrade 1.33.0

  • If available, create snapshots of your servers

  • Upgrade a relay first!

  • Update your server/OS

sudo apt update && sudo apt upgrade -y
sudo reboot
  • Run prereqs.sh
cd ~/tmp
./prereqs.sh
  • Update Cabal
cabal update

Building the Node 1.33.0

  • Stop your node
sudo systemctl stop cnode
  • Build the Node
cd ~/git
sudo rm -R cardano-node
git clone https://github.com/input-output-hk/cardano-node
cd cardano-node

git fetch --tags --all
git checkout 1.33.0

echo -e "package cardano-crypto-praos\n  flags: -external-libsodium-vrf" > cabal.project.local
$CNODE_HOME/scripts/cabal-build-all.sh

At the end it should look like:

Copying cardano-topology to /home/user/.cabal/bin/
Copying trace-dispatcher-examples to /home/user/.cabal/bin/
Copying locli to /home/user/.cabal/bin/
Copying cardano-submit-api to /home/user/.cabal/bin/
Copying cardano-cli to /home/user/.cabal/bin/
Copying plutus-example to /home/user/.cabal/bin/
Copying create-script-context to /home/user/.cabal/bin/
Copying cardano-node to /home/user/.cabal/bin/
Copying cardano-node-chairman to /home/user/.cabal/bin/
Copying tx-generator to /home/user/.cabal/bin/
  • Check your versions
cardano-node  --version

cardano-node 1.33.0 - linux-x86_64 - ghc-8.10
git rev 814df2c146f5d56f8c35a681fe75e85b905aed5d

cardano-cli --version

cardano-cli 1.33.0 - linux-x86_64 - ghc-8.10
git rev 814df2c146f5d56f8c35a681fe75e85b905aed5d

Start the Node

  • Restart the Node
sudo systemctl restart cnode
  • The node will now replay the ledger. This may take most people 2 - 4 hours. During this time, gLiveView will show “starting.”

1.33.0starting

  • After a few hours, my ledger was rebuilt and my node is ready to contribute to the chain!

running1.33.0

Afterthoughts

This will only work for additional nodes after fully upgrading/starting a node
I was able to cut down on the time required to restart subsequent nodes by the following:

  • Upgraded subsequent nodes to 1.33.0
  • Before restarting cnode, I copied the newly synced /opt/cardano/cnode/db/ledger files from my fully synced relay to subsequent nodes.
  • Restarted cnode, start time was reduced to about 10 mins

Thanks for reading along!

9 Likes

https://forum.cardano.org/t/script-for-node-software-upgrade-cntools-users/91065

1 Like

Hi. I have tried with both ways. On this and with the script. all the processes work fine. But in the end when i try the cardano-node --version it gives me the old 1.32.1

I’ve one instance with CNTools (prereques.sh and stuff) and other with CoinCashew. Both (two distinct computers) i had the same result. In the end it gives me the 1.32.1

what this can be?

type cabal - -version
ghc - -version

maybe u will need to update them before

ghcup upgrade (just to make sure ghcup is on the latest version)
ghcup install ghc 8.10.4
ghcup set ghc 8.10.4
ghc --version (just to check the correct version)
ghcup install cabal 3.4.0.0
ghcup set cabal 3.4.0.0
cabal --version (just to check the correct version)

PS: what guide did u used when u installed the node first time… coincashew or cntools?

Thanks for the script @Alexd1985. Works great!

1 Like

CNTools. After i done with everything cardano-node --version still at 1.32.1
I tryed manual update, the script ./prereqs.sh -f -n testnet
(im on the testnet)
everything works fine. No error message. But the end don’t change…
Should i delete and unnistal the node?

did u updated the ghc and cabal as I mentioned earlier?

Yes, even tho i noticed that when i run ./prereques.sh it gives me this:
[ Info ] GHC 8.10.7 successfully set as default version.

Ok, nano softwar_upgrade.sh and comment the last line (add # in front of the line); should be

# ./gLiveView.sh

Save it and run again… I think the files couldn’t be copied to $HOME/.cabal/bin folder

Before to do it, can u type

cd $HOME/.cabal
ls - l and share the output? Perhaps some wrong rights/permisions aplied to that folder?

The result of ls -l on $HOME/.cabal
drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 9 19:08 bin
-rw-rw-r-- 1 ubuntu ubuntu 5385 Jan 4 19:55 config
drwxrwxr-x 4 ubuntu ubuntu 4096 Jan 9 15:55 logs
drwxrwxr-x 3 ubuntu ubuntu 4096 Jan 4 19:55 packages
drwxr-xr-x 4 ubuntu ubuntu 4096 Jan 9 15:55 store

Now i will run the sofwar_upgrade.sh
(Thank you for all your help!)

1 Like

He didn’t find the cabal-build-all.sh. But if i do manually using the cabal-build-all.sh inside the /git/cardano-node/scripts it should work right? There is a PATH wrong…

Note: switching to ‘1.33.0’.

HEAD is now at 814df2c14 Merge #3458
./software_upgrade.sh: line 90: /scripts/cabal-build-all.sh: No such file or directory
The software upgrade is succesfully, starting the node
The node has been started… opening gLiveView!
./software_upgrade.sh: line 97: cd: /scripts: No such file or directory
ubuntu@cnode-testnet:/opt/cardano/cnode/scripts$ cardano-node --version
cardano-node 1.32.1 - linux-aarch64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648

Then u have an issue with the path (bashrc file)

try cd $CNODE_HOME/scripts/ (here must be the script)

ls -l

total 1236
-rwxr-xr-x  1 ubuntu ubuntu   2057 Jan  9 21:10 cabal-build-all.sh
-rw-rw-r--  1 ubuntu ubuntu     62 Jan  9 21:10 cabal.project.local
drwxr-xr-x 22 root   root     4096 Jan  9 21:19 cardano-node
-rwxr-xr-x  1 ubuntu ubuntu  34367 Jan  9 21:10 cncli.sh
-rwxr-xr-x  1 ubuntu ubuntu  34367 Jan  9 21:10 cncli.sh_bkp1641704770
-rwxr-xr-x  1 ubuntu ubuntu  34367 Jan  9 21:10 cncli.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu  34367 Jan  9 21:10 cncli.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu   4839 Jan  9 21:10 cnode.sh
-rwxr-xr-x  1 ubuntu ubuntu   4839 Jan  9 21:10 cnode.sh_bkp1641704769
-rwxr-xr-x  1 ubuntu ubuntu   4839 Jan  9 21:10 cnode.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   4839 Jan  9 21:10 cnode.sh_bkp1641762647
-rw-rw-r--  1 ubuntu ubuntu 125967 Jan  9 21:10 cntools.library
-rwxr-xr-x  1 ubuntu ubuntu 335057 Jan  9 21:10 cntools.sh
-rwxr-xr-x  1 ubuntu ubuntu   6001 Jan  9 21:10 dbsync.sh
-rwxr-xr-x  1 ubuntu ubuntu   6001 Jan  9 21:10 dbsync.sh_bkp1641704769
-rwxr-xr-x  1 ubuntu ubuntu   6001 Jan  9 21:10 dbsync.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   6001 Jan  9 21:10 dbsync.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu  14671 Jan  9 21:10 deploy-as-systemd.sh
-rw-rw-r--  1 ubuntu ubuntu  52005 Jan  9 21:10 env
-rw-rw-r--  1 ubuntu ubuntu  52005 Jan  9 05:06 env_bkp1641704769
-rw-rw-r--  1 ubuntu ubuntu  52005 Jan  9 18:54 env_bkp1641754468
-rw-rw-r--  1 ubuntu ubuntu  52005 Jan  9 21:10 env_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu  51976 Jan  9 21:10 gLiveView.sh
-rw-rw-r--  1 ubuntu ubuntu     87 Jan  9 21:10 gLiveView.sh.geodb
-rwxr-xr-x  1 ubuntu ubuntu  51976 Jan  9 21:10 gLiveView.sh_bkp1641704770
-rwxr-xr-x  1 ubuntu ubuntu  51976 Jan  9 21:10 gLiveView.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu  51976 Jan  9 21:10 gLiveView.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu   3549 Jan  9 21:10 logMonitor.sh
-rwxr-xr-x  1 ubuntu ubuntu   3549 Jan  9 21:10 logMonitor.sh_bkp1641704770
-rwxr-xr-x  1 ubuntu ubuntu   3549 Jan  9 21:10 logMonitor.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   3549 Jan  9 21:10 logMonitor.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu   3365 Jan  9 21:10 ogmios.sh
-rwxr-xr-x  1 ubuntu ubuntu   3365 Jan  9 21:10 ogmios.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   3365 Jan  9 21:10 ogmios.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu   6440 Jan  9 21:10 sLiveView.sh
-rwxr-xr-x  1 ubuntu ubuntu  28244 Jan  9 21:10 setup-grest.sh
-rwxr-xr-x  1 ubuntu ubuntu  10123 Jan  9 21:10 setup_mon.sh
-rwxr-xr-x  1 ubuntu ubuntu   3149 Jan  9 21:16 software_upgrade.sh
-rwxr-xr-x  1 ubuntu ubuntu   3346 Jan  9 21:10 submitapi.sh
-rwxr-xr-x  1 ubuntu ubuntu   3346 Jan  9 21:10 submitapi.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   3346 Jan  9 21:10 submitapi.sh_bkp1641762647
-rwxr-xr-x  1 ubuntu ubuntu   1782 Jan  9 21:10 system-info.sh
-rwxr-xr-x  1 ubuntu ubuntu   6532 Jan  9 21:10 topologyUpdater.sh
-rwxr-xr-x  1 ubuntu ubuntu   6532 Jan  9 21:10 topologyUpdater.sh_bkp1641704770
-rwxr-xr-x  1 ubuntu ubuntu   6532 Jan  9 21:10 topologyUpdater.sh_bkp1641754468
-rwxr-xr-x  1 ubuntu ubuntu   6532 Jan  9 21:10 topologyUpdater.sh_bkp1641762647

Run


. "${HOME}/.bashrc"

and nano ${HOME}/.bashrc

and share the last lines with export

export NODE_CONFIG=testnet
export CARDANO_NODE_SOCKET_PATH=/db/socket
PATH=/home/ubuntu/.local/bin:/home/ubuntu/.cabal/bin:/home/ubuntu/.ghcup/bin:/home/ubuntu/.cabal/bin:/home/ubuntu/.ghcup/bin:/home>export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib:
export NODE_HOME=/home/ubuntu/cardano-my-node
export CNODE_HOME=/opt/cardano/cnode
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export CARDANO_NODE_SOCKET_PATH=//opt/cardano/cnode/db/socket

Which guide u will use? Because u have here paths for both… coincashew and cntools

CNTOOLS. As i was more acostumed to the CoinCashew in the beggining i used some of theirs. But cardano-my-node don’t exists anymore. maybe i have tryed something from theirs tutorial when i couldn’t update. What i should erase from this file ? (i never mounted the node with coincashew. I did it with CNTOOLS i found way easier.)

Ok, wait 2 minutes

delete all lines after last 2 fi and add (replace user with your user


[ -f "/home/user/.ghcup/env" ] && source "/home/user/.ghcup/env" # ghcup-env

export CNODE_HOME=/opt/cardano/cnode
export CARDANO_NODE_SOCKET_PATH=/opt/cardano/cnode/sockets/node0.socket
source "$HOME/.cargo/env"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

should be like

image

save and run again


. "${HOME}/.bashrc"

Now run the script again ./software_upgrade.sh

This is the final part of the cat .bashrc and then i try to save (sorry for noobish questions):

[ -f "/home/ubuntu/.ghcup/env" ] && source "/home/ubuntu/.ghcup/env" # ghcup-env

export CNODE_HOME=/opt/cardano/cnode
export CARDANO_NODE_SOCKET_PATH=/opt/cardano/cnode/sockets/node0.socket
source "$HOME/.cargo/env"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ubuntu@cnode-testnet:~$ . "${HOME}/.bashrc"
-bash: /home/ubuntu/.cargo/env: No such file or directory

Try to delete this line and run again


. "${HOME}/.bashrc"