Skip to content

Instantly share code, notes, and snippets.

@gotjoshua
Created February 11, 2021 14:12
Show Gist options
  • Save gotjoshua/d754913f2a8a2c38eed666331ebef241 to your computer and use it in GitHub Desktop.
Save gotjoshua/d754913f2a8a2c38eed666331ebef241 to your computer and use it in GitHub Desktop.
fill cosmos wallets with sequential names and create when needed
#!/bin/bash
#
# usage tasks.sh START END NewAdressesPrefix SendingKeyName
read -e -s -p "Keyring pass?" PP
START=${1:-0}
END=${2:-380}
RANGE=$(eval echo {$START..$END})
PREFIX=${3:-begreenXtra}
SENDER=${4:-begreen}
for i in $RANGE; do
whichWallet="${PREFIX}${i}"
echo $whichWallet
eachAddress=$(echo $PP | regen keys show $whichWallet -a) 2> /dev/null
[ $eachAddress ] || echo $PP | regen keys add $whichWallet && eachAddress=$(echo $PP | regen keys show $whichWallet -a)
sendCmd="regen tx bank send $SENDER $eachAddress 100000utree --chain-id aplikigo-1 --node http://161.35.51.84:26657 --memo $whichWallet --gas-prices 0.025utree -y"
echo $sendCmd
echo $PP | $sendCmd
echo "--------------------"
echo
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment