Skip to content

Instantly share code, notes, and snippets.

@novy4
Created May 13, 2020 21:31
Show Gist options
  • Save novy4/fe4e2f86c96530f259e473c147e1bdf6 to your computer and use it in GitHub Desktop.
Save novy4/fe4e2f86c96530f259e473c147e1bdf6 to your computer and use it in GitHub Desktop.
#!/bin/bash
WALLET_PASS=$1
AKASH_PATH='/usr/local/bin'
WALLET=$(echo -e "$WALLET_PASS\n" | $AKASH_PATH/akashctl keys list -n)
while true; do
POWER=$($AKASH_PATH/akashctl status | jq -r '.[] | .voting_power' | tail -1 | sed -e 's/^"//' -e 's/"$//')
echo 'WE HAVE POWER' $POWER
if [ $POWER = 0 ]; then
echo 'UNJAILING'
echo -e "$WALLET_PASS\n$WALLET_PASS\n" | $AKASH_PATH/akashctl tx slashing unjail --from $WALLET --gas=auto --yes
fi
echo 'NEXT CHECK IN 15 SEC'
sleep 15
done
@anilcse
Copy link

anilcse commented May 15, 2020

Have a condition to check if the validator is jailed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment