Upgrading to Cardano Node 1.30.1
Important | Cardano Node 1.30.1 and was released on September 28, 2021 and is no longer supported. |
🎉 Introduction
This latest update brought to you by the generous donations by BEBOP stake pool.
If you want to support this free educational Cardano content or found this helpful, visit cointr.ee to find our donation addresses. Much appreciated in advance. 🙏
As of Oct 1 2021, this guide is written for mainnet with release v1.30.1 😁
📡 How to Perform an Upgrade
From time to time, there will be new versions of cardano-node. Follow the Official Cardano-Node Github Repo by enabling notifications with the watch functionality.
Read the patch notes for any other special updates or dependencies that may be required for the latest release.
- v1.30.1 Notes
- v1.29.0 Notes
- v1.27.0 Notes
- v1.26.2 Notes
Full release notes: https://github.com/input-output-hk/cardano-node/releases/tag/1.30.1
Upgrading Release Dependencies
CNCLI
If you use CNCLI for leaderlogs and sendslots, then you must upgrade to cncli version 4.0.1
RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
echo "Installing release ${RELEASETAG}"
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/
To confirm that the new version of CNCLI is installed, type:
cncli -V
It should return the updated version number.
gLiveView
cd ${NODE_HOME}
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
# Update env file with the stake pools configuration.
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"
Full release notes: https://github.com/input-output-hk/cardano-node/releases/tag/1.29.0
This release is an important update to the node that provides the functionality that is needed following the Alonzo hard fork.
All users, including stake pool operators, must upgrade to this version (or a later version) of the node.
The release includes features that will enable the use of the node in the Alonzo era, allowing the on-chain execution of Plutus scripts,
including extended CLI commands to support the construction of transactions that include Plutus scripts, datums and redeemers.
It incorporates several improvements, including a new transaction build command that calculates transaction fees and Plutus script execution units, and a new version of the query tip command that provides additional information, including node synchronisation progress. The transaction build command requires a local instance of the node in order to check Plutus script validity and to provide information that is used by the fee calculation. The Shelley specification has also been updated with respect to rewards calculation.
Note that this release changes the log format of traces configured by TraceChainSyncHeaderServer and TraceChainSyncClient . See #2746 for more detail.
Release Dependencies
1. If using cncli for leaderlogs and sendslots, update to cncli version 3.15 is required.
RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
echo "Installing release ${RELEASETAG}"
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/
Checking that cncli is properly updated
cncli -V
It should return the updated version number.
2. Download mainnet-alonzo-genesis.json file
cd $NODE_HOME
wget -N https://hydra.iohk.io/build/7416228/download/1/mainnet-alonzo-genesis.json
3. Download newmainnet-config.json file to with alonzo configurations.
If you have any custom mainnet configurations, be sure to backup and re-apply your settings.
cd $NODE_HOME
wget -N https://hydra.iohk.io/build/7416228/download/1/mainnet-config.json
sed -i mainnet-config.json \
-e "s/TraceBlockFetchDecisions\": false/TraceBlockFetchDecisions\": true/g" \
-e "s/127.0.0.1/0.0.0.0/g"
Verify that your mainnet-config.json contains the following two new lines.
"AlonzoGenesisFile": "mainnet-alonzo-genesis.json",
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874",
View your mainnet-config.json
cat mainnet-config.json
Example of what it should look like with the two new lines.
{
"AlonzoGenesisFile": "mainnet-alonzo-genesis.json",
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874",
"ApplicationName": "cardano-sl",
"ApplicationVersion": 1,
"ByronGenesisFile": "byron-genesis.json",
"ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb",
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 0,
"MaxKnownMajorProtocolVersion": 2,
"Protocol": "Cardano",
"RequiresNetworkMagic": "RequiresNoMagic",
"ShelleyGenesisFile": "genesis.json",
"ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81",
- If case your node does not start up properly, refresh
mainnet-shelley-genesis.json
cd $NODE_HOME
wget -N https://hydra.iohk.io/build/7416228/download/1/mainnet-shelley-genesis.json
Full release notes: https://github.com/input-output-hk/cardano-node/releases/tag/1.27.0
Node version 1.27.0 provides important new functionality, including supporting new CLI commands that have been requested by stake pools, providing garbage collection metrics.
It includes the performance fixes for the epoch boundary calculation that were released in node version 1.26.2, plus a number of bug fixes and code improvements.
It also includes many fundamental changes that are needed to prepare for forthcoming feature releases (notably Plutus scripts in the Alonzo era).
Note that this release includes breaking changes to the API and CLI commands, and that compilation using GHC version 8.6.5 is no longer supported.
Release Dependencies
1. If using cncli for leaderlogs and sendslots, update to cncli version 2.10 is required.
RELEASETAG=$(curl -s https://api.github.com/repos/AndrewWestberg/cncli/releases/latest | jq -r .tag_name)
VERSION=$(echo ${RELEASETAG} | cut -c 2-)
echo "Installing release ${RELEASETAG}"
curl -sLJ https://github.com/AndrewWestberg/cncli/releases/download/${RELEASETAG}/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -o /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
sudo tar xzvf /tmp/cncli-${VERSION}-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin/
Checking that cncli is properly updated
cncli -V
It should return the updated version number.
Full release notes: https://github.com/input-output-hk/cardano-node/releases/tag/1.26.2
This point release is a recommended upgrade for all stake pool operators. It is not required for relays or other passive nodes. It ensures that block producing nodes do not unnecessarily re-evaluate the stake distribution at the epoch boundary.
It is possible to upgrade from v1.25.1 but for a smooth update, ensure you have completed the v1.26.1 release dependencies, notably the ghc and cabal updates. Also note the database migration can take up to 2 hours.
Compiling the New Binaries
To update with $HOME/git/cardano-node as the current binaries directory, clone a new git repo named cardano-node2 so that you have a backup in case of rollback. Remove the old binaries.
cd $HOME/git
rm -rf cardano-node-old/
git clone https://github.com/input-output-hk/cardano-node.git cardano-node2
cd cardano-node2/
Run the following command to pull and build the latest binaries. Change the checkout tag or branch as needed.
cd $HOME/git/cardano-node2
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.4
cabal build all
cabal build cardano-cli
Build process may take a few minutes up to a few hours depending on your computer's processing power.
Verify your cardano-cli and cardano-node were updated to the expected version.
$(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
Stop your node before updating the binaries.
- systemd
- cnode
- block producer node
- relaynode1
sudo systemctl stop cardano-node
sudo systemctl stop cnode
killall -s 2 cardano-node
killall -s 2 cardano-node
Copy cardano-cli and cardano-node files into bin directory.
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
Verify your cardano-cli and cardano-node were copied successfully and updated to the expected version.
cardano-node version
cardano-cli version
Optional Best Practice: Now is an opportune time to update/upgrade and reboot your Ubuntu operating system.
sudo apt-get update && sudo apt-get upgrade -y && sudo reboot
Now restart your node to use the updated binaries. If you used the previously mentioned optional best practice, your binaries should've already auto-started.
- systemd
- cnode
- block producer node
- relaynode1
sudo systemctl start cardano-node
sudo systemctl start cnode
cd $NODE_HOME
./startCardanoNode.sh
cd $NODE_HOME
./startCardanoNode.sh
Finally, the following sequence will switch-over to your newly built cardano-node folder while keeping the old directory for backup.
cd $HOME/git
mv cardano-node/ cardano-node-old/
mv cardano-node2/ cardano-node/
Verify that your node is working successfully by either checking gLiveView, your other journalctl logs, or grafana dashboard.
- gLiveView
- journalctl
cd ${NODE_HOME}
./gLiveView.sh
journalctl -fu cardano-node
It may take some time to start a node, sometimes up to 30 minutes. gLiveView may appear stuck on "Starting..." but this is normal behavior and simply requires time.
🤖 Important Reminder: Don't forget to update your air-gapped offline machine (cold environment) with the new Cardano CLI binaries.
Congrats on completing the update. ✨
Did you find our guide useful? Send us a signal with a tip and we'll keep updating it.
It really energizes us to keep creating the best crypto guides.
Use cointr.ee to find our donation addresses. 🙏
Any feedback and all pull requests much appreciated.
Hang out and chat with our stake pool community on Telegram @ https://t.me/coincashew
Troubleshooting
🛣 Forked off
Forget to update your node and now your node is stuck on an old chain?
Reset your database files and be sure to grab the latest genesis, config, topology json files.
cd $NODE_HOME
rm -rf db
Reverting to a Previous Version Using a Backup
Stop your node before updating the binaries.
- systemd
- cnode
- block producer node
- relaynode1
sudo systemctl stop cardano-node
sudo systemctl stop cnode
killall -s 2 cardano-node
killall -s 2 cardano-node
Restore the old repository.
cd $HOME/git
mv cardano-node/ cardano-node-rolled-back/
mv cardano-node-old/ cardano-node/
Copy the binaries to /usr/local/bin
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
Verify the binaries are the correct version.
/usr/local/bin/cardano-cli version
/usr/local/bin/cardano-node version
Now restart your node to use the updated binaries.
- systemd
- cnode
- block producer node
- relaynode1
sudo systemctl start cardano-node
sudo systemctl start cnode
cd $NODE_HOME
./startCardanoNode.sh
cd $NODE_HOME
./startCardanoNode.sh
🤖 Last Resort: Rebuild the Stake Pool
Repeat the steps to set up your stake pool.
