cardano course
  • Welcome!
  • Video lessons
  • Handbook
    • Module 1. Building and running the node
      • Building the node
      • Running the node and connecting to a network
    • Module 2. Basic operations
      • Creating keys and addresses
      • Creating a simple transaction
      • Registering the stake address and delegating
    • Module 3. Protocol parameters and configuration files
      • Protocol parameters
      • Byron genesis file
      • Shelley genesis file
      • Alonzo genesis file
      • Conway genesis file
      • Node configuration file
      • Topology file
    • Module 4. Peer-to-peer (P2P) networking
    • Module 5. Creating a stake pool
      • The setup
      • Generating keys
      • Registering a stake pool
      • Runtime system options
      • Running the nodes
      • Stake snapshots
      • Upgrading cardano-node and cardano-cli
      • Pool operations and maintenance
      • Retiring a stake pool
    • Module 6. Monitoring the nodes
    • Module 7. Cardano governance
      • Update proposals
      • Polls
    • Module 8. Setting up a local cluster
      • Creating a local cluster
      • Spending the genesis UTXO
      • From Byron to Shelley
      • Moving funds to a Shelley address
      • Creating a first stake pool
      • Bringing decentralization parameter down to .80
      • From Shelley to Alonzo
      • Creating a second stake pool before moving to the Babbage era
      • Redelegating genesis keys
      • Vasil hard fork
      • Creating a local cluster with the mkfiles script
    • Module 9. Simple scripts and Plutus scripts
    • Module 10. New tracing system
    • Module 11. Running the SMASH server
    • Module 12. Running the token metadata server
  • Curated playlist
Powered by GitBook
On this page
  • Register the stake address
  • Register a stake pool with metadata
  • Generate a stake pool registration certificate
  • Create the registration certificate:
  • Create the delegation certificate to honor the pledge:
  • Submit certificates:
  • Get delegation funds from the testnet faucet
  • Issue an operational certificate

Was this helpful?

Edit on GitHub
  1. Handbook
  2. Module 5. Creating a stake pool

Registering a stake pool

PreviousGenerating keysNextRuntime system options

Last updated 1 year ago

Was this helpful?

cardano-cli stake-address registration-certificate \
--stake-verification-key-file stake.vkey \
--out-file registration.cert
cardano-cli transaction build \
--testnet-magic 2 \
--witness-override 2 \
--tx-in $(cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 2 --out-file  /dev/stdout | jq -r 'keys[0]') \
--change-address $(cat payment.addr) \
--certificate-file registration.cert \
--out-file tx.raw
cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
--signing-key-file stake.skey \
--testnet-magic 2 \
--out-file tx.signed
cardano-cli transaction submit \
--testnet-magic 2 \
--tx-file tx.signed 

The stake pool registration certificate optionally contains a content hash and a URL (up to 64 bytes).

  • JSON containing:

    • Name of up to 50 characters

    • Description of up to 255 characters

    • Ticker of 3-5 characters

    • Homepage with additional information about the pool

  • All characters in the metadata will be UTF8 encoded

  • No more than 512 bytes

  {
  "name": "TestPool",
  "description": "The pool that tests all the pools",
  "ticker": "TEST",
  "homepage": "https://teststakepool.com"
  }

To get the metadata hash, run:

wget https://880w.short.gy/clrsp.json
cardano-cli stake-pool metadata-hash --pool-metadata-file clrsp.json
3c914463aa1cddb425fba48b21c4db31958ea7a30e077f756a82903f30e04905

Create the registration certificate:

cardano-cli stake-pool registration-certificate \
--cold-verification-key-file cold.vkey \
--vrf-verification-key-file vrf.vkey \
--pool-pledge 9000000000 \
--pool-cost 340000000 \
--pool-margin .05 \
--pool-reward-account-verification-key-file stake.vkey \
--pool-owner-stake-verification-key-file stake.vkey \
--testnet-magic 2 \
--pool-relay-ipv4 <RELAY NODE PUBLIC IP> \
--pool-relay-port <RELAY NODE PORT> \
--metadata-url https://git.io/JJWdJ \
--metadata-hash <POOL METADATA HASH> \
--out-file pool-registration.cert

Create the delegation certificate to honor the pledge:

cardano-cli stake-address delegation-certificate \
--stake-verification-key-file stake.vkey \
--cold-verification-key-file cold.vkey \
--out-file delegation.cert

Submit certificates:

cardano-cli transaction build \
--testnet-magic 2 \
--witness-override 3 \
--tx-in $(cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 2 --out-file  /dev/stdout | jq -r 'keys[1]') \
--change-address $(cat payment.addr) \
--certificate-file pool-registration.cert \
--certificate-file delegation.cert \
--out-file tx.raw
cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
--signing-key-file cold.skey \
--signing-key-file stake.skey \
--testnet-magic 2 \
--out-file tx.signed
cardano-cli transaction submit \
--testnet-magic 2 \
--tx-file tx.signed 

The faucet only takes the Bech32 pool ID:

cardano-cli stake-pool id \
--cold-verification-key-file cold.vkey \
--output-format bech32

Calculate the current KES period.

There are 129600 slots in a KES period:

cat shelley-genesis.json | grep KES
"slotsPerKESPeriod": 129600,
"maxKESEvolutions": 62,

The current slot can be obtained using a query tip:

cardano-cli query tip --testnet-magic 2 

>
{
    "block": 552276,
    "epoch": 143,
    "era": "Babbage",
    "hash": "fe9c9b4b3f70262f60183bf0d8e72077c559345b22b47d4d4af91d4e5a4b5994",
    "slot": 12380321,
    "syncProgress": "100.00"
}

Divide:

echo $((12380321 / 129600))

Or in one line:

echo $(($(cardano-cli query tip --testnet-magic 2 | jq .slot) / 129600))

On the air-gapped machine, run:

cardano-cli node issue-op-cert --kes-verification-key-file kes.vkey \
--cold-signing-key-file cold.skey \
--operational-certificate-issue-counter-file opcert.counter \
--kes-period <current kes period> \
--out-file opcert.cert

Register a

For example:

Register the stake address
stake pool with metadata
https://880w.short.gy/clrsp.json
Generate a stake pool registration certificate
Get delegation funds from the testnet faucet
Issue an operational certificate