Created
May 15, 2020 14:25
-
-
Save c29r3/35bf791aa12c64560c518f3560da24ca to your computer and use it in GitHub Desktop.
Automatic collection of awards and delegation in Akash Network
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
#!/bin/bash | |
SELF_ADDR="akash..." | |
OPERATOR="akashvaloper..." | |
WALLET_NAME="teamname" | |
WALLET_PWD="pwd" | |
BIN_FILE="/root/go/bin/akashctl" | |
# withdraw reward | |
echo -e "$WALLET_PWD\n$WALLET_PWD\n" | $BIN_FILE tx distribution withdraw-rewards $OPERATOR --commission --chain-id centauri --from $WALLET_NAME -y | |
sleep 5 | |
# check current balance | |
BALANCE=$($BIN_FILE query account $SELF_ADDR -o json | jq .value.coins[0].amount | tr -d '"') | |
echo CURRENT BALANCE IS: $BALANCE | |
if (( $BALANCE >= 2 ));then | |
echo "Let's delegate $REWARD of REWARD tokens to $SELF_ADDR" | |
# delegate balance | |
echo -e "$WALLET_PWD\n$WALLET_PWD\n" | $BIN_FILE tx staking delegate $OPERATOR "$REWARD"uakt --chain-id centauri --from $WALLET_NAME -y | |
else | |
echo "Reward is $REWARD" | |
fi | |
echo "DONE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment