From a5b502b7b26fabe36455a3b4ff41badad1b35a58 Mon Sep 17 00:00:00 2001 From: PrathyushaLakkireddy Date: Wed, 25 Aug 2021 11:48:28 +0530 Subject: [PATCH 1/2] Add proposal vote instructions --- proposal-vote-script/Instructions.md | 46 ++++++++++++++++++++++++ proposal-vote-script/example.config.toml | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 proposal-vote-script/Instructions.md diff --git a/proposal-vote-script/Instructions.md b/proposal-vote-script/Instructions.md new file mode 100644 index 0000000..696dd5a --- /dev/null +++ b/proposal-vote-script/Instructions.md @@ -0,0 +1,46 @@ +# proposal-vote-script + +This script will help you to vote for the proposal if it's not voted already. +You just have to do clone the repo, configure the `config.toml` and run the the script. + +Clone the repo +```sh +git clone https://github.com/vitwit/cosmos-utils.git + +cd cosmos-utils/proposal-vote-script +``` + +#### Configure the config.toml + +```sh +cp example.config.toml config.toml +``` +and replace these values with your validator details. + +- *rpc_endpoint* + + RPC endpoint of your validator. + +- *lcd_endpoint* + + LCD endpoint of your validator, which will be used to get proposals info and votes of it. + +- *deamon* + + Deamon name of the network (ex: regen, akash). This will be used to execute the vote tx command. + +- *key_name* + + Key name of your validator. Name of the account from which you want to vote. + +- *account_address* + + Account address of your validator. This address will be used to get your votes for particular proposal. + +- *chain_id* + + Chain ID of your node. + +- *fees* + + Fees to execute the tx. \ No newline at end of file diff --git a/proposal-vote-script/example.config.toml b/proposal-vote-script/example.config.toml index e07b4db..76747fc 100644 --- a/proposal-vote-script/example.config.toml +++ b/proposal-vote-script/example.config.toml @@ -7,4 +7,4 @@ chain_id = "test" fees = "5000uregen" [scraper] - rate = "4s" \ No newline at end of file +rate = "4s" From a4cfddbc1bfc106acaafa43bf3914dd108d27c53 Mon Sep 17 00:00:00 2001 From: PrathyushaLakkireddy Date: Wed, 25 Aug 2021 12:12:38 +0530 Subject: [PATCH 2/2] Update instrcution docs --- proposal-vote-script/Instructions.md | 20 ++++++++++++++------ proposal-vote-script/config/config.go | 1 - proposal-vote-script/example.config.toml | 1 - 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/proposal-vote-script/Instructions.md b/proposal-vote-script/Instructions.md index 696dd5a..704f2bd 100644 --- a/proposal-vote-script/Instructions.md +++ b/proposal-vote-script/Instructions.md @@ -1,7 +1,7 @@ # proposal-vote-script This script will help you to vote for the proposal if it's not voted already. -You just have to do clone the repo, configure the `config.toml` and run the the script. +You just have to clone the repo, configure the `config.toml` and run the the script. Clone the repo ```sh @@ -17,10 +17,6 @@ cp example.config.toml config.toml ``` and replace these values with your validator details. -- *rpc_endpoint* - - RPC endpoint of your validator. - - *lcd_endpoint* LCD endpoint of your validator, which will be used to get proposals info and votes of it. @@ -43,4 +39,16 @@ and replace these values with your validator details. - *fees* - Fees to execute the tx. \ No newline at end of file + Fees to execute the tx. + +#### Run the script + +- Build and run the using binary + +```sh +go build -o proposal-script && ./proposal-script +``` +- or run +```sh +go run main.go +``` \ No newline at end of file diff --git a/proposal-vote-script/config/config.go b/proposal-vote-script/config/config.go index 1c452e6..8b58cf6 100644 --- a/proposal-vote-script/config/config.go +++ b/proposal-vote-script/config/config.go @@ -13,7 +13,6 @@ type ( } // Config Config struct { - RPCEndpoint string `mapstructure:"rpc_endpoint"` LCDEndpoint string `mapstructure:"lcd_endpoint"` Deamon string `mapstructure:"deamon"` KeyName string `mapstructure:"key_name"` diff --git a/proposal-vote-script/example.config.toml b/proposal-vote-script/example.config.toml index 76747fc..2b50980 100644 --- a/proposal-vote-script/example.config.toml +++ b/proposal-vote-script/example.config.toml @@ -1,4 +1,3 @@ -rpc_endpoint = "http://localhost:26657" lcd_endpoint = "http://localhost:1317" deamon = "regen" key_name = "validator"