Upgrade to 9.0.0 for Coincashew users

Hi all,

Here’s another upgrade guide for 9.0.0 for Coincashew users.

This assumes you’re running a relatively recent build. It also isn’t strictly necessary to build the node from source, as there are executables downloadable from the github repo, but some still like to build, like me. So if you don’t want to build, don’t!

This guide has been written before the hardfork has been started, i.e. the Conway Genesis file isn’t in play yet. But there will be a new version, maybe 9.1.0 when it is hardfork time. Release Cardano Node 9.0.0 · IntersectMBO/cardano-node · GitHub

Update your instance:

sudo apt-get update && sudo apt-get upgrade

Download latest cardano-node git and checkout latest branch:

cd $HOME/git
git clone https://github.com/IntersectMBO/cardano-node.git cardano-node2
cd cardano-node2/
git fetch --all --recurse-submodules --tags
git checkout tags/9.0.0

Then upgrade ghcup and do a cabal update.

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

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

Build the node:

cd $HOME/git/cardano-node2
cabal configure -O0 -w ghc-8.10.7
cabal build cardano-node cardano-cli

As a note, if you are on Ubuntu 22.04, you will need to add a constraint to your cabal.project.local file to force it to use the right HsOpenSSL, i.e. constraints: HsOpenSSL ==0.11.7.2

Or something like this

cd $HOME/git/cardano-node2
cabal configure -O0 -w ghc-8.10.7
echo "constraints: HsOpenSSL ==0.11.7.2" >> cabal.project.local
cabal build cardano-node cardano-cli

Check cardano-cli and cardano-node that the build was successful:

$(./scripts/bin-path.sh cardano-node) version
$(./scripts/bin-path.sh cardano-cli) version

The cardano-node version should be 9.0.0 and cardano-cli is 9.0.0.

Stop your node

sudo systemctl stop cardano-node

Then copy over the new executables

sudo cp -p "$(./scripts/bin-path.sh cardano-node)" /usr/local/bin/cardano-node
sudo cp -p "$(./scripts/bin-path.sh cardano-cli)" /usr/local/bin/cardano-cli

Again, check that successful version is reported:

cardano-node version
cardano-cli version

There is no Conway Genesis file for 9.0.0 yet, so remove the two lines that refer to it in the config.json to allow the new build to start. Make sure you check your config file for the minNodeVersion variable and make sure your relays and BP are consistent and have the right versions.

"ConwayGenesisFile": "conway-genesis.json",
"ConwayGenesisHash": "de609b281cb3d8ae91a9d63a00c87092975612d603aa54c0f1c6a781e33d6e1e",

Then start your node.

sudo systemctl start cardano-node

Monitor the progress by either using gliveview or journalctl, and check if there’s any errors starting:

journalctl --unit=cardano-node --follow

Warning - if upgrading from 8.9.4 or earlier, this requires a full replay, so make sure you have many hours free for your relays or BP to work through it.

Then a quick clean up:

cd $HOME/git/
rm -rf cardano-node-old
mv cardano-node cardano-node-old
mv cardano-node2 cardano-node

At the moment, gLiveView hasn’t been updated to work with 9.0.0, so if you want that to run that, there are a couple of work arounds. One is to use the env file from this branch, https://github.com/cardano-community/guild-operators/blob/mgu_v8.12.x/scripts/cnode-helper-scripts/env

Or, thanks to @ParadoxicalSphere, force the cardano-node to use a different config.json from gLiveView, as follows:

  1. Download https://book.play.dev.cardano.org/environments-pre/mainnet/config.json and then customize the file as may be needed for the Cardano Node 9.0.0 instance.

  2. Create a copy of the config.json created in step 1 in the same folder. Open the copy using a text editor, then add the following two lines, and then save and close the file:

“ConwayGenesisFile”: “conway-genesis.json”,

“ConwayGenesisHash”: “de609b281cb3d8ae91a9d63a00c87092975612d603aa54c0f1c6a781e33d6e1e”,

  1. Download https://book.play.dev.cardano.org/environments/mainnet/conway-genesis.json to the same folder as the config.json file and config.json copy that you created in steps 1 and 2

  2. Using the --config option in the cardano-node run command, set Cardano Node 9.0.0 to use the config.json file that you created in step 1

  3. In the env file that gLiveView uses, edit the CONFIG user variable to use the copy of config.json that you created in step 2

Now both CN 9.0.0 and gLiveView v1.29.1 should start. Make any edits to config.json to both files. When either gLiveView is updated or a conway-genesis.json file is released for CN 9.x, set the CONFIG user variable back so that gLiveView uses the same config.json file as CN again.

2 Likes

Thank you for this guide, it is very useful, especially the gliveview part :blush:

1 Like

Hello @jeremyisme thanks a lot for this guide!
Btw: seems like the link to the gliveview env file is broken…
I managed to get gliveview working with this env file
Just had to comment out the conway genesis file check by commenting out this line (add a leading “#” or completely remove the line):
#[[ ! -f "${CONWAY_GENESIS_JSON}" ]] && echo "Conway genesis file not found: ${CONWAY_GENESIS_JSON}" && return 1

1 Like

Hmm, you’re right. They have removed that branch, or renamed it. Thanks for the alternative workaround!

For others, obviously, workarounds are only for those who know what they’re doing. When gLiveView and other tools come out, you’ll need to undo all of the tweaks you did.

The upgrade to 9.0 finished successfully, however, I cannot get the node to start… here is the error when I attempt start it:

Jul 23 07:22:06 cnode[654]: Byron genesis file not found: /opt/cardano/cnode/files/null
Jul 23 07:22:06 cnode[654]: ERROR: Failed to load common env file
Jul 23 07:22:06 cnode[654]: Please verify set values in ‘User Variables’ section in env file or log an issue on GitHub

The Byron file is definitely present inside of /opt/cardano/cnode/files/ - any ideas where the ‘/null’ is coming from?

The error message is misleading. It is in fact the file conway_genesis.json. Looks like you use cntools. If that is the case you’ll have to comment out the lines with

${CONWAY_GENESIS_JSON}

in the env file. And, additionally edit the config.json file. Just delete the lines with the path to the conway_genesis.json file and the line with ConwayGenesisHash.

After that your node should start as usual.

2 Likes

Oh jeez… Would have never figured that one out! I had already removed the mentions of it from config.json but definitely didn’t know about the env versions. That worked great, so thank you!

@jf3110 - Perhaps you can help me with one more thing… I am attempting to upgrade another node and it keeps failing with the following error:

Error: cabal: Could not resolve dependencies:
[__0] trying: cardano-node-9.0.0 (user goal)
[__1] next goal: text (dependency of cardano-node)
[__1] rejecting: text-1.2.4.1/installed-1.2.4.1 (conflict: cardano-node =>
text>=2.0)
[__1] trying: text-2.1.1
[__2] trying: base-4.14.3.0/installed-4.14.3.0 (dependency of cardano-node)
[__3] trying: cardano-tracer-0.2.3 (user goal)
[__4] next goal: libsystemd-journal (dependency of cardano-tracer)
[__4] rejecting: libsystemd-journal-1.4.5.1 (conflict:
base==4.14.3.0/installed-4.14.3.0, libsystemd-journal => base^>=4.16 ||
^>=4.17 || ^>=4.18 || ^>=4.19)
[__4] rejecting: libsystemd-journal-1.4.5.0.0.0.0.1 (conflict: text==2.1.1,
libsystemd-journal => text>=0.1 && <2.1)
[__4] skipping: libsystemd-journal-1.4.5, libsystemd-journal-1.4.4,
libsystemd-journal-1.4.3, libsystemd-journal-1.4.2, libsystemd-journal-1.4.1,
libsystemd-journal-1.4.0, libsystemd-journal-1.3.4, libsystemd-journal-1.3.3,
libsystemd-journal-1.3.1, libsystemd-journal-1.3.0, libsystemd-journal-1.2.0,
libsystemd-journal-1.1.0, libsystemd-journal-1.0.0 (has the same
characteristics that caused the previous version to fail: excludes 'text'
version 2.1.1)
[__4] fail (backjumping, conflict set: base, cardano-tracer,
libsystemd-journal, text)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cardano-node, text, base,
libsystemd-journal, hw-aeson, cardano-tracer
Try running with --minimize-conflict-set to improve the error message.

Deleting build config artifact to remove cached version, this prevents invalid Git Rev
Running cabal update to ensure you're on latest dependencies..
Downloading the latest package lists from:
- hackage.haskell.org
- cardano-haskell-packages
Package list of cardano-haskell-packages is up to date.
The index-state is set to 2024-07-24T14:16:32Z.
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-07-24T19:33:37Z.
Building..
Resolving dependencies...
Up to date

I’ve confirmed both ghc and cabal versions are correct and I’ve also installed blst, libsodium, and secp256k1.

Any ideas?

What version ubuntu are you building on?

Ubuntu 20.04.6

And you did a cabal update command before your build?

What type of update? I ensured that I am on 3.8.1.0 before starting the build

Follow through these commands. This cabal update command makes sure it has all the dependencies it needs.

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

Thanks for the direction - Unfortunately I received the same result after following your instructions.

Sometimes I’ve just messed up the build folder after trying so many things. Maybe clear out your git/cardano-node2 folder and start again.

I also assume you’re not adding the constraints line into your cabal.project.local file, as that is only needed for 22.04

Thanks… I tried that and still received the same result. After some further investigating it looks like maybe there is an issue with my cabal install. I tried to manually install the package that Cardano Node appears to fail on by running: cabal install libsystemd-journal-1.4.5.1 And received the error below:

Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] next goal: libsystemd-journal (user goal)
[__0] rejecting: libsystemd-journal-1.4.5.1 (conflict: requires GHC2021 which
is not supported)
[__0] rejecting: libsystemd-journal-1.4.5, libsystemd-journal-1.4.4,
libsystemd-journal-1.4.3, libsystemd-journal-1.4.2, libsystemd-journal-1.4.1,
libsystemd-journal-1.4.0, libsystemd-journal-1.3.4, libsystemd-journal-1.3.3,
libsystemd-journal-1.3.1, libsystemd-journal-1.3.0, libsystemd-journal-1.2.0,
libsystemd-journal-1.1.0, libsystemd-journal-1.0.0 (constraint from user
target requires ==1.4.5.1)
[__0] fail (backjumping, conflict set: libsystemd-journal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: libsystemd-journal

I then went ahead and forced a re-install of cabal 3.8.1.0 but it still results in the same outcome. Is there a way to remove cabal and do a clean install?

EDIT: I dont know… Now I am very confused. I tried checking the libsystemd-journal install on a working 9.0 node using ** cabal info libsystemd-journal** and it’s coming back as not installed… So why is the upgrade even trying?

It might not help, but there is now a 9.1.0 available, so you could try build that instead of 9.0.0. There might be some magic in it!