Upgrading cardano-node and cardano-cli
Introduction
Ensuring that the Cardano node remains up-to-date is a critical responsibility for all stake pool operators. To facilitate a smooth and secure updating process, it is advisable to compile the cardano-node
and cardano-cli
binaries on a separate machine before uploading them to the block-producing server. This approach minimizes the downtime of the actual stake pool server and reduces the risk of encountering build issues during the update.
In certain scenarios, updating the cardano-node
version may necessitate a chain replay. In such cases, it becomes essential to prepare not only the binaries but also a synchronized blockchain database on the separate machine. This pre-synced database can then be transferred to the block-producing server, enabling the node to resume operations without the need for a lengthy resynchronization from the genesis block.
1) Building and uploading the binaries
Start by building and uploading the new Cardano node and Cardano CLI binaries:
Download or build the new versions. Download the static binaries from https://github.com/input-output-hk/cardano-node/releases or clone the latest version of the Cardano node repository and compile the new versions of
cardano-node
andcardano-cli
.
2) Database operations
If a chain replay is required, follow these steps to sync the node and prepare the database:
Sync the new node. Start and fully sync the new node with the blockchain on a separate machine. Ensure a clean shutdown of the node to preserve the integrity of the database.
Compress blockchain data. Once the new node has fully synced, compress the blockchain data into a tarball:
Calculate SHA-256 hash. Generate the SHA-256 hash for the tarball:
Transfer the database. Transfer the compressed blockchain data tarball, and the hash file to the
~/src
directory on your block-producing server:On the block-producing server, verify the SHA-256 hash of the transferred tarball:
If the output says "cardano-db.tar.gz: OK", the file was transferred without corruption.
3) Upload binaries and database, and restart the node
Once the database and the new binaries are ready, you can replace the old ones and restart your node:
Shut down the node. Cleanly shut down your cardano-node service:
Back up the existing database:
Transfer the binaries: Transfer the new binaries to the block-producing server:
Back up the current binaries. Before replacing them, back up your current binaries:
Replace the binaries. Replace the current
cardano-node
andcardano-cli
binaries with the new ones:Extract the new database. Navigate to
~/src/
and extract the database:Restart the node. Finally, restart the cardano-node service:
Last updated