Run a Stake Pool Guided mode

Run a Stake Pool44 steps
  1. Start hereThe picture, the economics, the keys5 steps
  2. IInstallMachines, a hardened Ubuntu, the node8 steps
  3. IIConfigureChain, topology, service, offline machine6 steps
  4. IIIRegisterKeys, stake address, the pool6 steps
  5. IVRunDaily check, KES, blocks, votes, upgrades11 steps
  6. VToolboxCommands, scripts, Mithril, Midnight8 steps
Show commands for

Type a word to jump to a step.

Where are you?

The guide starts where you stand. You can always step back.

O-1 Your pool at a glance

Relays face the world, the block producer hides behind them, the cold keys never go online.

Your pool at a glance Cardano network Relay 1public · port 6000 Relay 2other country Relay 3optional · other provider firewall Block producer private · relays only VRF · KES · certificate Air-gapped machine cold keys · never online USB stick only Your pool at a glance Cardano network Relay 1port 6000 Relay 22nd country Relay 3optional firewall Block producer private · relays only VRF · KES · certificate USB stick only Air-gapped machine cold keys · signs never online
Your pool at a glance: the Cardano network reaches the relays; only the relays reach the private block producer behind a firewall; the cold keys live on an air-gapped machine that is connected by USB stick only.

Best practice is two relays, one block producer and one air-gapped computer. Put the two relays at different providers in different places: one relay down, and your block producer is still reachable. One relay runs, but without that reserve; a third adds reach, not safety — BRIAN runs three, so the examples list three. Every code block in this guide names the machine it runs on.

A first run on the testnet costs nothing and forgives every mistake: use --testnet-magic 2 (Preview) wherever this guide says --mainnet, and free test ADA from the faucet.

O-2 How a pool earns

Blocks bring rewards; fixed cost and margin pay the operator, the rest goes to the delegators.

  1. 1Blocksyour pool's sharereward pot
  2. 2Fixed costto the operator≥ 170 ₳
  3. 3Marginto the operatoryour %
  4. 4Delegatorsby their stakethe rest
How an epoch's rewards are split: blocks fill the pot, the fixed cost goes to the operator, then the margin, the rest to the delegators by stake.

Every epoch (5 days) the protocol pays each pool for the blocks it made, roughly in proportion to its stake. From that sum the pool keeps its fixed cost first (at least 170 ₳ per epoch), then its margin (a percentage you choose); everything else goes to the delegators by their stake. The payout arrives two epochs after the stake was counted.

Pledge is the stake you promise from your own wallet. It must stay there: an epoch in which your live pledge is below the declared one earns nothing. Saturation caps the useful size of a pool at about 1/500 of all staked ADA; above it, rewards per delegator fall.

Two deposits come back: 500 ₳ when the pool retires, 2 ₳ when the stake address is deregistered. The live numbers are on the guide overview.

O-3 Keys and where they live

Cold keys sign and stay offline; hot keys run the node; public files may go anywhere.

Air-gapped machinenever online · 2 encrypted backups
  • cold.skey
  • cold.counter
  • payment.skey
  • stake.skey
Block producerread-only for the node
  • kes.skey90 days
  • vrf.skeyalso in backup
  • node.cert
Publicsafe anywhere
  • *.vkey
  • payment.addr
  • stake.addr
  • pool ID
  • tx.raw · tx.signed
Where each key lives.

Three kinds of file. Cold: cold.skey, payment.skey, stake.skey and the counter — they create certificates and spend ADA, so they exist only on the air-gapped machine and its encrypted backups. Hot: kes.skey, vrf.skey, node.cert — the block producer needs them to make blocks; a stolen KES key costs you at most 90 days. Public: every .vkey, both addresses, the pool ID, unsigned and signed transactions.

Important A signing key never leaves the air-gapped machine, and nobody genuine ever asks for one — not a helper, not a tool, not a chat. If a step here seems to need it online, the step is wrong.

O-4 Before you start

Checked versions, the era word, and two settings every online command uses.

Every command was run against cardano-node 11.1.3 and cardano-cli 11.2.3 on 3 October 2026. All start with cardano-cli latest, the current era. The node's own documentation always takes precedence over this guide.

Block producer or relay
echo 'export CARDANO_NODE_SOCKET_PATH=/run/cardano/node.socket' >> ~/.bashrc
echo 'export CARDANO_NODE_NETWORK_ID=mainnet' >> ~/.bashrc
source ~/.bashrc

On the testnet the network ID is 2 instead of mainnet. Read each command before you run it; a placeholder in angle brackets is yours to fill. Nothing here is financial advice.

O-5 The installer: Parts I and II in one go

Order a server, download one file, answer a few questions — a relay runs at the end, with a report.

For a fresh Ubuntu 24.04 server there is pool-setup.sh: Parts I and II of this guide as one guided run. It asks everything up front — relay or block producer, mainnet or a testnet, your user name, the SSH port, how you log in (a key, or a password plus a one-time code from an authenticator app), the IP addresses of your other machines, whether to fetch the chain from Mithril — shows a summary, and only then starts. At the end a report in your home folder lists what it did, what to check and what comes next. It is in testing: the operator runs it first; it will be released here once it has set up real servers.

Your own computer
scp pool-setup.sh root@<server-ip>:~/
All nodes
sudo bash pool-setup.sh
bash pool-setup.sh --dry-run
sudo bash pool-setup.sh --keys
sudo bash pool-setup.sh --maintain
sudo bash pool-setup.sh --answers pool-setup-report.md

Without questions — download and ready: the top of the file is a block of answers, empty. Fill it in and the installer asks nothing. Hand the whole file to your hoster as user data (cloud-init) when you order the server, and the server sets itself up at first boot; log in afterwards and the report is there. One file, nothing else. A relay on Preview this way: an hourly server at Hetzner or DigitalOcean (2 vCPU, 8 GB, 80 GB disk), the file pasted as user data with these answers, a few minutes until the login works, the Mithril download in the background.

undefined
A_ROLE="relay"
A_NETWORK="preview"
A_USER="cardano-op"
A_SSH_PORT="2222"
A_LOGIN="key"
A_PUBKEY="ssh-ed25519 AAAA… phone"
A_BP_IP="none"
A_MITHRIL="yes"
A_CONFIRM="yes"

The report ends with the answers of that run — all but the password. Point the next machine at it with --answers and change only what differs, the address of the block producer, say. The report of one server is the recipe for the next. Changes on a set-up machine (--maintain) are always asked; the answers cover the installation. The cloud-init log is /var/log/cloud-init-output.log.

--dry-run walks through every question and prints what would happen without changing anything — try it first. --keys is the block producer's second run, after the three hot keys arrived by USB stick from the air-gapped machine. On the air-gapped machine itself the same file, run as your normal user, asks whether the pool wallet is CLI keys made there or a hardware wallet (Part III, step 6), installs cardano-cli from the checked archive in your Downloads folder and creates the keys — the signing keys never leave that machine, and the report names only the public values.

