Skip to content

Instantly share code, notes, and snippets.

@kidinamoto01
Created September 19, 2018 06:58
Show Gist options
  • Save kidinamoto01/c824ec8a6c281c69c39a947de0112b86 to your computer and use it in GitHub Desktop.
Save kidinamoto01/c824ec8a6c281c69c39a947de0112b86 to your computer and use it in GitHub Desktop.
#!/bin/bash
current_proposal=$(gaiacli gov query-proposals --status VotingPeriod | tail -n 1 | cut -d'-' -f1)
known_proposal=$current_proposal
while true
do
current_proposal=$(gaiacli gov query-proposals --status VotingPeriod | tail -n 1 | cut -d'-' -f1)
if [ "$current_proposal" != "$known_proposal" ]
then
echo ""
echo $(date +"%Y%m%d-%H:%M:%S") " New Proposal $current_proposal"
echo "Voting Yes on your behalf, since this is only testnet."
proposal_id=${current_proposal//[[:blank:]]/}
#echo $passphrase|gaiacli gov vote --proposal-id=$proposal_id --option=Yes --from=iris --chain-id=gaia-8001
echo "Got Vote" $proposal_id | sendmail suyu@bianjie.ai
known_proposal=$current_proposal
else
echo -n "."
fi
sleep 11s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment