Cardano stakepool

Home > Portfolio > vrijstaat.net stakepool

What is Cardano?

Cardano is a decentralized proof of stake (PoS) blockchain designed to be a more efficient alternative to proof of work (PoW) networks like Bitcoin. Cardano’s cryptocurrency is named Ada.

Cardano stakepools help to expand and secure the network while generating rewards/blocks. A pool consists of a nodes, which fulfill the roles of a block producer and relays. Every node must run on its own network at a different location.

Case profile
ClientMextro Media
ExpertisesInfrastructure sourcing, installation & maintenance
Disaster prevention & recovery planning
User training
ProblemsBad performance, no rewards
Neglected infrastructure incapable of running node software
Insecure management access
SolutionsUpgraded existing and deployed new infrastructure
Switched from Ubuntu Server to FreeBSD
Improved security with industry best practices
Results99.99% uptime
Actively generating rewards
Ransomware attack thwarted
A rasterized globe, showing Cardano network traffic.
The challenges at hand

Downtime means missed blocks and thus less rewards. Uptime and security are key, with high availability failover impossible. Reliability and recoverability are also important as certain aspects of a block producer are not reproducible data. Nodes that underperform do not amortize the investment, meaning optimization is also necessary.

Leveraging FreeBSD

Originally the pool ran on Ubuntu Server 18 and 20. Version 18 is at end of support, so I decided to tackle the servers running that first. Looking at the upgrade path, I realized there was a lot of work involved getting the things I like to see in these kinds of applications. I also took Cardano’s decentralization mission to heart and decided to practice operating system decentralization: roll out an alternative OS. If there’s an attack for Linux, it probably won’t work on FreeBSD, and the other way around. Since the absolute vast majority runs pools on Linux, this is an inherent advantage, as it will be more likely that hackers develop attacks for Linux run pools.

A UNIX terminal running htop.
Tried and true performance

BSD has been powering the world since the 1970’s, and FreeBSD since 1993. It has better network performance, rock solid reliability, less security issues and more security features in the base system. It’s also the first containerization platform. Finetuning the base system to suit your needs is also trivial.

Reduced deploy times and maintenance

Normally one has to compile the Cardano node software on every machine for every update, which takes many hours. This time required scales linearly with with every deployment. FreeBSD is the only OS with node software available natively, cutting maintenance hours by massive margins. It also runs it inside of a container by default, aiding security.

To help manage nodes I created the cnodectl tool, similar to apachectl. It was also contributed to the CardanoBSD project.

A man wrenching at a car.
An inside view of a hard disk.
More speed and reliability, less cost

Through the native ZFS filesystem, I was able to guarantee data integrity for the nodes while also improving performance.

Software ZFS RAID is industry standard because it allows for losing physical disks without losing data, while also checking for data integrity and making snapshots.

The node database (~152GB), through native Zstandard compression, fits in only 80GB (1.9x ratio). This means that we can use a smaller and cheaper disk for longer before it fills up. It also improves performance as less physical data has to be read from or written to the disks.