I struggled so much while upgrading to the latest version since the information were scatted, so I am going to share the steps that I did and make your life easier:
Note: You do all of the below on both of your BP and relays
- Do the routine updates:
sudo apt-get update -y
sudo apt-get upgrade -y
- Update gLiveView automatically:
cd $NODE_HOME
./gLiveView.sh
# Click yes if it asked you to update
- Make sure that you have ghc 8.10.7 and cabal 3.6.2.0 (Skip if you already have them):
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
- Stop cardano node service:
sudo systemctl stop cardano-node.service
- Install Libsodium (Skip if you already have it):
mkdir $HOME/git
cd $HOME/git
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout 66f017f1
./autogen.sh
./configure
make
sudo make install
- Install libsecp256k1 (Skip if you already have it):
cd $HOME/git
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
make check
sudo make install
sudo ldconfig
- Backup your configuration files:
cd $NODE_HOME
mv mainnet-config.json mainnet-config.bak
mv mainnet-byron-genesis.json mainnet-byron-genesis.bak
mv mainnet-shelley-genesis.json mainnet-shelley-genesis.bak
mv mainnet-alonzo-genesis.json mainnet-alonzo-genesis.bak
- Download the new mainnet configuration files:
wget https://book.world.dev.cardano.org/environments/mainnet/config.json
wget https://book.world.dev.cardano.org/environments/mainnet/byron-genesis.json
wget https://book.world.dev.cardano.org/environments/mainnet/shelley-genesis.json
wget https://book.world.dev.cardano.org/environments/mainnet/alonzo-genesis.json
- Rename the files to include mainnet prefix:
mv config.json mainnet-config.json
mv byron-genesis.json mainnet-byron-genesis.json
mv shelley-genesis.json mainnet-shelley-genesis.json
mv alonzo-genesis.json mainnet-alonzo-genesis.json
- Edit mainnet-config.json and add the mainnet prefix to become:
"AlonzoGenesisFile": "mainnet-alonzo-genesis.json",
"ByronGenesisFile": "mainnet-byron-genesis.json",
"ShelleyGenesisFile": "mainnet-shelley-genesis.json",
- Cloning and building the new cardano node:
cd $HOME/git
git clone https://github.com/input-output-hk/cardano-node.git ./cardano-node-new
cd cardano-node-new
cabal update
git fetch --all --recurse-submodules --tags
git checkout $(curl -s https://api.github.com/repos/input-output-hk/cardano-node/releases/latest | jq -r .tag_name)
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
- Verify the versions:
$(find $HOME/git/cardano-node-new/dist-newstyle/build -type f -name "cardano-node") version
$(find $HOME/git/cardano-node-new/dist-newstyle/build -type f -name "cardano-cli") version
- Replace the existing cardano-node and cardano-cli binaries:
sudo cp $(find $HOME/git/cardano-node-new/dist-newstyle/build -type f -name "cardano-node") /usr/local/bin/cardano-node
sudo cp $(find $HOME/git/cardano-node-new/dist-newstyle/build -type f -name "cardano-cli") /usr/local/bin/cardano-cli
- To verify that you installed the new cardano node binaries successfully, type:
cardano-node version
cardano-cli version
- Start yorur cardano node
sudo systemctl start cardano-node.service
- Check the status of your node to make sure there are no errors:
journalctl -e -f -u cardano-node
NOTES:
a) Upgrading to Cardano Node 1.35.x may require Issuing a New Operational Certificate for your stake pool.
b) Copy the new cardano-cli to your air-gapped offline machine.