From ca8c83999c74a730c48d12d71cea82ef33adf5d8 Mon Sep 17 00:00:00 2001 From: Ivan Zubok Date: Mon, 7 Nov 2022 20:40:02 +0000 Subject: [PATCH] Updated documentation for laconic_81337-5 Documented running in Docker --- testnet/genesis-validators.md | 133 +++++++++++++++++++++------------- 1 file changed, 84 insertions(+), 49 deletions(-) diff --git a/testnet/genesis-validators.md b/testnet/genesis-validators.md index df1f2c5c..2cbbd3f1 100644 --- a/testnet/genesis-validators.md +++ b/testnet/genesis-validators.md @@ -1,19 +1,19 @@ -# Validator Guide for laconic_81337-4 Testnet +# Validator Guide for laconic_81337-5 Testnet ## Hardware Prerequisites ### Supported - **Operating System (OS):** Ubuntu 20.04 -- **CPU:** 1 core -- **RAM:** 2GB +- **CPU:** 2 core +- **RAM:** 8GB - **Storage:** 25GB SSD ### Recommended - **Operating System (OS):** Ubuntu 20.04 - **CPU:** 2 core -- **RAM:** 4GB +- **RAM:** 8GB - **Storage:** 50GB SSD ## Network Prerequisites @@ -21,9 +21,15 @@ - **TCP 26656** for Peer-to-Peer Network Communication - **TCP 26660** for Prometheus Metrics (doesn't have to be exposed publicly) -# Validator Setup +# Blockchain client Setup -## Install required software packages +There are two options of running a laconicd +1. As a systemd service +2. In a docker container + +## Systemd service +Skip this section if you use docker +### Install required software packages ```sh # Update Ubuntu @@ -36,7 +42,7 @@ sudo apt install git curl build-essential make jq -y --- -## Install Go +### Install Go ```sh # Remove any existing installation of `go` @@ -66,7 +72,7 @@ go version --- -## Install `laconic` +### Install `laconic` ```sh git clone https://github.com/cerc-io/laconicd.git @@ -74,7 +80,7 @@ cd laconicd # Checkout main branch git fetch --all -git checkout main +git checkout v0.6.0 # Build and install laconic make install @@ -96,13 +102,32 @@ server_name: laconicd --- -## Initialize Validator Node +## Docker container + +There are different commands to initialize a validator and to run a validator node. +See "Docker" section in corresponding chapters. +It is important to mount a host directory (`~/.laconicd` in this documentation) to `/root/.laconicd` directory inside the container, so all blockchain data, configuration and keys persist between container restarts. +For running a validator node it is also required to publish container's port 26656 and (optionally) 26660 to the host. +--- + +# Initialize Validator Node **Not required if you have already initialized before** +Make sure the directory `~/.laconicd` does not exist or is empty + +--- +>**Docker**
+>In order to run the below commands in a docker container: +>```sh +>docker run -ti -v ~/.laconicd:/root/.laconicd \ +>git.vdb.to/cerc-io/laconicd/laconicd:v0.6.0 /bin/sh +>``` +--- + ```sh # Initialize the validator node -laconicd init --chain-id laconic_81337-4 +laconicd init --chain-id laconic_81337-5 ``` Running the above commands will initialize the validator node with default configuration. The config files will be saved in the default location (`~/.laconicd/config`). @@ -111,35 +136,6 @@ Running the above commands will initialize the validator node with default confi --- -## Overwrite Validator Initialization from previous testnet - -**Required for `laconic_81337-4`** - -First we have to reset the previous genesis state (only because the `laconic_81337-3` testnet failed) whereafter we can initialize the validator node for `laconic_81337-4` - -```sh -# Stop your node (in case it was still running) -systemctl stop laconicd - -# Keep a backup of your old validator directory -cp -a ~/.laconicd ~/backup-laconic_81337-2 - -# Reset the state of your validator -laconicd tendermint unsafe-reset-all --home $HOME/.laconicd - -# Remove your previous genesis transactions -rm $HOME/.laconicd/config/gentx/gentx*.json - -# Overwrite your genesis state with the new chain-id -laconicd init --overwrite --chain-id laconic_81337-4 -``` - -Running the above commands will re-initialize the validator node with default configuration. The config files will be saved in the default location (`~/.laconicd/config`). - -**NOTE:** Backup your node and validator keys. You will need to use these keys at a later point in time. - ---- - ## Create Account keys If you have participated in a previous testnet and have a mnemonic phrase, use below command to recover your account: @@ -171,11 +167,12 @@ Create Your `gentx` transaction file ```sh laconicd gentx 12900000000000000000000achk \ --pubkey=$(laconicd tendermint show-validator) \ - --chain-id="laconic_81337-4" \ + --chain-id="laconic_81337-5" \ --moniker="" \ --website="" \ --details="" \ --identity="" \ + --ip="" \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ @@ -200,10 +197,10 @@ Submit your `gentx` file to the [https://github.com/cerc-io/laconic-testnet]() r To submit the gentx file, follow the below process: - Fork the [https://github.com/cerc-io/laconic-testnet]() repository -- Upload your gentx file in the `laconic_81337-4/config/gentxs` folder +- Upload your gentx file in the `laconic_81337-5/config/gentxs` folder - Submit Pull Request to [https://github.com/cerc-io/laconic-testnet]() with name `ADD gentx` -The genesis file will be published in the `laconic_81337-4/config/` folder within the [https://github.com/cerc-io/laconic-testnet]() repository. +The genesis file will be published in the `laconic_81337-5/config/` folder within the [https://github.com/cerc-io/laconic-testnet]() repository. # CONTINUE WITH BELOW STEPS ONLY AFTER GENESIS FILE HAS BEEN PUBLISHED @@ -213,11 +210,16 @@ The genesis file will be published in the `laconic_81337-4/config/` folder withi # Set seed & peers variable seeds="" peers="" +external_address="" +moniker="" # Update seeds, persistent_peers and prometheus parameters in config.toml -sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/; s/^prometheus *=.*/prometheus = true/" $HOME/.laconicd/config/config.toml +sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/; s/^prometheus *=.*/prometheus = true/; s/^moniker *=.*/moniker = \"$moniker\"/; s/^external_address *=.*/external_address = \"tcp:\/\/$external_address:26656\"/" $HOME/.laconicd/config/config.toml +``` +--- -# Create systemd validator service +## Create systemd validator service (skip for Docker) +```sh sudo tee /etc/systemd/system/laconicd.service > /dev/null <