Created
November 17, 2021 05:38
-
-
Save ahaxu/13bede862e2fcd306501962f97ef31c1 to your computer and use it in GitHub Desktop.
Cardano node - rotate KES key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check zip in xxx | |
# usage: | |
# ./rotate-kes.sh \ | |
# /path-to/kes.vkey \ | |
# /path-to/cold.skey \ | |
# /path-to/cold.counter | |
if [ -z "$1" ] | |
then | |
echo "Please provide kes.vkey" | |
exit 1 | |
fi | |
if [ -z "$2" ] | |
then | |
echo "Please provide cold.skey" | |
exit 1 | |
fi | |
if [ -z "$3" ] | |
then | |
echo "Please provide cold.counter" | |
exit 1 | |
fi | |
KES_VKEY=$1 | |
COLD_SKEY=$2 | |
COLD_COUNTER=$3 | |
SLOT_PER_KES=`cat mainnet-shelley-genesis.json | jq '.slotsPerKESPeriod'` | |
CURR_SLOT=`cardano-cli query tip --mainnet | jq '.slot'` | |
KES_PERIOD=$((CURR_SLOT/SLOT_PER_KES)) | |
echo "Current period $KES_PERIOD" | |
cardano-cli node issue-op-cert \ | |
--kes-verification-key-file $KES_VKEY \ | |
--cold-signing-key-file $COLD_SKEY\ | |
--operational-certificate-issue-counter $COLD_COUNTER \ | |
--kes-period $KES_PERIOD \ | |
--out-file node.cert | |
echo "Done!! Check your node.cert file" | |
echo "Remember to delete cold key files" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment