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

Was this helpful?

Edit on GitHub
  1. Handbook
  2. Module 8. Setting up a local cluster

Redelegating genesis keys

In a real-life scenario, a holder of a genesis key may wish to delegate to a new key.

Generate a new (Shelley era) delegation key pair:

cardano-cli genesis key-gen-delegate \
--verification-key-file delegate-keys/new.shelley.delegate.000.vkey \
--signing-key-file delegate-keys/new.shelley.delegate.000.skey \
--operational-certificate-issue-counter-file delegate-keys/new.shelley.delegate.000.certificate.counter

Issue a new delegation certificate for genesis key 000:

cardano-cli governance create-genesis-key-delegation-certificate \
--genesis-verification-key-file genesis-keys/non.e.shelley.000.vkey \
--genesis-delegate-verification-key-file delegate-keys/new.shelley.delegate.000.vkey \
--vrf-verification-key-file bft0/shelley.000.vrf.vkey \
--out-file genesis-keys/genesis.delegation.cert

Submit the certificate in a transaction. It must be signed with the genesis key:

cardano-cli query utxo --address $(cat utxo-keys/user1.payment.addr) --testnet-magic 42
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
7a7226867b8ea7eee300465cc59ec1303bc386a524048a77f6cea9f897431fad     1        29899999997665742 lovelace + TxOutDatumNon
CHANGE=$((29899999997665742 - 1000000))
cardano-cli transaction build-raw \
--alonzo-era \
--fee 1000000 \
--tx-in $(cardano-cli query utxo --address $(cat utxo-keys/user1.payment.addr) --testnet-magic 42 --out-file  /dev/stdout | jq -r 'keys[]') \
--tx-out $(cat utxo-keys/user1.payment.addr)+$CHANGE \
--certificate-file genesis-keys/genesis.delegation.cert \
--out-file transactions/tx9.raw
cardano-cli transaction sign \
--tx-body-file transactions/tx9.raw \
--signing-key-file utxo-keys/user1.payment.skey \
--signing-key-file genesis-keys/shelley.000.skey \
--out-file transactions/tx9.signed
cardano-cli transaction submit \
--testnet-magic 42 \
--tx-file transactions/tx9.signed
PreviousCreating a second stake pool before moving to the Babbage eraNextVasil hard fork

Last updated 1 year ago

Was this helpful?

Page cover image