The Cardano Shelley testnet on Raspberry PI

Stake Nuts
3 min readAug 28, 2019

This short article documents how to setup and run your Cardano Shelley testnet on a Raspberry PI 3 using NixOS.

Please note this is not officially support nor endorsed by IOHK, this documentation is just a community effort and given how quickly the development is progressing, it might be outdated pretty soon. It applies for the Jormungandr release 0.3.

Follow me for more such articles in the future.

Jormungandr service running on NixOS aarch64.

It is also worth noting, that this is very probably not going a production solution to run a real staking pool, but it’s nevertheless a fun way to learn more about the project.

NixOS Installation

  1. Fetch the unstable aarch64 installation image of latest NixOS.
  2. Copy the image onto your SD card. Be careful to not overwrite anything else, make you sure your device replaced by /dev/sdX is really your card.
dd if=sd-image-armv7l-linux.img of=/dev/sdX bs=1024

3. Boot up your Raspberry PI using the freshly created SD card.

4. Use the following configuration file, which includes the service setup for jormungandr, the blockchain service. Read the configuration file and feel free to modify it as you need.

/etc/nixos/configuration.nix

5. Rebuild and activate the NixOS configuration.

# nixos-rebuild switch --upgrade

6. The starting of the service will fail given we don’t yet have the genesis block of the blockchain and we need to generate it, which is going to happen in the next section.

Setting up the Genesis Praos consensus blockchain

In this section, we are going to setup the Genesis Praos consensus blockchain node. Check out this short overview of the Ouroboros Protocols by Peter Gaži.

  1. We are going to bootstrap our configuration using jormungandr-bootstrap command as following:
jormungandr-bootstrap -g -p 8607

This is going to create our genesis block as well as our secret configuration file, which we need to copy to locations we have specified in the configuration.nix above. If you did not change these, just run the following:

mkdir -p /etc/secrets
mv pool-secret1.yaml /etc/secrets/jormungandr.yaml
mv block-0.bin /var/lib/jormungandr/

2. Now that we have the files in place, we need to restart the service, it should now start successfully.

systemctl restart jormungandr

3. Now that your blochchain node is up, you can start using it. You might have noticed the bootstrap also created a handful of scripts to play around with your blochain node. We can run them to verify everything is working correctly.

# ./create-account-and-delegate.sh
## Create new Account Address
## Send 1000 Lovelaces from the Faucet Address to the newly created Account Address
## Sending 1000 to ca1shqhexk7peafxw394txk4xsemm05z03dq7v5tf0lu363nxkfx6wjjnsch7d
discrimination: testing
account: ed25519_pk1c97f4hsw02fn5fd2e44f5xw7maqnutg8n9z6tllyw5ve4jfkn55sluyw0f
77a4ac7ceac62472ecdcae51995e6f03c4467703d4b87077a493337ba0a3d06a
## Waiting for new block to be created (timeout = 30 blocks = 30s)
New block was created - 90113696b1bf506f2d7610e9f040587b7a75979c1bae3bbcf2ff7e52d298b6fa
(...)

4. Please play around with the node as much as possible. Jormungandr has a neat documentation which gives you a better overview of the tooling and its possibilities.

If this article was helpful to you and you would like to see more content like this, please support us by staking your Cardano with us at stakenuts.com.

--

--