-
-
Save gbuchukuri/70065cdb5e94e1e91e35d38da725c485 to your computer and use it in GitHub Desktop.
Script that withdraws commission and reward from the Regen network account and auto-delegates these tokens to the validator every 3 hours
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
echo "Enter your key password:" | |
read -s password | |
while true | |
do | |
echo "About to withdraw commission and reward" | |
echo "${password}" | defundd tx distribution withdraw-all-rewards --from w1 --gas auto -y | |
sleep 20 | |
amount=$(defundd q bank balances defund1sq70esujl9swtjrk9hxts990uwgxgavk2lyfpv | |
if [[ $amount > 0 && $amount != "null" ]]; then | |
echo "About to stake ${amount} ufetfs" | |
echo "${password}" | defundd tx staking delegate defundvaloper1sq70esujl9swtjrk9hxts990uwgxgavkrhld8w ${amount}ufetf --from w1 --gas auto -y | |
fi | |
sleep 120 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment