Upgrade to 1.35.4 for Coincashew users

Hi all,

Here’s an upgrade guide for 1.35.4 for Coincashew users. Credit to @Gaia-Stake-Pool as I copied his last one and just amended it. It’s a straight forward upgrade from 1.35.3, but if you’re upgrading from an earlier version (you shouldn’t be running anything earlier now!), there are a few more steps.

Update Instructions:

Update and restart your instance:

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

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.35.4

Note: make sure you have ghc 8.10.7 and cabal 3.6.2.0 before proceeding.

(There is a newer version of ghc 9.2.2 but it does not work for this version of Cardano Node, so do not upgrade to this version of ghc.)

ghcup upgrade
ghcup install ghc 8.10.7
ghcup set ghc 8.10.7
ghcup install cabal 3.6.2.0
ghcup set cabal 3.6.2.0
cabal update
ghc --version
cabal --version

Build the node:

cd $HOME/git/cardano-node2
cabal configure -O0 -w ghc-8.10.7
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" >> cabal.project.local
cabal build cardano-node cardano-cli

This upgrade takes about 20 minutes.

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

If it shows 1.35.4, you can 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

Check that successful version upgrades then start back up Cardano node:

cardano-node version
cardano-cli version

sudo systemctl start cardano-node

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

4 Likes

Thanks jeremyisme for the summary.
May I mention these 2 points that made it work for me:

  • in the “echo …” command, should be “>>” instead of “>”
  • I had to add this command “cabal update” before "git fetch --all
Cheers!

Hmm, I’ve never had to do a cabal update for before fetching the git repo. But if it worked for you, it worked!

Same with the > I only used a single, but if the >> works for you, it might be helpful for someone else.

Thanks

In case others need to understand what is the difference between “>” and “>>”. These both redirect stdout of the previous command to a file. However, the difference between the two is that the single “>” recreates the file whereas the double “>>” appends to the file if it already exists and only creates the file if it didn’t already exist.

So for the command with single ‘>’:

echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local

This will delete any existing “cabal.project.local” file and re-create it anew before sending the text “package cardano-crypto-praos\n flags: -external-libsodium-vrf” to this new file. Nb: The “\n” character creates a new line. So after this command you will have a new file cabal.project.local containing just two lines of text.

The problem is that your previous command above:

cabal configure -O0 -w ghc-8.10.7

actually already created the file cabal.project.local to contain something like:

ignore-project: False
with-compiler: ghc-8.10.7
split-sections: True
executable-stripping: True
library-stripping: True
optimization: True

So your redirected output from your echo command deleted this file and re-created it.

This is why what you really want to do is the following:

cd $HOME/git/cardano-node2
cabal configure -O0 -w ghc-8.10.7
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" >> cabal.project.local
cabal build cardano-node cardano-cli

IE: with the double “>>”. Because this will result in your cabal.project.local file looking something like:

ignore-project: False
with-compiler: ghc-8.10.7
split-sections: True
executable-stripping: True
library-stripping: True
optimization: True
package cardano-crypto-praos
  flags: -external-libsodium-vrf

Here is a couple of articles that explain shell redirection of stdin, stdout, stderr that I just found quickly with google (hopefully they are good explanations):

3 Likes

Thanks for that.

I’m not quite sure what the impact the difference has for me though. The commands work with only “>” (for me at least), i.e. it still builds with only the “two line” cabal.project file

1 Like

@jeremyisme Maybe it is worth just checking what you are deleting. You could cat your cabal.project.local file just before you run the echo command.

I am not a Haskell compiler expert but removing things like:

split-sections: True
executable-stripping: True
library-stripping: True
optimization: True

might have an impact on the size of your binary, execution speed, or memory usage, even though it may still compile.

Yeah, I’ll look into this a bit more. I had re-adapted these commands from some previous guidance. But I can see there could be a difference between appending or replacing. I’ll edit this one with the >> instead as I think you’re right.

I might rebuild one of my nodes using it and see if there is any impact.

1 Like