Update Cardano Node to 1.31.0 - for Coincashew users

Cardano Node 1.31.0 Release:

Cardano node version 1.31.0 introduces a number of new features and provides performance improvements, including reducing default logging information, and optimising memory and time behaviour.

It is recommended that all users upgrade to this new version.

Breaking Changes

  • Update min utxo calculation cli command #3181
    calculate-min-req-utxo requires a transaction output ( TxOut era ) instead of a Value in order to calculate the min required UTxO in the Alonzo era. This is required in the Alonzo era, and the change is made everywhere for consistency.

Update Instructions:

  1. Update and restart your instance:
sudo apt-get update && sudo apt-get upgrade -y && sudo reboot
  1. Download latest cardano-node git and checkout latest branch
cd $HOME/git
git clone https://github.com/input-output-hk/cardano-node.git cardano-node2
cd cardano-node2/
git fetch --all --recurse-submodules --tags
git checkout tags/1.31.0

Note: make sure you to have at least ghc 8.10.4 and cabal 3.4.0 before proceeding.

(There is a newer version of cabal but I don’t think it’s required for this upgrade - cardano-node/install.md at master · input-output-hk/cardano-node · GitHub - use at your own caution as I have not tested compiling with newer version, I suggest to stick with 3.4.0 for this build.)

ghcup upgrade
ghcup install ghc 8.10.4
ghcup set ghc 8.10.4
ghcup install cabal
ghcup set cabal
cabal update
ghc --version
cabal --version
  1. Build the node.
cd $HOME/git/cardano-node2
cabal configure -O0 -w ghc-8.10.4
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local
cabal build cardano-node cardano-cli
  1. Check cardano-cli and cardano-node that the build was successful
$(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
  1. If on 1.31.0, shut down the node and move the binaries to your bin
sudo systemctl stop cardano-node
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
  1. Check that successful version upgrades then start back up Cardano node
cardano-node version
cardano-cli version
sudo systemctl start cardano-node
  1. Clean up
cd $HOME/git/
rm -rf cardano-node-old
mv cardano-node cardano-node-old
mv cardano-node2 cardano-node

Monitor the progress by either using gliveview or journalctl

journalctl --unit=cardano-node --follow 

Additional Steps:

Copy the cardano-cli binaries to your air gap machine. You can copy from your /usr/local/bin or from the new build to a USB drive

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

On the airgap - plug in USB to airgap and copy files to /usr/local/bin

sudo cp cardano-cli /usr/local/bin

Thanks for sharing. :pray:


The release information lacks details about the new CLI command: “ includes a new CLI command to query stake pools”

Is it possible to be more specific ? What is the new query introduced in the CLI?

Thanks for this

1 Like

Thanks DavidNC!

My relay became unresponsive during the install period which failed as my instance seemed to max out the CPU. So on my second attempt I stopped the relay node (sudo systemctl stop cardano-node) before the cabal configure step. If you have limited CPU this might help.

Hi @regel, I haven’t use this command myself but I’ve posted the breaking change in case any one is using it and is aware for the upgrade

Thanks for sharing, glad you’ve got it to update!

Is it the CPU or RAM? I’ve had my old instances crashed from RAM (never had one crash due to CPU from what I can remember) but then upgraded to 16GB RAM w/ SWAP memory for cushion.

It may have been RAM I noticed the CPU max at 99.9 in AWS monitoring then when the instance became responsive again I restarted the procedure. I’m also running 16GB RAM - seems like I should investigate SWAP just in case.

1 Like

Thanks David.
I think for the sake of completeness, it would be good to include the instruction about updating the air-gapped offline machine (cold environment) with the new Cardano CLI binaries.

copy the cardano-cli binaries from your /usr/local/bin or from the new build to a USB drive

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

On the Airgap - plug in USB to airgap and copy files to /usr/local/bin

sudo cp cardano-cli /usr/local/bin
1 Like

Uhul! Thank you :clap: :brazil:

1 Like

Actually I meant include those instructions or the simple reminder to copy the cardano-cli binary to the offline machine at the end of your tutorial so that anybody following the steps for the first time won’t forget to also copy the binary to the offline machine.

perfect - I’ll add reminder to post

1 Like

Can anybody provides info on how much RAM on relay does this new update consumes, because i have 12 GB and it crashes because its hitting a limit.

Stop your nodes then perform the update. Or add 4-8gb of swap memory. Nodes will be at degraded performance on swap but at least still operational

Hi, when I try to set the cabal with ghcup it doesn’t appear, I think is a Path error but I don’t know what I have to do, any help is grateful

its not cabal-install; it’s just cabal

As always, Thank you Good Sir for your diligent work. It is people like you who strengthen and enrich our amazing community.

Getting this back when I try any cabal commands. Fairly new to all of this so if anyone can let me know what to do that’d be lovely.

Not sure if anybody is aware, but from 13th of November it is recommended to use GHC version 8.10.7, as stated in official documentation: