In the first article of this series, we introduced Ouroboros, Cardano’s consensus algorithm, and outlined the benefits of running stake pools. In this post, we will focus on the requirements for running stake pools and the technical process of setting up a stake pool on Cardano. By the end, it should be a question of how one can best run a stake pool rather than how pools work, and getting yours onto Cardano’s mainnet.
Prerequisites for Running a Cardano Stake Pool
There are several requirements that you need to fulfil to run a Cardano node (stake pool). We’ll group them into three: technical requirements, software needs, and financial considerations.
First, the technical specifications branch into two: those required to run a pool on the mainnet and that of testnet. If you’re on the mainnet, you must meet the following:
- Servers: 1 block producer node and at least two relay nodes. Cardano docs provide a detailed explanation of stake pool networking
- CPU — An Intel or AMD x86 processor with two or more cores at 2GHz or faster
- Memory — 24GB of RAM
- Storage — 150GB of free storage (250GB recommended for future growth)
- Operating system — 64-bit Linux (Ubuntu 18.04+, Mint 19.3+, Debian 10.3+)
- Broadband — a good network connection with about 1 GB of bandwidth per hour on a public IP4 address
- Air-gapped environment — Offline, secure environment for keys
If you’re on testnet, some requirements may be smaller, like memory — at least 4GB of RAM, storage — cap at 20GB of free storage, and there’s no need for an air-gapped environment. It also goes without saying that internet connectivity and uptime are compulsory. Ongoing updates on the latest technical specifications and supported platforms are on the Cardano Node release page.
Second, the software requirements are a Linux operating system, essential tools like the Cardano Node, and a command-line interface (CLI). These, as the core tools needed, only work in tandem with knowledge of how to run a server, a thorough understanding of how networks work (how to back up and restore data), experience in reading and interpreting documentation and implementing the best practices from it, and familiarity with Cardano, blockchain wallets, and key pairs fundamentally. You need a strong desire to learn if you do not meet the above requirements. But check out some resources to kick off, including the Linux command line for beginners, nix and NixOS, and this stake pool operator forum.
Third, financial considerations dictate that you’re conscious of ADA pledge requirements and are able to cater to the initial and ongoing operational costs. In other words, the pledge amount takes the place of a self-bound asset, always on stake for as long as the pool runs — To mint a block every epoch, a good stake amount is around 1.25 M ADA, amount below 100K ADA are relatively low, but well managed, they run successful stake pools. There’s an additional 2 ADA delegation fee charged when setting up the pool, refundable on retiring it too and hardware or cloud costs inclusion of regular updates, maintenance, electricity, domains and websites. What exactly are these costs pointing out?
By the numbers, this thread on the Cardano forum discusses the initial and operational costs as around $380 per month, provided you already have the specified setup — a rough estimation of the cost of computers and network equipment being $5k. In a Reddit chat on the profitability of a stake pool, we gather that you can run a node on the cloud, charging around $50 to $100 on a monthly basis. Moreover, the core idea is to get a yield of at least 5% (or more than that, not to lose money). Otherwise, you’d be better off delegating. There’s also a 500 ADA pool registration fee and other costs on meaningful products like security, firewalls, for example. A question comes up at this point: how about the profits? We’ll give tips on how to be a successful operator.
Step-by-Step Guide to Setting Up a Stake Pool
When we began, we took a theoretical standpoint to build the base for our discussion, and we’ll, therefore, turn practical in this section. To stick to the discussion, it is also good to point out that we occasionally link to some external resources — check them out if you’re unfamiliar with the current step. Enter the step-by-step process:
1. Setting Up the Environment
The start of installing Linux and configuring the server is, in fact, an example of the reasoning behind redirecting to external (and correct) resources, for there are many Linux versions, and you’re free to pick any. Still, we’ll always encourage you to choose the latest. This listicle by Digital Ocean rounds up guides on creating and configuring a new server. To do so, you’ll need to have installed a version of Linux.
You also need to update and secure your environment by following some best practices for Linux Kernel Updates. There are many, but some of the common ones are choosing the right method, updating from secure sources, automating the updates, and special considerations if you are using custom kernels, modules, virtual machines, real-time, and embedded system Linux versions. Once done, proceed to the Cardano Node.
2. Installing and Configuring Cardano Node
The Cardano node runs in your Linux-based operating system and is the fundamental component that holds up the Cardano network. By means of consensus, a blockchain network comprises many interconnected nodes that validate transactions. At this point, you need to download, compile, and install cardano-node and cardano-cli, for these, as it happens, the recent edition of the environment setup has what we need. In this step, as outlined by the setup guide, we install operating system dependencies (like version control — git, the right compiler, support for C++, developer libraries, and other Haskel compiler and build tools), download and configure build options. Only once done with the preceding steps should you end with building and installing the node. The installation resource ends with CLI commands to check the installed version.
Let’s return to the prerequisites for running a stake pool. The first on the list is at least two relay nodes and a block producer node to synchronize with the main chain (decentralize communication, propagate transactions, distribute blocks, reduce latency, etc.) and, as the core of the stake pool, mint new blocks, validate transactions, and submit blocks, respectively.
To wrap up, we must turn the installed Cardano node into a relay node. The Cardano Relay Configuration tutorial decomposes the process into three: running a preproduction testnet, creating startup scripts, and launching the node. Syncing the node with the blockchain takes some time — and if the process is stopped (using the command line), restarting the relay node resumes action. Monitor the node status on the CLI using gLiveView and build a dashboard to help you efficiently manage your pool.
3. Generating Keys and Certificates
Because the relay nodes from the above step are in sync with our chosen testnet network, you need to convert one of them into a block-producing node. First, we need to generate wallet keys, payment keys, and stake keys, then confirm progress by experimenting on the testnet. The second is to generate cardano block producer keys, cold keys, KES keys, and VRF keys as listed. It is also in this step that you create a certificate for operating the stake pool and update the startup script to use the new keys. Once the relay is converted to a block producer, the pool is ready for registration on the network.
In third place is registering a stake address, published on the blockchain as a transaction to make it useful. In this case, some preliminary information is collected: the address paying for the transaction and deposit, transaction output as address value, transaction validity time, stake address registration certificate and the fee amount in ADA. Consider this step complete once you build the transaction, sign it, and submit it on the main chain.
Similarly, and in the last position, the pool’s metadata is now published on the blockchain. In five moves, you’ll register the pool by creating a JSON file with your metadata and storing it in the node and as a URI, getting the hash of the JSON, generating the pool registration certificate, creating the delegation certificate pledge, and finally submitting the certificates on to the blockchain. Be sure to generate certificates on your local machine if you’re on the mainnet to avoid exposing your keys to the internet.
4. Testing the Stake Pool
Testing allows us to run simulations on the testnet and monitor logs for errors. Once we are certain our stake pool works without errors, we will go live on the mainnet. Running the nodes on the testnet is sufficient to inform about how the pool works. Here, you prepare the topology files, a setup representing internet protocol (IP) addresses of the stake pool operator’s keys.
Additionally, you connect the relays with each other and the block producer node. When done, prepare startup scripts for both relay and block producer, and the Cardano node is set to run as a systemd service. Some useful system commands are listed in the same tutorial, like getting help, sending control commands to the manager, and inspecting the node.
It does not take too long to discover that you may need to check your node configurations, for instance, if you migrate your nodes from a local machine to cloud providers. Audit scripts are the ultimate tool and can be used to check security operations (SecOps) basic settings or Cardano node compliance. Security checks handle SSHD hardening, null password checks, running services, and firewall rules, but this only helps you identify configurations and does not guarantee that your server is entirely protected.
Regarding compliance, inspection caters to countercheck node versions, bootstraps, environment variables, file verification and parsing (where source code is translated to actionable software), node operations, topology, KES keys, and rotational alerts. The whole point of running scripts, which takes around 20 seconds, is to assert whether configurations are correct and adjust accordingly if need be.
5. Launching the Stake Pool on Mainnet
Launching a stake pool on the mainnet is no different. All you have to do is download the files for mainnet, create the wallet again, keys, register the pool, and more, as we have been discussing in the above steps. Also, in this step, the 500 ADA is paid for launching the pool on the mainnet. If you haven’t thought about it, it is time to announce your pool to potential delegators. We can get a stake pool up and running, but that’s not the end…
In the lots of learning to be after sought on the subject of setting up stake pools, we recommend the Cardano course, a handbook for using the Cardano node and its command line, whether as a pool operator, governance participant, or decentralized applications (DApps) developer.
Next Steps:
In the second discussion on running stake pools on Cardano, we highlighted the requirements for setting up a stake pool and the process for getting your node running on both testnet and mainnet. The next and final piece is all about the best practices for running a stake pool, the expected challenges, and how to become a successful stake pool operator. We also answer some frequently asked questions.