Later changes, same file: run it again on a machine it set up and it offers the changes instead of the installation — the other machines' addresses, a new SSH key or port, the hot keys, a node upgrade; on the air-gapped machine a KES renewal or the switch to a hardware wallet. Every change adds a dated section to the same report, so the file in your home folder is the history of the machine.

Note From a phone, the same works: an SSH app such as Termius copies the file to the server and runs it. The installer is plain bash — read it before you run it, like any script. It downloads only from IntersectMBO, Mithril and the Guild Operators, verifies the node's SHA-256 before unpacking, and never reads a signing key.

Check The report says cardano-node runs as a service, a second terminal logs in on the new port, and cardano-cli latest query tip answers.

I-1 What you need

Two kinds of server, one offline computer, and at least 505 ₳.

  • 2relays or more
  • 1block producer
  • 1air-gapped computer
  • 24 GBRAM, swap on top
  • 300 GBSSD
  • 505 ₳deposits + fees

Each node: Ubuntu 24.04 LTS (64-bit), 4 cores, a static IP, 10 Mbps or more. The block producer is the same kind of machine as a relay — what makes it the block producer is the three hot keys and a stricter firewall. Plus your pledge in ADA, in a wallet you control.

The air-gapped computer can be any laptop that runs Ubuntu from a fresh install and never goes online again. Also: a USB stick for moving files, and a second one for backups.

I-2 Your user and your SSH key

Never work as root: an own user with sudo, and a key pair instead of a password.

All nodes
sudo useradd -m -s /bin/bash cardano-op
sudo passwd cardano-op
sudo usermod -aG sudo cardano-op

On your own computer, once, then copy the public half to every server:

Your own computer
ssh-keygen -t ed25519 -C "stake-pool-ops"
ssh-copy-id -i ~/.ssh/id_ed25519.pub cardano-op@<server-ip>

From a phone: an SSH app makes the key for you. In Termius: Keychain → New key → ed25519, then copy the public key and put it on the server once (with the installer's question, or by pasting it into ~/.ssh/authorized_keys of cardano-op from the provider's web console). The private key stays in the app, protected by its lock; export an encrypted backup of it to a second place.

Check ssh cardano-op@<server-ip> logs in without asking for the password of cardano-op; sudo -v works.

I-3 Lock down SSH

Keys only, no root, another port — and keep one session open while you test.

In /etc/ssh/sshd_config (sudo nano), set these lines — add any that are missing:

File
Port 2222
PubkeyAuthentication yes
PasswordAuthentication no
PermitRootLogin no
PermitEmptyPasswords no
KbdInteractiveAuthentication no
X11Forwarding no
MaxAuthTries 3
LoginGraceTime 30
AllowUsers cardano-op
All nodes
sudo sshd -t && sudo systemctl restart ssh
sudo passwd -l root

Important Keep this session open. Log in from a second terminal with ssh -p 2222 cardano-op@<server-ip> before you close it — a typo here locks you out.

Check The second login works with your key; ssh -p 2222 -o PubkeyAuthentication=no cardano-op@<server-ip> is refused.

I-4 A one-time code as second factor

Optional: a password plus a six-digit code from your phone, for those who cannot keep a key.

A key is the stronger login and the one this guide assumes. If you work from a phone and would rather not carry a key, the next best thing is a password and a one-time code (TOTP) from an authenticator app — Termius has one built in, so do Aegis and Google Authenticator. Each code is good for thirty seconds and one use; guessing a password alone is no longer enough.

All nodes
sudo apt-get install -y libpam-google-authenticator
google-authenticator -t -d -f -r 3 -R 30 -W

Scan the QR code it prints with the app (or type the secret) and keep the emergency codes offline. Then tell PAM and sshd — first line of /etc/pam.d/sshd:

File
auth required pam_google_authenticator.so

and in /etc/ssh/sshd_config.d/10-stake-pool.conf (replacing the two lines from step 3):

File
PasswordAuthentication no
KbdInteractiveAuthentication yes
AuthenticationMethods keyboard-interactive
All nodes
sudo sshd -t && sudo systemctl restart ssh

Important Keep the old session open while you test. Lose the phone, lose the login: a second device with the same secret, or a key as the fallback, before you rely on it.

Check A new login asks for the password, then for a code; a wrong code is refused; fail2ban-client status sshd still counts the attempts.

I-5 Updates and fail2ban

Security updates install themselves; repeated bad logins get banned.

All nodes
sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get autoremove -y
sudo apt-get install -y unattended-upgrades fail2ban jq curl
sudo dpkg-reconfigure -plow unattended-upgrades

fail2ban watches the SSH port you chose — /etc/fail2ban/jail.local:

File
[sshd]
enabled = true
port = 2222
maxretry = 3
findtime = 10m
bantime = 1h
All nodes
sudo systemctl enable --now fail2ban
sudo fail2ban-client status sshd

Check fail2ban-client status sshd lists the jail; unattended-upgrades is enabled in /etc/apt/apt.conf.d/20auto-upgrades.

I-6 Firewall

Relays open two ports to the world; the block producer opens them to your relays and to you only.

Relay
  • 6000 · Cardanoanyone
  • 2222 · SSHyour keys only
  • everything elsedropped
Block producer
  • 6000 · Cardanoyour relays only
  • 2222 · SSHyour IP only
  • everything elsedropped
Which ports open to whom.

Relay — /etc/nftables.conf:

File
#!/usr/sbin/nft -f

flush ruleset

table inet filter {
    chain input {
        type filter hook input priority 0; policy drop;

        ct state established,related accept
        iifname "lo" accept
        ip protocol icmp accept
        ip6 nexthdr icmpv6 accept

        tcp dport 2222 accept
        tcp dport 6000 accept
    }

    chain forward {
        type filter hook forward priority 0; policy drop;
    }

    chain output {
        type filter hook output priority 0; policy accept;
    }
}

Block producer — /etc/nftables.conf:

File
#!/usr/sbin/nft -f

flush ruleset

table inet filter {
    chain input {
        type filter hook input priority 0; policy drop;

        ct state established,related accept
        iifname "lo" accept
        ip protocol icmp accept
        ip6 nexthdr icmpv6 accept

        ip saddr <your-management-ip> tcp dport 2222 accept
        ip saddr { <relay-1-ip>, <relay-2-ip>, <relay-3-ip> } tcp dport 6000 accept
    }

    chain forward {
        type filter hook forward priority 0; policy drop;
    }

    chain output {
        type filter hook output priority 0; policy accept;
    }
}
All nodes
sudo apt-get install -y nftables
sudo systemctl enable nftables
sudo nft -f /etc/nftables.conf
sudo nft list ruleset

Caution Your home IP changes? Then SSH to the block producer goes through a relay (ssh -J, see the useful commands) and the management line names the relays instead.

Check From another server, nc -zv <block-producer-ip> 6000 times out; from a relay it connects.

I-7 Time sync

