Linux Script 小工具协助LikeCoin投票和转账
管理LikeCoin 的validator node 經常要使用docker-compose 命令行處理投票,轉賬等等操作,以前把命令行寫到Dcoument裏面然後每次用就copy and paste, 最近弄了幾個Linux script 幫助減省一些命令的時間。
包括了幾個script :
vote.sh:
source ~/.param_set
what="yes"
# Can be yes/no/no_with_veto/abstain
no="24"
cd ${homedir}
read -p 'Proposal number (just the value): ' no
read -p 'Your choice (yes/no/no_with_veto/abstain): ' what
echo "Vote ${what} for proposal ${no}"
read -p 'Confirm (y for yes. Or press Ctrl-C to stop the operation: ' confirmation
if [ "$confirmation" == "y" ]; then
echo docker-compose run --rm liked-command tx gov vote ${no} ${what} --from validator --fees 2000nanolike --node tcp://liked-service:26657 --chain-id likecoin-mainnet-2
docker-compose run --rm liked-command tx gov vote ${no} ${what} --from validator --fees 20000nanolike --node tcp://liked-service:26657 --chain-id likecoin-mainnet-2
else
echo "User aborted operation."
fi
.param_set.sh 脚本:
export homedir="/data/likecoin-chain"
# For Martian Forest
export validator="cosmosvaloper1vvrs543rz0204zhzcgtjtc2mz73y60rk8t92cw"
export wallet="cosmos1vvrs543rz0204zhzcgtjtc2mz73y60rkzl3l5a"
希望對大家有幫助。也歡迎指正。
喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!
- 来自作者
- 相关推荐