Update 1.24.2 to 1.25.1 for nodes configured with CoinCashew guide

Hi everyone!

I updated my node and relays the latest 1.25.1 version.

I prepared lines you can just copy-paste in your terminal that will update your node/relays to the latest 1.25.1 version from 1.24.2.

!!! IMPORTANT. This update code is for the nodes/relays that were setup following CoinCashew guide.

!!! IMPORTANT. If you just want to copy and paste the code below, then first run in your terminal, so you will not be asked to enter a password again:

sudo echo READY

Otherwise, copy-paste-run will fail at the entering password step. You can also run those commands step by step making sure that each step is ok.

#
# BACKUP PREVIOUS SOURCES AND DOWNLOAD 1.25.1
#
cd $HOME/git
mv cardano-node cardano-node-1.24.2
git clone https://github.com/input-output-hk/cardano-node.git
cd cardano-node
git fetch --all --recurse-submodules --tags
git checkout tags/1.25.1

#
# CONFIGURE BUILD OPTIONS
#
cabal configure -O0 -w ghc-8.10.2
rm -rf $HOME/git/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.2
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local

#
# BUILD
#
cabal build cardano-cli cardano-node

#
# STOP THE NODE TO BE ABLE TO REPLACE BINARIES
#
sudo systemctl stop cardano-node

#
# COPY NEW BINARIES
#
sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node

#
# CHECK NEW INSTALLED VERSIONS
#
cardano-node version
cardano-cli version

# UPDATE VALUE OF NODE_BUILD_NUM
export NODE_BUILD_NUM=$(curl https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest-finished/download/1/index.html | grep -e "build" | sed 's/.*build\/\([0-9]*\)\/download.*/\1/g')
sed -i $HOME/.bashrc \
    -e "s/export NODE_BUILD_NUM=[0-9]\+/export NODE_BUILD_NUM=${NODE_BUILD_NUM}/g"
source $HOME/.bashrc

#
# UPDATE mainnet-config.json TO THE LATEST VERSION AND START THE NODE
#
cd $NODE_HOME
wget -N https://hydra.iohk.io/build/${NODE_BUILD_NUM}/download/1/${NODE_CONFIG}-config.json
sed -i ${NODE_CONFIG}-config.json \
    -e "s/TraceBlockFetchDecisions\": false/TraceBlockFetchDecisions\": true/g"
sudo systemctl start cardano-node

#
# UPDATE gLiveView.sh
#
cd $NODE_HOME
sudo apt install bc tcptraceroute -y
curl -s -o gLiveView.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/gLiveView.sh
curl -s -o env https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/env
chmod 755 gLiveView.sh
sed -i env \
    -e "s/\#CONFIG=\"\${CNODE_HOME}\/files\/config.json\"/CONFIG=\"\${NODE_HOME}\/mainnet-config.json\"/g" \
    -e "s/\#SOCKET=\"\${CNODE_HOME}\/sockets\/node0.socket\"/SOCKET=\"\${NODE_HOME}\/db\/socket\"/g"
13 Likes

worked like a charm. thanks.

MA

Sweet! Worked with some custom tweaks!

Relay nodes were the test nodes and the block producer was the last test! All sync’d up!

Thank you and have a great weekend!

I upgraded following your instructions and it´s working again !!! only needed to change some custom folders.
Thanks for this help !!

Thanks @Viggy for putting this up. It was very helpful!

Thank you for sharing this!
I’ve hit this snag, not sure what is the problem, any ideas?

Warning: Requested index-state2021-01-10T00:00:00Z is newer than
hackage.haskell.org’! Falling back to older state (2021-01-09T22:55:53Z).
Resolving dependencies…

Just had to wait, my bad :smiley:
Thank you again, perfect!

Excellent guide – thank you!

Nice one. Really helpful!! Thanks :clap:

Thank you! I am SO glad I stumbled upon this!

@Viggy you are a hero. This resolves a hand full of issues that have been causing me much pain the past few weeks. Thank you immensely for your contributions.

1 Like

Thank you! So helpful! Just wondering if you guys can help a newbie out, where do I find the version I need to be running? Is there a webpage somewhere that shows what version is running on mainnet and testnet?

I was banging my head against the wall trying to figure out why my node would not connect and the error output isn’t very helpful…

Thanks again!

Here you can always see the current status of the network:

The first “Version” info block chows that at the moment 97% of all pools are running on v1.25.1. Pools below that version are still there but their owners probably forgot they have a pool.

This was very helpful! Can we have another guide for from 1.25.1 to 1.26.1 please? :slight_smile:

For the offline node, do you have to complete all of the steps again as per the BP and relay, or just pull new binaries and compile them?

having difficulty with the version changing from 1.25.1 to 1.26.1 built from scratch twice and still shows 1.25.1

This script seems to work for an upgrade from 1.25.1 to 1.26.1. I just copy the script into notepad and replace 25-> 26 then 24-> 25 and ran everything verbatim after that. Everything seems ok except socket_path changed in startup scripts. I rebuilt those scripts using the coincashew scripts https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#7-create-startup-scripts.

