-
Notifications
You must be signed in to change notification settings - Fork 160
Rotating the genesis delegates
Jean-Baptiste Giraudeau edited this page Sep 3, 2020
·
2 revisions
KEY=<N>
ADDR=<to pay fees>
ADDR_SKEY=<path to addr key>
FEE=172937 #see
TTL=1459580
CURRENT_KES_PERIOD=10
for f in keys/delegate-keys/delegate$KEY.{skey,vkey,counter}; do
mv "$f" "$f.old"
done
cardano-cli shelley genesis key-gen-delegate \
--signing-key-file keys/delegate-keys/delegate$KEY.skey \
--verification-key-file keys/delegate-keys/delegate$KEY.vkey \
--operational-certificate-issue-counter-file keys/delegate-keys/delegate$KEY.counter
cardano-cli shelley governance create-genesis-key-delegation-certificate \
--genesis-delegate-verification-key-file keys/delegate-keys/delegate$KEY.vkey \
--genesis-verification-key-file keys/genesis-keys/genesis$KEY.vkey \
--vrf-verification-key-file keys/delegate-keys/delegate$KEY.vrf.vkey \
--out-file delegate$KEY-key-rotate.cert
ADDR_AMMOUNT=$(cardano-cli shelley query utxo --address $ADDR --mainnet | awk '{if(NR==3) print $3}')
UTXO=$(cardano-cli shelley query utxo --address $ADDR --mainnet | awk '{if(NR==3) print $1 "#" $2}')
cardano-cli shelley transaction build-raw --ttl $TTL --fee $FEE \
--certificate-file delegate$KEY-key-rotate.cert \
--tx-in $UTXO --tx-out $ADDR+$(($ADDR_AMMOUNT-$FEE))
--out-file delegate$KEY-key-rotate.tx
cardano-cli shelley transaction sign \
--tx-body-file delegate$KEY-key-rotate.tx \
--signing-key-file keys/genesis-keys/genesis$KEY.skey \
--signing-key-file $ADDR_SKEY \
--out-file delegate$KEY-key-rotate.tx
cardano-cli shelley transaction submit --mainnet --tx-file delegate$KEY-key-rotate.tx.signed
The new keys will be effective after the stabilityWindow
(3k/f slots) elapsed.
mv keys/delegation-cert.00$KEY.json keys/delegation-cert.00$KEY.json.bak
mv keys/delegation-cert.00$KEY.json keys/delegation-cert.00$KEY.json.bak
cardano-cli shelley node key-gen-KES \
--verification-key-file keys/node-keys/node-kes$KEY.vkey \
--signing-key-file keys/node-keys/node-kes$KEY.skey
cardano-cli shelley node issue-op-cert \
--hot-kes-verification-key-file keys/node-keys/node-kes$KEY.vkey \
--cold-signing-key-file keys/delegate-keys/delegate$KEY.skey \
--operational-certificate-issue-counter keys/delegate-keys/delegate$KEY.counter \
--kes-period $CURRENT_KES_PERIOD \
--out-file keys/node-keys/node$KEY.opcert
# (or use new-KES-keys-at-period $CURRENT_KES_PERIOD)
eg.
nixops deploy bft-a-1