Martian Forest 火星森林

A person who write semi-technical stuff, and some funny stuff

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"


希望對大家有幫助。也歡迎指正。

喜歡我的文章嗎?
別忘了給點支持與讚賞,讓我知道創作的路上有你陪伴。

CC BY-NC-ND 2.0 版權聲明

看不過癮?

一鍵登入,即可加入全球最優質中文創作社區