Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testnet_instructions.md #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 78 additions & 29 deletions testnet_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## **Quick Links**

Genesis: `link`
Genesis:

Block explorer: `TBA`
Block explorer:

Seeds: TBA
Peers:

Chain Id: TBA
Chain Id: `school-testnet-5`

## **Hardware Requirements**

Expand All @@ -21,30 +21,34 @@ Here are the minimal hardware configs required for running a validator/sentry no
## **Software Requirements**

- Ubuntu 20.04+ or Debian 10+
- [Go v1.18+](https://golang.org/doc/install)
- [Go v1.20+](https://golang.org/doc/install)

## **Install Gaiad, Generate Wallet and Submit GenTx**

### ****Cosmos Hub binaries installation (gaiad)****

For the sake of simplicity we decided to use Cosmos Hub service binary. In order to install it please follow steps from official Cosmos HUB [instructions](https://hub.cosmos.network/main/getting-started/installation.html). It is based on the `v7.0.2` version of `gaiad` binary. Please check version of used binary by running this command `gaiad version --long`. You should get big list of text and at the beginning of it you should have following lines:
For the sake of simplicity we decided to use Cosmos Hub service binary. In order to install it please follow steps from official Cosmos HUB [instructions](https://hub.cosmos.network/main/getting-started/installation.html). It is based on the `v12.0.0` version of `gaiad` binary. Please check version of used binary by running this command `gaiad version --long`. You should get big list of text and at the beginning of it you should have the following lines:

```
name: gaia
server_name: gaiad
version: v7.0.2
commit: cd27aaaf39cc7819b5164e4baf3fd5aad23ec52a
version: v12.0.0
commit: 6f8067d76ce30996f83645862153ccfaf5f13dd1
build_tags: netgo ledger
```

### Network init

`cd ~`
`gaiad init "<moniker-name>" --chain-id <current course chain id>`
```bash
cd ~
gaiad init "<moniker-name>" --chain-id school-testnet-5
```

example:

`gaiad init course-participant-1 --chain-id dvs-course-testnet-1`
```bash
gaiad init course-participant-1 --chain-id school-testnet-5
```

### **Create Validator Key**

Expand All @@ -66,7 +70,7 @@ Check your key:

### ****Create account to genesis****

This command will help you to create account in your local genesis file. It will add funds to your address. Otherwise `gaiad getntx` command will fail because of lack of funds.
This command will help you to create account in your local genesis file. It will add funds to your address. Otherwise `gaiad gentx` command will fail because of lack of funds.

`gaiad add-genesis-account <key-name> 1000000000uatom`

Expand All @@ -75,15 +79,14 @@ This command will help you to create account in your local genesis file. It will
Create the gentx file. Note, your gentx will be rejected if you use any amount greater than 1000000000uatom.

```
gaiad gentx <key-name> 1000000000uatom --output-document=gentx.json \
--chain-id=dvs-course-testnet-1 \
gaiad gentx <key-name> 1000000000uatom \
--chain-id=school-testnet-4 \
--moniker="<moniker-name>" \
--website=<your-node-website> \
--details=<your-node-details> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1"
--commission-max-change-rate="0.01"
```

After gentx will be ready you can find it in the `~/.gaiad/config/gentx` directory. After that you will be required to upload it into `gentxs` directory of this repository. Please name it using following template `gentx-<validator name>.json`.
Expand All @@ -110,46 +113,74 @@ Please “Open pull request”, check data, put some description into text box f
gaiad tx staking create-validator \
--amount=1000000000uatom \
--pubkey=$(gaiad tendermint show-validator) \
--chain-id=dvs-course-testnet-1 \
--chain-id=school-testnet-4 \
--moniker="<moniker-name>" \
--website=<your-node-website> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--gas="auto" \
--gas-prices="0.0025uatom" \
--gas-adjustment=1.3 \
--gas-prices="0.1uatom" \
--from=<key_name>
```

## Run node

### ****Set Up Cosmovisor****
Install `curl`
```
sudo apt install curl -y
```

### ****Download genesis****

To download `genesis.json` file
```
curl https://raw.githubusercontent.com/Distributed-Validators-Synctems/school-testnet-4/master/genesis.json > ~/.gaia/config/genesis.json
```
After downloading you need to verify your `genesis.json` checksum

```
sha256sum ~/.gaia/config/genesis.json
```

Set up cosmovisor to ensure any future upgrades happen flawlessly. To install Cosmovisor:
you should see `16f4193398f60a06925a35afe89a164b374634a7397c198a3bb55133cdb5fbea` in the output.

`go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]`
Set the peers
```bash
PEERS="[email protected]:26656,[email protected]:27656,[email protected]:26656,[email protected]:26656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.gaia/config/config.toml
```

Create the required directories:
### ****Set Up Cosmovisor****

Set up cosmovisor to ensure any future upgrades happen flawlessly. To install Cosmovisor
```
mkdir -p ~/.gaiad/cosmovisor/genesis/bin
mkdir -p ~/.gaiad/cosmovisor/upgrades
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]
```

After directories will be ready please copy `gaiad` binaries created in the “Cosmos Hub binaries installation (gaiad)” section into `~/.gaiad/cosmovisor/genesis/bin` directory. You can do it using `cp ~/go/bin/gaiad ~/.gaiad/cosmovisor/genesis/bin/gaiad` command.
Create the required directories and files
```
mkdir -p ~/.gaia/cosmovisor/genesis/bin
mkdir -p ~/.gaia/cosmovisor/upgrades
echo "" | sed 's/.*/{}/' > ~/.gaia/cosmovisor/genesis/upgrade-info.json
```

After directories will be ready please copy `gaiad` binaries created in the “Cosmos Hub binaries installation (gaiad)” section into `~/.gaiad/cosmovisor/genesis/bin` directory. You can do it using next command
```
cp ~/go/bin/gaiad ~/.gaia/cosmovisor/genesis/bin/gaiad
```

### ****Set Up Gaiad Service****

Set up a service to allow cosmovisor to run in the background as well as restart automatically if it runs into any problems:

```
echo "[Unit]
Description=Cosmos Hub daemon
After=network-online.target
[Service]
Environment="DAEMON_NAME=gaiad"
Environment="DAEMON_HOME=${HOME}/.gaiad"
Environment="DAEMON_HOME=${HOME}/.gaia"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Expand All @@ -166,8 +197,26 @@ WantedBy=multi-user.target
```

Move this new file to the systemd directory:
```
sudo mv cosmovisor.service /lib/systemd/system/gaiad.service
```

`sudo mv cosmovisor.service /lib/systemd/system/gaiad.service`
And start service:
```
sudo systemctl daemon-reload
sudo systemctl enable gaiad
sudo systemctl restart gaiad
```

How you can check the logs
```
sudo journalctl -u gaiad -f
```

Set chain-id to `school-testnet-4` (for CLI)
```
gaiad config chain-id school-testnet-4
```

## **More about validators**

Expand Down