Difference between revisions of "Set up a Cardano staking pool"

From Organic Design wiki
(Staking from a paper wallet: Register a Stake Pool with Metadata docs)
(Staking from a paper wallet: all stages)
Line 28: Line 28:
 
</source>
 
</source>
  
The syntax for a normal delegation transaction is:
+
Create a delegation certificate, here the pool is the characters after the 5820 in the ''cborHex'' of the target pool's ''cold.vkey'' file.
 
<source lang="bash">
 
<source lang="bash">
cardano-cli shelley stake-address delegate \
+
cardano-cli shelley stake-address delegation-certificate \
--signing-key-file payment.skey \
+
--stake-verification-key-file payment.vkey \
--pool-id {!POOL!} \
+
--cold-verification-key-hash {!POOL!} \
--delegation-fee {!LOVELACE!} \
+
--out-file delegation.cert \
 
--host-addr 127.0.0.1 \
 
--host-addr 127.0.0.1 \
 
--port {!PORT!}
 
--port {!PORT!}
 +
</source>
 +
 +
 +
Draft the transaction:
 +
<source lang="bash">
 +
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
 +
</source>
 +
 +
 +
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
 +
</source>
 +
 +
 +
Build the transaction:
 +
<source lang="bash">
 +
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
 +
</source>
 +
 +
 +
Sign the transaction:
 +
<source lang="bash">
 +
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
 +
</source>
 +
 +
 +
Submit the transaction:
 +
<source lang="bash">
 +
cardano-cli shelley transaction submit --tx-file tx.signed --mainnet
 
</source>
 
</source>
  
 
== See also ==
 
== See also ==
 
*[[Set up a Cardano ITN staking pool]]
 
*[[Set up a Cardano ITN staking pool]]

Revision as of 05:10, 1 August 2020

Cone.png This article or section is a stub. Stubs are articles that have not yet received substantial attention from the authors. They are short or insufficient pieces of information and require additions to further increase the article's usefulness. The project values stubs as useful first steps toward complete articles.


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.

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 Key Evolving Signature and KES period section is redundant because it is done already in the Generate your stake pool keys section, but it is explained better in the later one.

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. I think there is sufficient information to figure this out from the Register a Stake Pool with Metadata section of the stake pool setup documentation which involves a similar thing.

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

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 payment.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 </source>


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

See also