Skip to content

Commit

Permalink
Update restake script
Browse files Browse the repository at this point in the history
  • Loading branch information
kj89 committed Sep 28, 2022
1 parent 7312952 commit 2573fc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teritori/tools/restake.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
for (( ;; )); do
echo -e "\033[0;32mCollecting rewards!\033[0m"
echo -e "${PASSWORD}\n" | teritorid tx distribution withdraw-rewards $TERITORI_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$TERITORI_CHAIN_ID --fees=250utori --yes
teritorid tx distribution withdraw-rewards $TERITORI_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$TERITORI_CHAIN_ID --fees=250utori --yes
echo -e "\033[0;32mWaiting 30 seconds before requesting balance\033[0m"
sleep 30
AMOUNT=$(teritorid query bank balances $TERITORI_WALLET_ADDRESS | grep amount | awk '{split($0,a,"\""); print a[2]}')
AMOUNT=$(($AMOUNT - 500))
AMOUNT_STRING=$AMOUNT"utori"
echo -e "Your total balance: \033[0;32m$AMOUNT_STRING\033[0m"
echo -e "${PASSWORD}\n" | teritorid tx staking delegate $TERITORI_VALOPER_ADDRESS $AMOUNT_STRING --from $WALLET --chain-id $TERITORI_CHAIN_ID --fees=250utori --yes
teritorid tx staking delegate $TERITORI_VALOPER_ADDRESS $AMOUNT_STRING --from $WALLET --chain-id $TERITORI_CHAIN_ID --fees=250utori --yes
echo -e "\033[0;32m$AMOUNT_STRING staked! Restarting in 3600 sec!\033[0m"
sleep 3600
done

0 comments on commit 2573fc3

Please sign in to comment.