Blocks live in one-second slots; a drifting clock misses them.

All nodes
sudo apt-get install -y chrony
sudo systemctl enable --now chrony
chronyc tracking

Check System time is off by a few milliseconds at most. On the block producer this matters most.

I-8 Install cardano-node — and check it

The official release, verified by its SHA-256 before it runs.

All nodes
VERSION=11.1.3
cd ~
wget https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-linux-amd64.tar.gz
wget https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-sha256sums.txt
sha256sum --ignore-missing -c cardano-node-${VERSION}-sha256sums.txt
mkdir -p ~/.local
tar -xzf cardano-node-${VERSION}-linux-amd64.tar.gz -C ~/.local/
sudo install -m 755 ~/.local/bin/cardano-node ~/.local/bin/cardano-cli /usr/local/bin/
cardano-node --version
cardano-cli --version

Check sha256sum prints cardano-node-11.1.3-linux-amd64.tar.gz: OK. Anything else: stop and delete the file.

Newer release? Take it from IntersectMBO/cardano-node only, and read its notes first. The archive also holds the network configuration files you copy in the next part.

II-1 Folders and configuration

A system user for the node, config in /etc/cardano, data in /var/lib/cardano.

All nodes
sudo useradd -r -m -d /var/lib/cardano -s /sbin/nologin cardano
sudo mkdir -p /etc/cardano /var/lib/cardano/db
sudo cp ~/.local/share/mainnet/*.json /etc/cardano/
sudo chown -R cardano:cardano /etc/cardano /var/lib/cardano
sudo usermod -aG cardano $USER

Log out and in again so the group counts. The block producer shares no peers and prints no metrics to the world:

Block producer
sudo jq '.PeerSharing = false' /etc/cardano/config.json > /tmp/config.json
sudo install -o cardano -g cardano -m 644 /tmp/config.json /etc/cardano/config.json

Check ls /etc/cardano shows config.json, topology.json and the genesis files; id lists the group cardano.

II-2 Download the chain with Mithril

A certified snapshot: hours instead of days.

All nodes
curl --proto '=https' --tlsv1.2 -sSfL \
  https://raw.githubusercontent.com/IntersectMBO/mithril/refs/heads/main/mithril-install.sh \
  | sh -s -- -c mithril-client -d latest -p $HOME/.local/bin

export AGGREGATOR_ENDPOINT=https://aggregator.release-mainnet.api.mithril.network/aggregator
export GENESIS_VERIFICATION_KEY=$(wget -q -O - \
  https://raw.githubusercontent.com/IntersectMBO/mithril/main/mithril-infra/configuration/release-mainnet/genesis.vkey)
export ANCILLARY_VERIFICATION_KEY=$(wget -q -O - \
  https://raw.githubusercontent.com/IntersectMBO/mithril/main/mithril-infra/configuration/release-mainnet/ancillary.vkey)

mkdir -p ~/mithril && cd ~/mithril
~/.local/bin/mithril-client cardano-db download latest --include-ancillary
sudo rm -rf /var/lib/cardano/db
sudo mv ~/mithril/db /var/lib/cardano/db
sudo chown -R cardano:cardano /var/lib/cardano/db

Note The client checks the snapshot's certificate chain against the genesis key — a tampered snapshot fails. GitHub rate limit? Take mithril-client from the Mithril releases.

Check ls /var/lib/cardano/db shows immutable, ledger and volatile.

II-3 Topology

Relays talk to the network and to your block producer; the block producer talks to your relays only.

Relay — /etc/cardano/topology.json:

File
{
  "bootstrapPeers": [
    { "address": "backbone.cardano.iog.io", "port": 3001 },
    { "address": "backbone.mainnet.cardanofoundation.org", "port": 3001 }
  ],
  "localRoots": [
    {
      "accessPoints": [
        { "address": "<block-producer-ip>", "port": 6000 }
      ],
      "advertise": false,
      "trustable": true,
      "valency": 1
    }
  ],
  "peerSnapshotFile": "peer-snapshot.json",
  "publicRoots": [
    { "accessPoints": [], "advertise": false }
  ],
  "useLedgerAfterSlot": 194140785
}

Block producer — /etc/cardano/topology.json:

File
{
  "bootstrapPeers": [],
  "localRoots": [
    {
      "accessPoints": [
        { "address": "<relay-1-ip>", "port": 6000 },
        { "address": "<relay-2-ip>", "port": 6000 },
        { "address": "<relay-3-ip>", "port": 6000 }
      ],
      "advertise": false,
      "trustable": true,
      "valency": 3
    }
  ],
  "publicRoots": [],
  "useLedgerAfterSlot": -1
}

Take useLedgerAfterSlot and peer-snapshot.json for the relays from your release's topology file. valency is how many of the listed peers the node keeps connected — all of them. A changed topology is read without a restart:

Block producer or relay
sudo systemctl reload cardano-node

II-4 Run the node as a service

systemd starts it at boot and restarts it when it stops.

/etc/systemd/system/cardano-node.service on a relay:

File
[Unit]
Description=Cardano Node
Wants=network-online.target
After=network-online.target

[Service]
User=cardano
Group=cardano
Type=simple
WorkingDirectory=/var/lib/cardano
ExecStart=/usr/local/bin/cardano-node run \
  --config        /etc/cardano/config.json \
  --topology      /etc/cardano/topology.json \
  --database-path /var/lib/cardano/db \
  --socket-path   /run/cardano/node.socket \
  --host-addr     0.0.0.0 \
  --port          6000
ExecReload=pkill -HUP cardano-node
KillSignal=SIGINT
RestartKillSignal=SIGINT
TimeoutStopSec=300
LimitNOFILE=131072
Restart=always
RestartSec=5
SyslogIdentifier=cardano-node
RuntimeDirectory=cardano
RuntimeDirectoryMode=0750

[Install]
WantedBy=multi-user.target

On the block producer, ExecStart also names the three hot keys (they arrive in Part III, step 3 — the service starts without them for now):

File
ExecStart=/usr/local/bin/cardano-node run \
  --config        /etc/cardano/config.json \
  --topology      /etc/cardano/topology.json \
  --database-path /var/lib/cardano/db \
  --socket-path   /run/cardano/node.socket \
  --host-addr     0.0.0.0 \
  --port          6000 \
  --shelley-kes-key                 /var/lib/cardano/keys/kes.skey \
  --shelley-vrf-key                 /var/lib/cardano/keys/vrf.skey \
  --shelley-operational-certificate /var/lib/cardano/keys/node.cert
All nodes
sudo systemctl daemon-reload
sudo systemctl enable --now cardano-node
journalctl -fu cardano-node

Check The log shows Started opening Immutable DB, later Chain extended lines. Ctrl+C leaves the log, not the node.

II-5 Watch it sync

A first look at your node: the tip from the command line, the whole picture from gLiveView.

Block producer or relay
cardano-cli latest query tip

gLiveView from the Guild Operators shows sync, peers, blocks and resources on one screen. It expects an environment file next to it:

Block producer or relay
mkdir -p ~/scripts && cd ~/scripts
curl -s -o gLiveView.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/gLiveView.sh
curl -s -o env https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/env
chmod 755 gLiveView.sh
sed -i 's|^#CNODE_PORT=.*|CNODE_PORT="6000"|; s|^#CONFIG=.*|CONFIG="/etc/cardano/config.json"|; s|^#SOCKET=.*|SOCKET="/run/cardano/node.socket"|; s|^#TOPOLOGY=.*|TOPOLOGY="/etc/cardano/topology.json"|' env
./gLiveView.sh

Note Read a downloaded script before you run it, this one included. The two files are plain text; less gLiveView.sh shows what it does.

Check query tip shows "syncProgress": "100.00" before you go on to Part III; gLiveView shows peers in and out.

II-6 The air-gapped machine

A computer that never connects — for the cold keys and every signature.

A spare laptop with a fresh Ubuntu. After installing: Wi-Fi and Bluetooth off for good, no cable, no USB stick that has been anywhere but your own nodes. Bring the checked node archive on a stick:

Air-gapped machine
cd /media/$USER/<usb-stick>
sha256sum --ignore-missing -c cardano-node-11.1.3-sha256sums.txt
mkdir -p ~/cardano && tar -xzf cardano-node-11.1.3-linux-amd64.tar.gz -C ~/cardano
sudo install -m 755 ~/cardano/bin/cardano-cli /usr/local/bin/
cardano-cli --version
mkdir -p ~/cold-keys && chmod 700 ~/cold-keys

Important Two encrypted backups of ~/cold-keys, in two places, restore-tested (Part IV, step 9). Whoever holds these files owns the pool.

Check cardano-cli --version matches the nodes; nmcli radio all says disabled.

Is your node fully synced?

Registration needs a node at 100 percent.

III-1 Payment and stake keys

The wallet that pays the deposits and receives the rewards.

  1. 1Buildsynced nodetx.raw
  2. 2Signair-gapped machinetx.signed
  3. 3Submitsynced nodeon chain
Build online, sign offline, submit online.
Air-gapped machine
cd ~/cold-keys
cardano-cli latest address key-gen \
  --verification-key-file payment.vkey \
  --signing-key-file payment.skey
cardano-cli latest stake-address key-gen \
  --verification-key-file stake.vkey \
  --signing-key-file stake.skey
cardano-cli latest address build \
  --payment-verification-key-file payment.vkey \
  --stake-verification-key-file stake.vkey \
  --mainnet \
  --out-file payment.addr
cardano-cli latest stake-address build \
  --stake-verification-key-file stake.vkey \
  --mainnet \
  --out-file stake.addr

Copy payment.addr, stake.addr and the .vkey files to a node (Part V, move files). Send a small test amount first, then at least 505 ₳ plus your pledge. Would you rather keep the pledge on a Ledger or Trezor? Then skip this step and take step 6 instead.

Block producer or relay
cardano-cli latest query utxo --address $(cat payment.addr) --output-json

Check The UTxO list shows your amount. Compare the address character by character with the one on the air-gapped machine.

III-2 Register the stake address

2 ₳ deposit — build, sign, submit.

Block producer or relay
cardano-cli latest query protocol-parameters --out-file protocol.json
cardano-cli latest stake-address registration-certificate \
  --stake-verification-key-file stake.vkey \
  --key-reg-deposit-amt $(jq '.stakeAddressDeposit' protocol.json) \
  --out-file stake.cert
cardano-cli latest transaction build \
  --tx-in $(cardano-cli latest query utxo --address $(cat payment.addr) --output-json | jq -r 'keys[0]') \
  --change-address $(cat payment.addr) \
  --certificate-file stake.cert \
  --witness-override 2 \
  --out-file tx.raw
Air-gapped machine
cardano-cli latest transaction sign \
  --tx-body-file tx.raw \
  --signing-key-file payment.skey \
  --signing-key-file stake.skey \
  --mainnet \
  --out-file tx.signed
Block producer or relay
cardano-cli latest transaction submit --tx-file tx.signed

Note keys[0] spends the first UTxO. Too small? Name another one in --tx-in. Before signing, cardano-cli debug transaction view --tx-file tx.raw shows what you are about to sign.

Check Transaction successfully submitted; a few minutes later query stake-address-info --address $(cat stake.addr) lists the address.

III-3 Pool keys and the operational certificate

Cold keys stay offline; the block producer gets three files.

Air-gapped machine
cd ~/cold-keys
cardano-cli latest node key-gen \
  --cold-verification-key-file cold.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-issue-counter-file cold.counter
cardano-cli latest node key-gen-VRF \
  --verification-key-file vrf.vkey \
  --signing-key-file vrf.skey
cardano-cli latest node key-gen-KES \
  --verification-key-file kes.vkey \
  --signing-key-file kes.skey

The current KES period, from a synced node:

Block producer or relay
slotsPerKESPeriod=$(jq -r '.slotsPerKESPeriod' /etc/cardano/shelley-genesis.json)
slotNo=$(cardano-cli latest query tip | jq -r '.slot')
echo $(( slotNo / slotsPerKESPeriod ))
Air-gapped machine
cardano-cli latest node issue-op-cert \
  --kes-verification-key-file kes.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-issue-counter-file cold.counter \
  --kes-period <kes-period> \
  --out-file node.cert

Copy kes.skey, vrf.skey and node.cert to the block producer by USB stick; then there:

Block producer
sudo mkdir -p /var/lib/cardano/keys
sudo install -o cardano -g cardano -m 400 kes.skey vrf.skey node.cert /var/lib/cardano/keys/
shred -u kes.skey vrf.skey
sudo systemctl daemon-reload && sudo systemctl restart cardano-node

Check journalctl -u cardano-node | grep -i 'operational certificate' shows no error; the KES check in Part IV, step 2 reports the expiry date.

III-4 Register the pool

Metadata online, two certificates, the 500 ₳ deposit.

Publish poolMetaData.json at a URL of at most 64 characters — your homepage or GitHub Pages. Ticker: 3 to 5 characters. Give each relay a DNS name (an A record) so an IP change needs no re-registration.

File
{
  "name": "Your Pool Name",
  "description": "What your pool stands for",
  "ticker": "TICK",
  "homepage": "https://yourpool.example"
}
Block producer or relay
cardano-cli latest stake-pool metadata-hash \
  --pool-metadata-file <(curl -s -L https://yourpool.example/poolMetaData.json) \
  --out-file poolMetaDataHash.txt
jq '.minPoolCost, .stakePoolDeposit' protocol.json

With poolMetaDataHash.txt on the air-gapped machine — amounts in lovelace (1 ₳ = 1,000,000): here 1,000 ₳ pledge, 170 ₳ fixed cost, 1 % margin, three relays:

Air-gapped machine
cardano-cli latest stake-pool registration-certificate \
  --cold-verification-key-file cold.vkey \
  --vrf-verification-key-file vrf.vkey \
  --pool-pledge 1000000000 \
  --pool-cost 170000000 \
  --pool-margin 0.01 \
  --pool-reward-account-verification-key-file stake.vkey \
  --pool-owner-stake-verification-key-file stake.vkey \
  --single-host-pool-relay relay1.yourpool.example --pool-relay-port 6000 \
  --single-host-pool-relay relay2.yourpool.example --pool-relay-port 6000 \
  --single-host-pool-relay relay3.yourpool.example --pool-relay-port 6000 \
  --metadata-url https://yourpool.example/poolMetaData.json \
  --metadata-hash $(cat poolMetaDataHash.txt) \
  --mainnet \
  --out-file pool.cert
cardano-cli latest stake-address stake-delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --cold-verification-key-file cold.vkey \
  --out-file deleg.cert
Block producer or relay
cardano-cli latest transaction build \
  --tx-in $(cardano-cli latest query utxo --address $(cat payment.addr) --output-json | jq -r 'keys[0]') \
  --change-address $(cat payment.addr) \
  --certificate-file pool.cert \
  --certificate-file deleg.cert \
  --witness-override 3 \
  --out-file tx.raw
Air-gapped machine
cardano-cli latest transaction sign \
  --tx-body-file tx.raw \
  --signing-key-file payment.skey \
  --signing-key-file stake.skey \
  --signing-key-file cold.skey \
  --mainnet \
  --out-file tx.signed
Block producer or relay
cardano-cli latest transaction submit --tx-file tx.signed

Caution Relay names in the certificate, never the block producer. Keep the pledge in the owner wallet — below it, the pool earns nothing that epoch. The metadata file must stay byte for byte what you hashed.

Check Transaction successfully submitted. The 500 ₳ deposit leaves the wallet; it comes back when the pool retires.

III-5 Check the registration

Your pool ID, its stake, and how an explorer sees you.

Air-gapped machine
cardano-cli latest stake-pool id --cold-verification-key-file cold.vkey --output-format bech32 > stakepoolid.txt
cat stakepoolid.txt
Block producer or relay
cardano-cli latest query stake-snapshot --stake-pool-id $(cat stakepoolid.txt)

Check The ID starting with pool1 shows up on cexplorer.io and adastat.net with your ticker and metadata. Stake counts after two epoch boundaries; the first blocks come when stake has been counted.

III-6 With a hardware wallet

Owner and rewards on a Ledger or Trezor; the cold keys stay on the air-gapped machine.

The pool's cold keys have no hardware-wallet form; the owner and reward keys do. With them on a device, the pledge sits in a wallet nobody can sign from without pressing a button, and the air-gapped machine keeps only the cold keys. The tool is cardano-hw-cli (Vacuumlabs, open source) on a computer with the device attached — that computer needs no chain and no node, only the files below.

Your own computer
cardano-hw-cli address key-gen --path 1852H/1815H/0H/0/0 --verification-key-file payment.vkey --hw-signing-file payment.hwsfile
cardano-hw-cli address key-gen --path 1852H/1815H/0H/2/0 --verification-key-file stake.vkey --hw-signing-file stake.hwsfile

A .hwsfile is not a key: it names the derivation path, and the device signs. Build the addresses from the two .vkey files as in step 1, fund the payment address, and build the registration transactions as in steps 2 and 4 with these .vkey files — --pool-owner-stake-verification-key-file stake.vkey and --pool-reward-account-verification-key-file stake.vkey now name the device's key. Signing becomes witnessing: the device witnesses its keys, the air-gapped machine witnesses the cold key, a node assembles.

Your own computer
cardano-hw-cli transaction witness --tx-file tx.raw --hw-signing-file payment.hwsfile --hw-signing-file stake.hwsfile --mainnet --out-file payment.witness --out-file stake.witness
Air-gapped machine
cardano-cli latest transaction witness --tx-body-file tx.raw --signing-key-file cold.skey --mainnet --out-file cold.witness
Block producer or relay
cardano-cli latest transaction assemble --tx-body-file tx.raw --witness-file payment.witness --witness-file stake.witness --witness-file cold.witness --out-file tx.signed
cardano-cli latest transaction submit --tx-file tx.signed

Caution Check the device's screen against the certificate: the pool ID, the pledge, the cost, the margin and the reward address are all shown before you confirm. A device that shows something else has been handed a different transaction.

Check The explorer shows the pool with the device's stake address as owner and reward account; the pledge counts once that stake is delegated to the pool.

Your pool is registered. What do you need today?

Part IV is a toolbox; pick what is due.

IV-1 The daily check

Five numbers a day keep a pool healthy: sync, peers, KES days left, disk, memory.

Block producer
cardano-cli latest query tip | jq '{syncProgress, epoch, block}'
cardano-cli latest query kes-period-info --op-cert-file /var/lib/cardano/keys/node.cert --out-file /tmp/kes.json && jq '{qKesKesKeyExpiry, qKesRemainingKesPeriods}' /tmp/kes.json
curl -s http://127.0.0.1:12798/metrics | grep -E 'peerSelection_Hot_int|slotsMissed_int|blocksForged_int'
df -h /var/lib/cardano && free -h

What the numbers tell you — and what to do:

  • Sync below 100 on one node: peers or time. Check gLiveView, chronyc tracking, the topology.
  • Missed slots growing on the block producer: the machine is too slow or too busy — RAM, swap, CPU, a backup running at the wrong time.
  • KES under ten remaining periods: renew now (step 2). Put the expiry date in your calendar the day you issue a certificate.
  • Disk above 80 %: the chain grows; plan a bigger disk before it is full.
  • Memory near the limit: add swap (Part V) and check the next release notes for memory changes.

The helper script pool-check.sh in Part V prints all of this as one screen. An operator who looks once a day sees every problem before it costs a block. A monitoring stack (Prometheus and Grafana on a separate machine) is the next step up.

IV-2 Renew the KES key

Every 90 days at the latest — the certificate counter must fit the chain.

  • Day 0–80 blocks as usual
  • Day 80–90 renew now
  • After 93 no more blocks

1 KES period = 36 hours · 62 periods ≈ 93 days

KES key lifetime: renew between day 80 and 90; after day 93 no blocks.
Block producer
sudo -u cardano cardano-cli latest query kes-period-info \
  --mainnet \
  --socket-path /run/cardano/node.socket \
  --op-cert-file /var/lib/cardano/keys/node.cert

Current KES period as in Part III, step 3; then on the air-gapped machine:

Air-gapped machine
cd ~/cold-keys
cardano-cli latest node key-gen-KES \
  --verification-key-file kes.vkey \
  --signing-key-file kes.skey
cardano-cli latest node issue-op-cert \
  --kes-verification-key-file kes.vkey \
  --cold-signing-key-file cold.skey \
  --operational-certificate-issue-counter-file cold.counter \
  --kes-period <kes-period> \
  --out-file node.cert
Block producer
sudo install -o cardano -g cardano -m 400 kes.skey node.cert /var/lib/cardano/keys/
shred -u kes.skey
sudo systemctl restart cardano-node

Caution The new certificate's counter may be at most one above the counter in the pool's last block. No block since the last renewal? Reuse that certificate's counter — cardano-cli latest node new-counter sets it.

Check kes-period-info reports the new expiry date and says the counters agree.

IV-3 Blocks and the leader schedule

The slots your pool is due for, known 1.5 days before the epoch starts.

Block producer
sudo -u cardano cardano-cli latest query leadership-schedule \
  --mainnet \
  --socket-path /run/cardano/node.socket \
  --genesis /etc/cardano/shelley-genesis.json \
  --stake-pool-id $(cat stakepoolid.txt) \
  --vrf-signing-key-file /var/lib/cardano/keys/vrf.skey \
  --next

--next works from 1.5 days before the epoch boundary; --current any time. The helper script leader-schedule.sh in Part V saves each schedule by itself. On a schedule day: no restart, no upgrade, no backup at the slot's minute.

No slots at all for an epoch is normal for a small pool: the chance per epoch is roughly stake divided by total stake times 21,600 blocks. A missed slot that was yours shows in slotsMissed_int; a slot that another pool won too is a battle, not a fault.

Check The schedule lists slots with times in UTC; your block then shows on an explorer at that time.

IV-4 Delegate your vote

Needed before rewards can be withdrawn.

Air-gapped machine
cardano-cli latest stake-address vote-delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --always-abstain \
  --out-file vote-deleg.cert

Build with --certificate-file vote-deleg.cert --witness-override 2, sign with payment.skey and stake.skey, submit — the same three moves as in Part III, step 2. A DRep instead of abstaining: --drep-key-hash with the DRep's ID.

Check query stake-address-info shows voteDelegation as alwaysAbstain or the DRep.

IV-5 Withdraw the rewards

The whole reward balance into your wallet.

Block producer or relay
rewards=$(cardano-cli latest query stake-address-info --address $(cat stake.addr) | jq -r '.[0].rewardAccountBalance')
cardano-cli latest transaction build \
  --tx-in $(cardano-cli latest query utxo --address $(cat payment.addr) --output-json | jq -r 'keys[0]') \
  --withdrawal "$(cat stake.addr)+${rewards}" \
  --change-address $(cat payment.addr) \
  --witness-override 2 \
  --out-file tx.raw

Sign with payment.skey and stake.skey, submit. Rewards that stay in the reward account still count as stake — withdraw when you need them, not every epoch.

Check query utxo shows the amount at your payment address; the reward balance reads 0.

IV-6 Vote as a pool

Hard forks, some parameters, no-confidence, committee changes — the operator's voice.

Block producer or relay
cardano-cli latest query proposals --all-proposals \
  | jq '.[] | {id: .actionId, type: .proposalProcedure.govAction.tag, url: .proposalProcedure.anchor.url}'
Air-gapped machine
cardano-cli latest governance vote create \
  --yes \
  --governance-action-tx-id <tx-id> \
  --governance-action-index 0 \
  --cold-verification-key-file cold.vkey \
  --out-file pool.vote
Block producer or relay
cardano-cli latest transaction build \
  --tx-in $(cardano-cli latest query utxo --address $(cat payment.addr) --output-json | jq -r 'keys[0]') \
  --change-address $(cat payment.addr) \
  --vote-file pool.vote \
  --witness-override 2 \
  --out-file tx.raw

Sign with cold.skey and payment.skey, submit. --no or --abstain as you decide; read the proposal's anchor first.

IV-7 Change pool parameters

Pledge, cost, margin, relays, metadata — no new deposit.

Build a new pool.cert exactly as in Part III, step 4 with the new values, then a transaction with --certificate-file pool.cert --witness-override 3, signed with payment.skey, stake.skey and cold.skey. No deleg.cert this time. The change takes effect at the next epoch boundary.

Check The explorer shows the new values under your pool after the boundary.

IV-8 Upgrade the node

Relays first, the block producer last — right after one of your blocks.

All nodes
VERSION=<new-version>
cd ~
wget https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-linux-amd64.tar.gz
wget https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-sha256sums.txt
sha256sum --ignore-missing -c cardano-node-${VERSION}-sha256sums.txt
tar -xzf cardano-node-${VERSION}-linux-amd64.tar.gz -C ~/.local/
sudo systemctl stop cardano-node
sudo install -m 755 ~/.local/bin/cardano-node ~/.local/bin/cardano-cli /usr/local/bin/
sudo systemctl start cardano-node
cardano-node --version

Read the release notes first; some releases need new configuration files (~/.local/share/mainnet/ after unpacking). Upgrade one relay, watch it sync and hold peers for a day, then the rest. Bring the new cardano-cli to the air-gapped machine too. The helper script node-upgrade.sh in Part V does the download and checks.

Check cardano-node --version shows the new version; query tip reaches 100 again.

IV-9 Back up and restore

What to save, how to encrypt it, and the restore test that makes a backup real.

Cold keys: the whole ~/cold-keys folder (the four signing keys, the counter, every .vkey, addresses, the pool ID). Hot keys: vrf.skey is in the cold folder too; kes.skey and node.cert can be recreated. Nodes: /etc/cardano, the service file, the firewall file, poolMetaData.json. The chain itself needs no backup — Mithril brings it back in hours.

Air-gapped machine
cd ~
tar -czf - cold-keys | gpg --symmetric --cipher-algo AES256 -o /media/$USER/<backup-stick>/cold-keys-$(date +%F).tar.gz.gpg
gpg --decrypt /media/$USER/<backup-stick>/cold-keys-$(date +%F).tar.gz.gpg | tar -tzf -

The second line is the restore test: it lists the files inside the backup using only the stick and the passphrase. Two sticks, two places, the passphrase in a third — written down, not in a password manager that syncs. Redo the backup after every KES renewal (the counter changed).

Important A backup that was never restored is a hope, not a backup. Test it the day you make it, and once a year after.

IV-10 Housekeeping

Logs, disk, memory, reboots — the small things that keep a node quiet.

All nodes
sudo journalctl --vacuum-time=14d
sudo sed -i 's|^#\?SystemMaxUse=.*|SystemMaxUse=1G|' /etc/systemd/journald.conf && sudo systemctl restart systemd-journald
df -h / /var/lib/cardano
sudo apt-get autoremove -y
cat /var/run/reboot-required 2>/dev/null

A kernel update asks for a reboot. Order: one relay, wait until it has synced and holds peers, the next relay, the block producer last and right after one of your blocks. Restart=always in the service file brings the node back on its own.

Once a month: sudo fail2ban-client status sshd (who knocks), chronyc tracking, sudo nft list ruleset (still what you wrote), and the backup date in your calendar.

IV-11 Retire the pool

The 500 ₳ deposit returns at the epoch you name.

Air-gapped machine
cardano-cli latest stake-pool deregistration-certificate \
  --cold-verification-key-file cold.vkey \
  --epoch <retirement-epoch> \
  --out-file pool.dereg

Submit it signed with payment.skey and cold.skey. Announce it and give delegators two epochs or more to move. The deposit lands in the reward account at the retirement epoch; withdraw it as in step 5, then deregister the stake address if you want the 2 ₳ back.

V-1 Useful commands

The lines an operator types most, by situation.

Is the node fine?

Block producer or relay
cardano-cli latest query tip
systemctl status cardano-node --no-pager
journalctl -u cardano-node --since "1 hour ago" --no-pager | tail -n 50
curl -s http://127.0.0.1:12798/metrics | grep -E 'blockNum_int|peerSelection_Hot_int|density_real'

Keys and the certificate

Block producer
cardano-cli latest query kes-period-info --op-cert-file /var/lib/cardano/keys/node.cert
curl -s http://127.0.0.1:12798/metrics | grep -E 'remainingKESPeriods|slotsMissed_int|blocksForged_int'

Money

Block producer or relay
cardano-cli latest query utxo --address $(cat payment.addr)
cardano-cli latest query stake-address-info --address $(cat stake.addr)
cardano-cli latest query protocol-parameters | jq '{minPoolCost, stakePoolDeposit, stakeAddressDeposit}'
cardano-cli latest query stake-snapshot --stake-pool-id $(cat stakepoolid.txt) | jq '.pools[].stakeMark'

Change something and apply it

Block producer or relay
sudo systemctl reload cardano-node
sudo systemctl restart cardano-node
sudo nft -f /etc/nftables.conf && sudo nft list ruleset
sudo fail2ban-client status sshd
sudo fail2ban-client set sshd unbanip <ip>

Reach the block producer through a relay (when its firewall allows SSH from the relays only)

Your own computer
ssh -p 2222 -J cardano-op@<relay-ip>:2222 cardano-op@<block-producer-ip>

Look before you sign

Air-gapped machine
cardano-cli debug transaction view --tx-file tx.raw

V-2 Helper scripts

Four small scripts: the daily screen, the upgrade, the backup, the schedule — and the node as a container.

Each one is plain bash; read it, save it as named under ~/scripts, chmod 755, run it. They use only what this guide installed. pool-check.sh — the daily check as one screen, on any node:

Block producer or relay
#!/usr/bin/env bash
set -u
export CARDANO_NODE_SOCKET_PATH=${CARDANO_NODE_SOCKET_PATH:-/run/cardano/node.socket}
OPCERT=${OPCERT:-/var/lib/cardano/keys/node.cert}
echo "== $(hostname) · $(date -u '+%Y-%m-%d %H:%M UTC')"
echo "service: $(systemctl is-active cardano-node)"
if tip=$(cardano-cli latest query tip 2>/dev/null); then
  echo "$tip" | jq -r '"sync: \(.syncProgress) %   epoch \(.epoch)   block \(.block)"'
else
  echo "sync: node not answering"
fi
metrics=$(curl -s -m 2 http://127.0.0.1:12798/metrics)
echo "peers: $(echo "$metrics" | awk '/peerSelection_Hot_int|connectedPeers_int/ {print $2; exit}')"
if [ -r "$OPCERT" ]; then
  if cardano-cli latest query kes-period-info --op-cert-file "$OPCERT" --out-file /tmp/kes.json >/dev/null 2>&1; then
    jq -r '"kes: \(.qKesRemainingKesPeriods) periods left, expires \(.qKesKesKeyExpiry)"' /tmp/kes.json
  fi
  echo "$metrics" | awk '/slotsMissed_int|slotsMissedNum_int/ {print "missed slots since start: " $2; exit}'
  echo "$metrics" | awk '/blocksForged_int/ {print "blocks forged since start: " $2; exit}'
fi
df -h /var/lib/cardano | awk 'NR==2 {print "disk: " $5 " used, " $4 " free"}'
free -h | awk '/Mem:/ {print "memory: " $3 " used of " $2}'
echo "host $(uptime -p)"

node-upgrade.sh — download, verify, install, restart; on relays first, on the block producer right after one of your blocks:

Block producer or relay
#!/usr/bin/env bash
set -eu
VERSION=${1:?usage: node-upgrade.sh <version>}
cd ~
wget -q https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-linux-amd64.tar.gz
wget -q https://github.com/IntersectMBO/cardano-node/releases/download/${VERSION}/cardano-node-${VERSION}-sha256sums.txt
sha256sum --ignore-missing -c cardano-node-${VERSION}-sha256sums.txt
rm -rf ~/.local/node-${VERSION} && mkdir -p ~/.local/node-${VERSION}
tar -xzf cardano-node-${VERSION}-linux-amd64.tar.gz -C ~/.local/node-${VERSION}
echo "installed files checked; stopping the node"
sudo systemctl stop cardano-node
sudo install -m 755 ~/.local/node-${VERSION}/bin/cardano-node ~/.local/node-${VERSION}/bin/cardano-cli /usr/local/bin/
sudo systemctl start cardano-node
cardano-node --version
echo "new configuration files, if the release notes ask for them: ~/.local/node-${VERSION}/share/mainnet/"

backup-cold-keys.sh — encrypted backup with the restore test, on the air-gapped machine:

Air-gapped machine
#!/usr/bin/env bash
set -eu
STICK=${1:?usage: backup-cold-keys.sh /media/$USER/<backup-stick>}
OUT="$STICK/cold-keys-$(date +%F).tar.gz.gpg"
cd ~
tar -czf - cold-keys | gpg --symmetric --cipher-algo AES256 -o "$OUT"
echo "written: $OUT"
echo "restore test — the files inside:"
gpg --decrypt "$OUT" | tar -tzf -
sync

leader-schedule.sh — saves next epoch's schedule once it is available; run daily from cron on the block producer:

Block producer
#!/usr/bin/env bash
set -eu
export CARDANO_NODE_SOCKET_PATH=/run/cardano/node.socket
mkdir -p ~/schedules
tip=$(cardano-cli latest query tip)
epoch=$(echo "$tip" | jq -r '.epoch')
slot=$(echo "$tip" | jq -r '.slotInEpoch')
next=$((epoch + 1))
[ "$slot" -ge 302400 ] || { echo "next schedule not available yet"; exit 0; }
[ -s ~/schedules/epoch-$next.txt ] && { echo "epoch $next already saved"; exit 0; }
cardano-cli latest query leadership-schedule \
  --mainnet \
  --genesis /etc/cardano/shelley-genesis.json \
  --stake-pool-id $(cat ~/stakepoolid.txt) \
  --vrf-signing-key-file /var/lib/cardano/keys/vrf.skey \
  --next > ~/schedules/epoch-$next.txt
cat ~/schedules/epoch-$next.txt
Block producer
(crontab -l 2>/dev/null; echo "0 2 * * * $HOME/scripts/leader-schedule.sh >> $HOME/schedules/cron.log 2>&1") | crontab -

Caution leader-schedule.sh needs read access to vrf.skey; run it as a user in the cardano group, or sudo -u cardano as in Part IV, step 3. Never copy the VRF key anywhere for this.

The node as a container. On a Linux machine you already hardened (Part I) the node can run from the official IntersectMBO image instead of the service in Part II. The configuration and topology are the same files; the chain comes from Mithril into the db folder first (Part II, step 2). Docker gives you the node, not the hardening — user, SSH, fail2ban and firewall stay yours. Save this as compose.yml next to a config folder with the files from /opt/cardano/${NODE_VERSION}/share/mainnet, then docker compose up -d; docker compose logs -f is the journal, docker compose pull && docker compose up -d the upgrade after you changed the version.

Relays
services:
  cardano-node:
    image: ghcr.io/intersectmbo/cardano-node:11.1.3
    restart: unless-stopped
    ports:
      - "6000:6000"
    volumes:
      - ./config:/config:ro
      - ./db:/data/db
      - ./ipc:/ipc
    command: >
      run
      --config /config/config.json
      --topology /config/topology.json
      --database-path /data/db
      --socket-path /ipc/node.socket
      --host-addr 0.0.0.0
      --port 6000

Note A block producer in a container needs its three hot keys mounted read-only as a fourth volume and the --shelley-* flags from Part II, step 4 — possible, but the service of Part II is the simpler home for it. Read the image's notes on GitHub before you rely on it.

V-3 Send ADA

A plain payment, here 10 ₳.

Block producer or relay
cardano-cli latest transaction build \
  --tx-in $(cardano-cli latest query utxo --address $(cat payment.addr) --output-json | jq -r 'keys[0]') \
  --tx-out "<receiver-address>+10000000" \
  --change-address $(cat payment.addr) \
  --out-file tx.raw

Sign with payment.skey, submit. Check the receiver address on the air-gapped machine before signing: cardano-cli debug transaction view --tx-file tx.raw.

V-4 Move files

scp to the nodes, a USB stick to the air-gapped machine.

Your own computer
scp -P 2222 cardano-op@<node-ip>:~/tx.raw .
scp -P 2222 tx.signed cardano-op@<node-ip>:~/

Caution Never copy a signing key over the network. The stick that carries kes.skey to the block producer: wipe it afterwards (shred the file, then reformat).

V-5 Add swap

Protects a node with little RAM from memory peaks.

All nodes
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -h

V-6 Sign for Mithril

Your block producer can help certify the snapshots everyone syncs from.

Mithril snapshots are signed by stake pools; a pool that runs a signer adds its stake to that certificate. The signer runs on the block producer and talks to the aggregator through a small proxy (squid) on a relay, so the block producer still opens nothing. Mithril updates often: take the current values from mithril.network before you run this.

On a relay, squid as the proxy — /etc/squid/squid.conf, then sudo systemctl restart squid:

File
http_port 3132
acl aggregator_domain dstdomain .mithril.network
acl SSL_ports port 443
acl Safe_ports port 443
acl CONNECT method CONNECT
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow aggregator_domain
http_access deny all

In the relay's firewall, port 3132 from the block producer's IP only. On the block producer:

Block producer
curl --proto '=https' --tlsv1.2 -sSfL \
  https://raw.githubusercontent.com/IntersectMBO/mithril/refs/heads/main/mithril-install.sh \
  | sh -s -- -c mithril-signer -d latest -p $HOME/.local/bin
sudo install -m 755 ~/.local/bin/mithril-signer /usr/local/bin/
sudo mkdir -p /etc/mithril-signer /var/lib/mithril-signer && sudo chown cardano:cardano /var/lib/mithril-signer

/etc/mithril-signer/env (the party ID is your pool ID):

File
NETWORK=mainnet
AGGREGATOR_ENDPOINT=https://aggregator.release-mainnet.api.mithril.network/aggregator
RELAY_ENDPOINT=http://<relay-1-ip>:3132
PARTY_ID=<pool1...>
RUN_INTERVAL=60000
DB_DIRECTORY=/var/lib/cardano/db
CARDANO_NODE_SOCKET_PATH=/run/cardano/node.socket
CARDANO_CLI_PATH=/usr/local/bin/cardano-cli
DATA_STORES_DIRECTORY=/var/lib/mithril-signer/stores
STORE_RETENTION_LIMIT=5
KES_SECRET_KEY_PATH=/var/lib/cardano/keys/kes.skey
OPERATIONAL_CERTIFICATE_PATH=/var/lib/cardano/keys/node.cert
ERA_READER_ADAPTER_TYPE=cardano-chain
ERA_READER_ADAPTER_PARAMS=<from the Mithril documentation for release-mainnet>

/etc/systemd/system/mithril-signer.service:

File
[Unit]
Description=Mithril signer
After=cardano-node.service

[Service]
User=cardano
Group=cardano
EnvironmentFile=/etc/mithril-signer/env
ExecStart=/usr/local/bin/mithril-signer -vvv
Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target
Block producer
sudo systemctl daemon-reload
sudo systemctl enable --now mithril-signer
journalctl -fu mithril-signer

Check The log shows the signer registering with the aggregator; after two epochs your pool ID appears in the aggregator's list of signers (curl -s $AGGREGATOR_ENDPOINT/signers/registered/<epoch> from the relay).

V-7 Run a Midnight validator

A registered pool is the way in to Midnight's block production.

Midnight is a privacy-focused partner chain of Cardano; its blocks are produced by federated operators and by registered stake pools. The path: a Cardano node you already run, cardano-db-sync with PostgreSQL next to it, the Midnight node (Substrate, in a container) reading that database, and a registration signed with your cold key — on the air-gapped machine, like everything else that key signs.

Midnight's step-by-step guide for block producers on mainnet is not public yet; this guide will carry the commands once it is. Until then, the Midnight page under Resources keeps the current state and the links into Midnight's documentation.

V-8 Checklist

The habits that keep a pool safe.

  • Cold keys only offline, two tested encrypted backups
  • Block producer reachable only from your relays
  • SSH with keys only, another port, fail2ban on
  • Every download checked against its SHA-256
  • KES renewed before day 90 — reminder set
  • Pledge never below what you declared
  • A look at the five numbers every day
  • Releases installed, relays first, the block producer after a block
  • Votes cast, reward account delegated
  • Every change tried on the testnet first

That is the whole path.

Your pool runs on habits now: a look every day, KES before day 90, upgrades relays first, votes when they come.

Sources and license

Text, pictures and order are BRIAN's. Commands for system setup, the firewall, Mithril and the service file are adapted from the Cardano Developer Portal; every cardano-cli command was written for and run against cardano-cli 11.2.3. The node's own documentation always takes precedence.

Developer Portal license (MIT) — Copyright (c) 2021 Cardano Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.