Script for automatically unregistering a block producer when it stops producing
- cleos
- jq
- Create key for the watchdog permissions:
cleos create key
Private key: YOUR_PRIVATE_KEY
Public key: YOUR_PUBLIC_KEY
- Grant watchdog permissions
PRODUCERACCT=yourbp
cleos set account permission $PRODUCERACCT watchdog '{"threshold":1,"keys":[{"key":"YOUR_PUBLIC_KEY","weight":1}]}' "active" -p $PRODUCERACCT@active
cleos set action permission $PRODUCERACCT eosio unregprod watchdog
- Create wallet for the watchdog permissions
cleos wallet create -n watchdog
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PWyourpasswordyourpasswordyourpasswordyourpassword"
- Import key for the watchdog permissions
cleos wallet import YOUR_PRIVATE_KEY -n watchdog
- Modify the PRODUCERACCT and PASS variables inside
watchdog.sh
./watchdog.sh yourbp PWyourpasswordyourpasswordyourpasswordyourpassword