Everything working on 1.26.1 now. Thanks.

Edit, topology wasn’t updating. Had to change this line blockNo=(/usr/local/bin/cardano-cli query tip {NETWORK_IDENTIFIER} | jq -r .block )
the block on the end used to be blockNo.

I used this to go from 1.25.1 to 1.26.1 as well and it seemed to work just fine. I am still on cabal 3.2.0.0 and ghc 8.10.2 though. Didn’t realize there was new versions out. Is that a problem? Should I update them now that I’m already on 1.26.1?

Thanks!

1 Like

I updated all my relays and a node from 1.25.1 to 1.26.1 with the following commands. I recommend you running those step by step. Do not just copy the whole text and paste it. It may ask for a password at sudo commands again after a long build process.

#
# UPDATE YOUR SERVER FIRST
#
sudo apt-get update -y
sudo apt-get upgrade -y


cd $HOME

#
# MAKE SURE YOU HAVE CABAL REQUIREMENTS INSTALLED FOT THE NEXT STEP
# (libncurses5 was missing for me)
#
sudo apt-get install build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 -y

# In the following step during installation press:
# Enter, Enter
# NO - to Do you want to install haskell-language-server (HLS) now?
# YES - to If you want ghcup to automatically add the required PATH variable to "/home/cardano/.bashrc"...
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

#
# MAKE ghcup COMMAND AVAILABLE
#
source $HOME/.bashrc

#
# JUST TO MAKE SURE EVERYTHING IS UPGRADED AND SET
#
ghcup upgrade
ghcup install cabal 3.4.0.0
ghcup set cabal 3.4.0.0
ghcup install ghc 8.10.4
ghcup set ghc 8.10.4
cabal update
cabal --version
ghc --version


#
# BACKUP PREVIOUS NODE SOURCES AND DOWNLOAD 1.26.1
#
cd $HOME/git
mv cardano-node cardano-node-1.25.1
git clone https://github.com/input-output-hk/cardano-node.git
cd cardano-node
git fetch --all --recurse-submodules --tags
git checkout tags/1.26.1

#
# CONFIGURE BUILD OPTIONS
#
cabal configure -O0 -w ghc-8.10.4
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local
sed -i $HOME/.cabal/config -e "s/overwrite-policy:/overwrite-policy: always/g"
rm -rf $HOME/git/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.4


#
# BUILD (THIS PROCESS WILL TAKE TIME)
#
cabal build cardano-cli cardano-node


#
# STOP THE NODE TO BE ABLE TO REPLACE BINARIES
#
sudo systemctl stop cardano-node

#
# COPY NEW BINARIES
#
sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
sudo cp $(find $HOME/git/cardano-node/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node

#
# CHECK NEW INSTALLED VERSIONS
#
cardano-node version
cardano-cli version


#
# UPDATE VALUE OF NODE_BUILD_NUM AND UPATE mainnet-config.json
#
cd $NODE_HOME
export NODE_BUILD_NUM=$(curl https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest-finished/download/1/index.html | grep -e "build" | sed 's/.*build\/\([0-9]*\)\/download.*/\1/g')
sed -i $HOME/.bashrc \
    -e "s/export NODE_BUILD_NUM=[0-9]\+/export NODE_BUILD_NUM=${NODE_BUILD_NUM}/g"
source $HOME/.bashrc

wget -N https://hydra.iohk.io/build/${NODE_BUILD_NUM}/download/1/${NODE_CONFIG}-config.json
sed -i ${NODE_CONFIG}-config.json \
    -e "s/TraceBlockFetchDecisions\": false/TraceBlockFetchDecisions\": true/g"
	
	
	
# START THE NODE
# !!! IMPORTANT, VERSION 1.26.1 REQUIRES DB MIGRATION
# IT MAY TAKE 30min OR MORE DEPENDING ON YOUR CPU
# MIGRATION PROCESS WILL START AUTOMATICALLY AFTER YOU START THE NODE
# YOU CAN CHECK MIGRATION STATUS BY RUNNING: journalctl -u cardano-node.service -f
# READ BELOW IF YOU ALREADY HAVE ONE NODE UPDATED AND MIGRATED

sudo systemctl start cardano-node

Once you have at least one node updated and migrated, you can save time with migration by copying migrated DB before running the last command (starting the node). To do that run:
rsync -arzv --delete --delete-during username@YourMigratedNodeIP:/home/cardano/cardano-my-node/db/* $NODE_HOME/db/
You need to run this command on a non-migrated node to copy files from external YourMigratedNodeIP, Make sure you change the username, IP and paths correctly.

1 Like

Hello Viggy,

For my situation, I was able to upgrade to 1.26.1 with cabal 3.2.0.0 and ghc 8.10.2.

Is that a problem?

I just upgraded to cabal 3.4.0.0 and ghc 8.10.4 after the fact. Do I have to reinstall 1.26.1 now or am I good?

Thank you!