Skip to content

Instantly share code, notes, and snippets.

@QCPOLstakepool
Last active April 7, 2021 22:17
Show Gist options
  • Save QCPOLstakepool/f2895d5116f8317e2b76dfbdec65d1c0 to your computer and use it in GitHub Desktop.
Save QCPOLstakepool/f2895d5116f8317e2b76dfbdec65d1c0 to your computer and use it in GitHub Desktop.

Cardano Stake Pool Migration 1.25.1 -> 1.26.1

THIS GUIDE IS FOR EDUCATIONAL PURPOSE ONLY. IT COMES WITH NO WARRANTY AND SHOULD BE USED AT YOUR OWN RISKS. MAKE THE APPROPRIATE BACKUPS!!! THIS GUIDE ASSUME YOU FOLLOWED https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node

Written by QCPOL (https://qcpol.stakepool.quebec)

Update server

sudo apt update
sudo apt upgrade
sudo apt autoremove

Building 1.26.1

cd ~
git clone https://github.com/input-output-hk/cardano-node.git cardano-node-1.26.1
cd cardano-node-1.26.1
git fetch --all --recurse-submodules --tags
git checkout tags/1.26.1
cabal update
cabal configure -O0 -w ghc-8.10.2
echo -e "package cardano-crypto-praos\n flags: -external-libsodium-vrf" > cabal.project.local
rm -rf $HOME/cardano-node-1.26.1/dist-newstyle/build/x86_64-linux/ghc-8.10.2
cabal build cardano-cli cardano-node

Stop service

sudo systemctl stop cardano-node

Backup files

cd ~
mkdir backup-1.25.1
sudo cp /usr/local/bin/cardano-node backup-1.25.1/cardano-node
sudo cp /usr/local/bin/cardano-cli backup-1.25.1/cardano-cli
cp cardano-my-node/mainnet-byron-genesis.json backup-1.25.1/mainnet-byron-genesis.json
cp cardano-my-node/mainnet-config.json backup-1.25.1/mainnet-config.json
cp cardano-my-node/mainnet-shelley-genesis.json backup-1.25.1/mainnet-shelley-genesis.json
cp cardano-my-node/topologyUpdater.sh backup-1.25.1/topologyUpdater.sh
cp $HOME/.bashrc backup-1.25.1/.bashrc

Installing 1.26.1

cd ~
sed -i .bashrc -e "s/export NODE_BUILD_NUM=.*/export NODE_BUILD_NUM=5821110/"
source .bashrc
cd $NODE_HOME
wget -N https://hydra.iohk.io/build/${NODE_BUILD_NUM}/download/1/${NODE_CONFIG}-byron-genesis.json
wget -N https://hydra.iohk.io/build/${NODE_BUILD_NUM}/download/1/${NODE_CONFIG}-shelley-genesis.json
wget -N https://hydra.iohk.io/build/${NODE_BUILD_NUM}/download/1/${NODE_CONFIG}-config.json
sed -i ${NODE_CONFIG}-config.json -e "s/127.0.0.1/0.0.0.0/g"
sed -i ${NODE_CONFIG}-config.json -e "s/TraceBlockFetchDecisions\": false/TraceBlockFetchDecisions\": true/g"
sudo cp $(find $HOME/cardano-node-1.26.1/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
sudo cp $(find $HOME/cardano-node-1.26.1/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node

Update topologyUpdater.sh (relays only)

cd $NODE_HOME
sed -i topologyUpdater.sh -e "s|jq -r .blockNo|jq -r .block|g"

Update qcpolsendmytip.sh (core only, if used)

cd $NODE_HOME
sed -i qcpolsendmytip.sh -e "s|jq -r '.slotNo, .headerHash, .blockNo'|jq -r '.slot, .hash, .block'|g"
sudo systemctl restart qcpolsendmytip

Start service

sudo systemctl start cardano-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment