Skip to content

Instantly share code, notes, and snippets.

@bneiluj
Forked from nckrtl/auto-delegate.sh
Last active December 4, 2018 22:19
Show Gist options
  • Save bneiluj/38c1d2f0c05e3e9d33889f20e5d3637a to your computer and use it in GitHub Desktop.
Save bneiluj/38c1d2f0c05e3e9d33889f20e5d3637a to your computer and use it in GitHub Desktop.
Auto delegate
echo "Enter your key password:"
read -s password
while true
do
amount_steak=$(gaiacli query account <comosaddr> --chain-id=9002 --trust-node=true | jq -r '.value.coins[0].amount')
if [[ $amount_steak > 0 && $amount_steak != "null" ]]; then
echo "About to stake ${amount_steak} steak"
echo "${password}" | gaiacli tx delegate --amount=${amount_steak}steak --from=crytter --validator=<cosmosvaloper> --chain-id=gaia-9001
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment