From 151747bc8111399c0978935dec045901f4e2cb10 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Mon, 25 Oct 2021 18:35:59 +0530 Subject: [PATCH 1/5] docs: add testnet docs --- testnet/README.md | 7 ++ testnet/full-node.md | 174 +++++++++++++++++++++++++ testnet/genesis-validators.md | 230 ++++++++++++++++++++++++++++++++++ testnet/multinode_testnet.sh | 203 ++++++++++++++++++++++++++++++ testnet/validator-node.md | 51 ++++++++ 5 files changed, 665 insertions(+) create mode 100644 testnet/README.md create mode 100644 testnet/full-node.md create mode 100644 testnet/genesis-validators.md create mode 100644 testnet/multinode_testnet.sh create mode 100644 testnet/validator-node.md diff --git a/testnet/README.md b/testnet/README.md new file mode 100644 index 00000000..a57b6894 --- /dev/null +++ b/testnet/README.md @@ -0,0 +1,7 @@ +# Testnet + +## Setup Local ethermint multi node + +```shell +$ bash multinode_testnet.sh +``` diff --git a/testnet/full-node.md b/testnet/full-node.md new file mode 100644 index 00000000..edbfdd29 --- /dev/null +++ b/testnet/full-node.md @@ -0,0 +1,174 @@ +# Instructions to Run Full Node + +Hardware +--- + +#### Supported + +- **Operating System (OS):** Ubuntu 20.04 +- **CPU:** 1 core +- **RAM:** 2GB +- **Storage:** 25GB SSD + +#### Recommended + +- **Operating System (OS):** Ubuntu 20.04 +- **CPU:** 2 core +- **RAM:** 4GB +- **Storage:** 50GB SSD + +# A) Setup + +## 1) Install Golang (go) + +1.1) Remove any existing installation of `go` + +``` +sudo rm -rf /usr/local/go +``` + +1.2) Install latest/required Go version (installing `go1.16.7`) + +``` +curl https://dl.google.com/go/go1.16.7.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - +``` + +1.3) Update env variables to include `go` + +``` +cat <<'EOF' >>$HOME/.profile +export GOROOT=/usr/local/go +export GOPATH=$HOME/go +export GO111MODULE=on +export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin +EOF + +source $HOME/.profile +``` + +1.4) Check the version of go installed + +``` +go version +``` + +### 2) Install required software packages + +``` +sudo apt-get install git curl build-essential make jq -y +``` + +### 3) Install `ethermint` + +``` +git clone https://github.com/vulcanize/ethermint.git +cd ethermint +git fetch --all +git checkout v0.1.0-dev +make install +``` + +### 4) Verify your installation + +``` +ethermintd version --long +``` + +On running the above command, you should see a similar response like this. Make sure that the *version* and *commit +hash* are accurate + +``` +name: ethermint +server_name: ethermintd +``` + +### 5) Initialize Node + +**Not required if you have already initialized before** + +``` +ethermintd init --chain-id ethermint_9000-1 +``` + +On running the above command, node will be initialized with default configuration. (config files will be saved in node's +default home directory (~/.ethermintd/config) + +NOTE: Backup node and validator keys . You will need to use these keys at a later point in time. + +--- + +**Execute below instructions only after publishing of final genesis file** + +genesis file will be published to [vulcanize//testnets/ethermint_9000-1](https://github.com/vulcanize/testnets) + +# B) Starting Node + +TBU + +``` + +## 3) Start the Node + +#### 3.1) Start node as `systemctl` service + +3.1.1) Create the service file + +``` + +sudo tee /etc/systemd/system/ethermintd.service > /dev/null <>$HOME/.profile +export GOROOT=/usr/local/go +export GOPATH=$HOME/go +export GO111MODULE=on +export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin +EOF + +source $HOME/.profile +``` + +1.4) Check the version of go installed + +``` +go version +``` + +### 2) Install required software packages + +``` +sudo apt-get install git curl build-essential make jq -y +``` + +### 3) Install `ethermint` + +``` +git clone https://github.com/vulcanize/ethermint.git +cd ethermint +git fetch --all +git checkout v0.1.0-dev +make install +``` + +### 4) Verify your installation + +``` +ethermintd version --long +``` + +On running the above command, you should see a similar response like this. Make sure that the *version* and *commit +hash* are accurate + +``` +name: ethermint +server_name: ethermintd +``` + +### 5) Initialize Node + +**Not required if you have already initialized before** + +``` +ethermintd init --chain-id ethermint_9000-1 +``` + +On running the above command, node will be initialized with default configuration. (config files will be saved in node's +default home directory (~/.ethermintd/config) + +NOTE: Backup node and validator keys . You will need to use these keys at a later point in time. + +--- + +## 6) Create Account keys + +if you have participated in previous testnet and have mnemonic phrase, use below command to recover your account + +``` +ethermintd keys add --recover +``` + +to create new account + +``` +ethermintd keys add +``` + +NOTE: Save `mnemonic` and related account details (public key). You will need to use the need mnemonic/private key to +recover accounts at a later point in time. + +## 7) Add Genesis Account + +``` +ethermintd add-genesis-account 50000000uwire +``` + +## 8) Create Your `gentx` + +``` +ethermintd gentx 50000000uwire \ + --pubkey=$(ethermintd tendermint show-validator) \ + --chain-id="ethermint_9000-1" \ + --moniker="my-moniker" \ + --website="https://yourweb.site" \ + --details="description of my validator" \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --min-self-delegation="1" +``` + +Note: + +- `` and `chain-id` are required. other flags are optional +- Don't change amount value while creating your gentx +- Genesis transaction file will be saved in `~/.ethermintd/config/gentx` folder + +## 9) Submit Your gentx + +Submit your `gentx` file to the [testnets]() in the format of +`-gentx.json` + +NOTE: (Do NOT use space in the file name) + +To submit the gentx file, follow the below process: + +- Fork the [testnets]() repository +- Upload your gentx file in `ethermint_9000-1/gentxs` folder +- Submit Pull Request to [testnets]() with name `ADD gentx` + +--- + +**Execute below instructions only after publishing of final genesis file** + +genesis file will be published to [testnets/ethermint_9000-1]() + +# B) Starting the validator + +TBU + +## 3) Start the Node + +#### 3.1) Start node as `systemctl` service + +3.1.1) Create the service file Note: this step is not required if you did setup before + +``` +sudo tee /etc/systemd/system/ethermintd.service > /dev/null <$DAEMON_HOME_1.log & +sleep 5s +echo "Checking $DAEMON_HOME_1 chain status" +$DAEMON status --node tcp://localhost:16657 + +nohup $(which $DAEMON) start --gql-playground --gql-server --home $DAEMON_HOME_2 >$DAEMON_HOME_2.log & +sleep 5s +echo "Checking $DAEMON_HOME_2 chain status" +$DAEMON status --node tcp://localhost:26657 + +nohup $(which $DAEMON) start --gql-playground --gql-server --home $DAEMON_HOME_3 >$DAEMON_HOME_3.log & +sleep 5s +echo "Checking $DAEMON_HOME_3 chain status" +$DAEMON status --node tcp://localhost:36657 + +nohup $(which $DAEMON) start --gql-playground --gql-server --home $DAEMON_HOME_4 >$DAEMON_HOME_4.log & +sleep 5s +echo "Checking $DAEMON_HOME_4 chain status" +$DAEMON status --node tcp://localhost:46657 diff --git a/testnet/validator-node.md b/testnet/validator-node.md new file mode 100644 index 00000000..8f5eb29f --- /dev/null +++ b/testnet/validator-node.md @@ -0,0 +1,51 @@ +### Create Validator Post Genesis + +1. Run Full Node +2. Create Account and Get test tokens +3. Create Validator + +### 1.Run Full Node + +- Check "[Run Full Node](full-node.md)" section to Run a Full Node + +### 2. Create Account & Get test tokens + +``` +ethermintd keys add +``` + +NOTE: Save `mnemonic` and related account details (public key). You will need to use the need mnemonic/private key to +recover accounts at a later point in time. + +##### Get Test tokens from faucet + +- TBU + +### 3.Create Validator + +- ##### Check full node sync status + + `ethermintd status 2>&1 | jq -r ".SyncInfo"` + + `catching_up: false` means node is completely synced +- ##### Create validator + +`Note:` Only execute below transaction after complete sync of your full node + +``` +ethermintd tx staking create-validator \ + --amount=1000000uwire \ + --pubkey=$(ethermintd tendermint show-validator) \ + --moniker="my-moniker" \ + --website="https://myweb.site" \ + --details="description of your validator" \ + --chain-id="flixnet-2" \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --min-self-delegation="1" \ + --gas="auto" \ + --gas-adjustment="1.2" \ + --gas-prices="0.025uwire" \ + --from= +``` From 3ef957206c97631f6b025527c4fd36cec70407e1 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 27 Oct 2021 11:50:32 +0530 Subject: [PATCH 2/5] docs: add golang install instructions --- testnet/multinode_testnet.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/testnet/multinode_testnet.sh b/testnet/multinode_testnet.sh index 73e9046e..e9f08af4 100644 --- a/testnet/multinode_testnet.sh +++ b/testnet/multinode_testnet.sh @@ -7,6 +7,35 @@ echo "Installing the require tools " sudo apt-get install git curl build-essential make nohup jq -y echo "Done Installing the tools" +command_exists() { + type "$1" &>/dev/null +} + +if command_exists go; then + echo "Golang is already installed" +else + echo "Installing golang dependencies" + wget https://golang.org/dl/go1.17.2.linux-amd64.tar.gz + rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz + + echo "Updating the profile" + export GOPATH=$HOME/go + export GOROOT=/usr/local/go + export GOBIN=$GOPATH/bin + export PATH=$PATH:/usr/local/go/bin:$GOBIN + + echo "" >>~/.profile + echo 'export GOPATH=$HOME/go' >>~/.profile + echo 'export GOROOT=/usr/local/go' >>~/.profile + echo 'export GOBIN=$GOPATH/bin' >>~/.profile + echo 'export PATH=$PATH:/usr/local/go/bin:$GOBIN' >>~/.profile + + source ~/.profile + mkdir -p "$GOBIN" + mkdir -p $GOPATH/src/github.com + go version +fi + # chain env variables export DAEMON_HOME=~/.testethermint export CHAINID=ethermint_9000-1 From d41612b8915e1cec59b76cbfd13b2efce55ddf75 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 27 Oct 2021 11:51:33 +0530 Subject: [PATCH 3/5] docs: updated testnet readme --- testnet/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testnet/README.md b/testnet/README.md index a57b6894..d44d02f7 100644 --- a/testnet/README.md +++ b/testnet/README.md @@ -1,6 +1,6 @@ # Testnet -## Setup Local ethermint multi node +## Setup local ethermint multi node testnet ```shell $ bash multinode_testnet.sh From 9794007231161d86faf1cd2df0ab084f4e294479 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 3 Nov 2021 12:34:12 +0530 Subject: [PATCH 4/5] docs: update the testnet docs --- testnet/full-node.md | 57 ++++++++++++++++++++++++++--------- testnet/genesis-validators.md | 15 ++++----- testnet/validator-node.md | 15 ++++++--- 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/testnet/full-node.md b/testnet/full-node.md index edbfdd29..d54b54e1 100644 --- a/testnet/full-node.md +++ b/testnet/full-node.md @@ -27,10 +27,11 @@ Hardware sudo rm -rf /usr/local/go ``` -1.2) Install latest/required Go version (installing `go1.16.7`) +1.2) Install latest/required Go version (installing `go1.17.2`) ``` -curl https://dl.google.com/go/go1.16.7.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - +curl https://golang.org/dl/go1.17.2.linux-amd64.tar.gz +sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz ``` 1.3) Update env variables to include `go` @@ -87,7 +88,7 @@ server_name: ethermintd **Not required if you have already initialized before** ``` -ethermintd init --chain-id ethermint_9000-1 +ethermintd init --chain-id ethermint_81337-1 ``` On running the above command, node will be initialized with default configuration. (config files will be saved in node's @@ -97,41 +98,67 @@ NOTE: Backup node and validator keys . You will need to use these keys at a late --- -**Execute below instructions only after publishing of final genesis file** - -genesis file will be published to [vulcanize//testnets/ethermint_9000-1](https://github.com/vulcanize/testnets) - # B) Starting Node -TBU +## 1) Download Final Genesis +Use `curl` to download the genesis file +**Replace your **genesis** file with published genesis file** + +```shell +curl http://167.172.173.94:26657/genesis > .ethermintd/config/genesis.json ``` -## 3) Start the Node +Verify sha256 hash of genesis file with the below command + +``` +jq -S -c -M '' ~/.ethermintd/config/genesis.json | shasum -a 256 +``` + +genesis sha256 hash should be + +``` +4e5b68b5652a608c44c33e669c84ac179d9c0e301f958b5448f037a53c5cbb4e +``` + +## 2) Update Peers & Seeds in config.toml + +``` +peers="5ad2e6c35f2c84ff3ee31d89a95b34d92cb6afb1@157.230.101.237:26656,defc95b08547b6ef254723ad9621967a7e819020@161.35.223.44:26656" +sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.ethermintd/config/config.toml +``` + +## 3) Start the Full Node #### 3.1) Start node as `systemctl` service 3.1.1) Create the service file ``` - sudo tee /etc/systemd/system/ethermintd.service > /dev/null < --chain-id ethermint_9000-1 +ethermintd init --chain-id ethermint_81337-1 ``` On running the above command, node will be initialized with default configuration. (config files will be saved in node's @@ -117,15 +118,15 @@ recover accounts at a later point in time. ## 7) Add Genesis Account ``` -ethermintd add-genesis-account 50000000uwire +ethermintd add-genesis-account 4500000000000000agnt ``` ## 8) Create Your `gentx` ``` -ethermintd gentx 50000000uwire \ +ethermintd gentx 4500000000000000agnt \ --pubkey=$(ethermintd tendermint show-validator) \ - --chain-id="ethermint_9000-1" \ + --chain-id="ethermint_81337-1" \ --moniker="my-moniker" \ --website="https://yourweb.site" \ --details="description of my validator" \ @@ -151,7 +152,7 @@ NOTE: (Do NOT use space in the file name) To submit the gentx file, follow the below process: - Fork the [testnets]() repository -- Upload your gentx file in `ethermint_9000-1/gentxs` folder +- Upload your gentx file in `ethermint_81337-1/config/gentxs` folder - Submit Pull Request to [testnets]() with name `ADD gentx` --- diff --git a/testnet/validator-node.md b/testnet/validator-node.md index 8f5eb29f..1b069de9 100644 --- a/testnet/validator-node.md +++ b/testnet/validator-node.md @@ -11,7 +11,7 @@ ### 2. Create Account & Get test tokens ``` -ethermintd keys add +ethermintd keys add --keyring-backend test ``` NOTE: Save `mnemonic` and related account details (public key). You will need to use the need mnemonic/private key to @@ -19,7 +19,10 @@ recover accounts at a later point in time. ##### Get Test tokens from faucet -- TBU +- Open this link : http://167.172.173.94:1314/ and paste your account +- 1 gnt = 10^18 agnt +- Each Transaction you will get 500gnt +- Total Tokens 5000gnt for account ### 3.Create Validator @@ -32,20 +35,22 @@ recover accounts at a later point in time. `Note:` Only execute below transaction after complete sync of your full node +Please replace `key_name` with your key name and `moniker` also + ``` ethermintd tx staking create-validator \ - --amount=1000000uwire \ + --amount=4500000000000000000000agnt \ --pubkey=$(ethermintd tendermint show-validator) \ --moniker="my-moniker" \ --website="https://myweb.site" \ --details="description of your validator" \ - --chain-id="flixnet-2" \ + --chain-id="ethermint_81337-1" \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1" \ --gas="auto" \ --gas-adjustment="1.2" \ - --gas-prices="0.025uwire" \ + --gas-prices="0.025agnt" \ --from= ``` From 1aa98edb0442799048094a877b8266743a1ddf73 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 3 Nov 2021 15:00:44 +0530 Subject: [PATCH 5/5] docs: update the genesis download instruction --- testnet/full-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testnet/full-node.md b/testnet/full-node.md index d54b54e1..f921ec35 100644 --- a/testnet/full-node.md +++ b/testnet/full-node.md @@ -106,7 +106,7 @@ Use `curl` to download the genesis file **Replace your **genesis** file with published genesis file** ```shell -curl http://167.172.173.94:26657/genesis > .ethermintd/config/genesis.json +curl http://167.172.173.94:26657/genesis | jq .result.genesis > ~/.ethermintd/config/genesis.json ``` Verify sha256 hash of genesis file with the below command