Set up a Cardano staking pool
The official documentation for setting up a node and configuring it as a stake pool on the mainnet is mostly very clear and complete. I was able to get my node compiled, installed and running pretty easily. But configuring the node to run as a stake pool is more complicated and the documentation seems to have some missing bits, so I'm documenting here just the specific parts that I had trouble with.
You will need to have two servers and one offline machine, all running the node, so the first part of the procedure for compiling, installing and running is done on all three of the machines.
Everything went smoothly until I got to Register stake address on the blockchain. The main issue is that you need to have some balance in your payment.addr address, and the previous step of creating a sample transaction is not optional, things in that step such as protocol.json and the output hash are referred to in this step.
The Configure topology files for block-producing and relay nodes section requires that we have a relay node IP address.
Staking from a paper wallet
todo... I'll document this properly after I've done it myself
The idea is to first temporarily install a Daedalus on an offline live booted Linux and then restore a paper wallet into it with the 24 word backup phrase. Then we should be able to interact with the running wallet's associated node from the CLI to create and sign a delegation transaction. That transaction can then be broadcast to the network using any online Cardano node. This Shelley exercise explains the process of CLI delegation.
First you'll need to find the port that your Daedalus is running on:
ps x | grep cardano-node
Then you'll need to create the key files:
cardano-cli shelley address key-gen \ --verification-key-file payment.vkey \ --signing-key-file payment.skey \ --host-addr 127.0.0.1 \ --port PORT
Todo: We need to use a registered stake address that we have the keys for.
Create a delegation certificate, here the pool is the characters after the 5820 in the cborHex of the target pool's cold.vkey file.
cardano-cli shelley stake-address delegation-certificate \ --stake-verification-key-file stake.vkey \ --cold-verification-key-hash POOL \ --out-file delegation.cert \ --host-addr 127.0.0.1 \ --port PORT
Draft the transaction:
cardano-cli shelley transaction build-raw \ --tx-in <UTXO>#<TxIx> \ --tx-out $(cat payment.addr)+0 \ --ttl 0 \ --fee 0 \ --out-file tx.draft \ --certificate-file delegation.cert
Calculate the fees:
cardano-cli shelley transaction calculate-min-fee \ --tx-body-file tx.draft \ --tx-in-count 1 \ --tx-out-count 1 \ --mainnet \ --witness-count 1 \ --byron-witness-count 0 \ --protocol-params-file protocol.json
Build the transaction:
cardano-cli shelley transaction build-raw \ --tx-in <UTXO>#<TxIx> \ --tx-out $(cat payment.addr)+<CHANGE IN LOVELACE> \ --ttl <TTL> \ --fee <FEE> \ --out-file tx.raw \ --certificate-file pool-registration.cert \ --certificate-file delegation.cert
Sign the transaction:
cardano-cli shelley 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
Submit the transaction:
cardano-cli shelley transaction submit --tx-file tx.signed --mainnet