cd ~/.local/bin/
# let's create a folder with the version number
mkdir -p $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')
# copying files to the created folder
cp cardano-node $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')/
cp cardano-cli $(cardano-node version | grep -oP '(?<=cardano-node )[0-9\.]+')/
2. Upgrading and updating the system packages
# let's update the system first
sudo bash -c 'sudo apt-get update -y; sudo apt-get upgrade -y'
3. Updating the Cardano node requirements
ghcup install ghc 8.10.7
ghcup install cabal 3.6.2.0
ghcup set ghc 8.10.7
ghcup set cabal 3.6.2.0
sudo apt install -y libsodium-dev libtool autoconf make
mkdir -p ~/git && cd ~/git
rm -rf secp256k1
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
sudo make install
Update/ install new libsodium version
mkdir -p ~/git && cd ~/git
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout dbb48cc
./autogen.sh
./configure
make
sudo make install
4. Downloading configuration files (leaving old topology file in place):
# let's check if we have successfully installed the latst cardano-node and cardano-cli versions.
which cardano-node && which cardano-cli
cardano-node --version
cardano-cli --version
you should now have similar output:
a
5. Updating the systemd service file
we need to add the Environment variable LD_LIBRARY_PATH for the node to work correctly.
As an optional step you can download the full blockchain to boot faster, as this update resyncs the blockchain.
You can download the full db from: https://csnapshots.io/mainnet
and check the log files if everything is starting up as planned:
journalctl -u cardano-node.service -f -o cat
that's it - you have upgraded your node to the latest cardano-node version, now do the same update on all of your other production servers (or copy generated cardano-cli / cardano-node bin files).