As a long time Debian user, I love the way the apt package management tool takes care of installing and upgrading software. Everything is installed in accordance with the Filesystem Hierarchy Standard and everything is removed when packages are purged.
Consequently, I have produced some deb packages for cardano-node which I have put up on Github: under account ‘TerminadaPool’.
For those that want to compile their own deb package:
I have created the following repositories:
There is a README.md file for each repository explaining how to build each deb package yourself. In order to build the latest cardano-node (1.35.3) you will need to build and install libsecp256k1-iog deb first.
For those that just want to install a pre-built deb package:
I have also provided a debian repository containing debs that I have built for both arm64 and amd64 architectures at:
I have put instructions for how to use the repository in the index.html file at that address. These instructions are as follows:
- To add the repository to your apt sources
wget -O- https://TerminadaPool.github.io/deb/KEY.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/terminada.io.gpg > /dev/null echo "deb [signed-by=/usr/share/keyrings/terminada.io.gpg] https://TerminadaPool.github.io/deb ./" | sudo tee /etc/apt/sources.list.d/terminada.io.list sudo apt update
- Then, to install cardano-node:
sudo apt install cardano-node
Note that these deb packages will install to the following locations:
- binaries to: /usr/bin (cardano-node, cardano-cli, bech32)
- cardano-node socket to: /run/cardano/mainnet-node.socket
- configuration files to: /etc/cardano/
- systemd service file to: /lib/systemd/system/cardano-node.service
- some utility scripts to: /usr/bin (cn-monitor-block-delay, cn-update-topology)
- blockchain data to: /var/lib/cardano/
The cardano-node deb will also create a new ‘cardano’ user with a disabled password. cardano-node will be run by systemd as this cardano user and the blochain data will be owned by this user at /var/lib/cardano/
To start cardano-node after you have installed the deb:
systemctl enable cardano-node systemctl start cardano-node
Make sure you have 80G hard disk space available at /var/lib/cardano/
To monitor the sync process you can then do:
CARDANO_NODE_SOCKET_PATH='/run/cardano/mainnet-node.socket' cardano-cli query tip --mainnet
Note the setting of the CARDANO_NODE_SOCKET_PATH variable. Installing the deb does not modify your .bashrc file to configure this variable. If you do want that done then you will need to do it yourself for user ‘cardano’ and run cardano-cli commands as this user. I just always prepend CARDANO_NODE_SOCKET_PATH=‘/run/cardano/mainnet-node.socket’ before any cardano-cli command.
If you already have a synced cardano-node and you wish to use these debs for ease of future maintenance then simply move your existing blockchain data to /var/lib/cardano/ and chown them to user ‘cardano’:
mkdir -pm0700 /var/lib/cardano mv /opt/cardano/db/* /var/lib/cardano chown -R cardano.cardano /var/lib/cardano
Obviously change /opt/cardano/db/ to the directory holding your current blockchain database files. Then just start the node with 'systemctl enable cardano-node followed by ‘systemctl start cardano-node’.
If you run a stakepool and wish to ping your block delay info to pooltool.io you can do this by running the following command as root:
This command will continuously follow your journal for cardano-node logs about new blocks and send the time delay data to pooltool. You need to configure your pooltool account details in /etc/cardano/my-cardano-node.json first. If you just want to see the block delay data on your terminal screen then simply run this command without the ‘-s’ switch.
When a new version of cardano-node comes out you can simply upgrade the normal Debian way:
apt update apt dist-upgrade
If you were running cardano-node then the package management system will take care of installing the new binaries and restarting the service.
If you compiled your own deb then you simply copy that deb to the machine you need it on and:
dpkg -i cardano-node_1.35.3-1_amd64.deb
Hopefully these debs are of use and make life easier for some.