Skip to content

Latest commit

 

History

History
131 lines (84 loc) · 7.1 KB

readme.md

File metadata and controls

131 lines (84 loc) · 7.1 KB

Overview

The goal of this project is to start a node connected to one of the cudos' networks.

You must create an SSH connection from a machine (host computer) to the machine where the node will be running (target computer).

All the executions below MUST happen on target computer. Nothing is executed on the host computer itself.

Prerequirements on host computer

SSH Connection to the machine where tge CUDOS node will be running.

Prerequirements on target machine

Enough free space to download network's database. At lease 500GB is recommented.

Docker must be installed

Docker-compose must be installed

JQ must be installed

Git must be installed

It is recommended to increase the max number of open file descriptors of the OS. There is a known bug in Tendermint, where a logger opens many files. Rarely it reaches the open files limit of the OS and crashes the node. The limit increase can be done by changing the nofile flag in /etc/security/limits.conf in case of linux OS. We recommend a value of 4,096.

Genesal usage

  1. Connect to target computer using SSH
  2. Clone cudos-builders repo somewhere (usually in your home directory)
git clone --branch cudos-master https://github.com/CudoVentures/cudos-builders.git CudosBuilders
  1. Create config files according to Config section below
  2. Execute the script according to Usage section below.

Config

All of the config files are in ./client/config folder.

Important: Do not leave any comments in any .env file

Env

Prepare the .env based on .env.example. It contains the following variables:

  1. PARAM_SOURCE_DIR: A dir where repos were initially cloned during initial setup of the node, usually we use something like "/usr/cudos" Example: PARAM_SOURCE_DIR="/usr/cudos"
  2. PARAM_MODE: the name of the node that is going to be started. Possible values are: seed-node, sentry-node or validator-node. Example: PARAM_MODE="sentry-node"
  3. PARAM_NETWORK: The name of the network that node will be part of. Possible values are: testnet-public, testnet-private, mainnet, local. The later is used only for dev purposes. Example: PARAM_NETWORK="testnet-public"

Init

Prepare the init.env based on init.env.example. It contains the following variables:

  1. PARAM_MONIKER: The name of your node. Use only english lowercase letters and "-". Example: PARAM_MONIKER="my-first-node"
  2. PARAM_MONITORING_ENABLED: Indicates whether monitoring services will be connected to this node. Example: PARAM_MONITORING_ENABLED="false"
  3. PARAM_EXTERNAL_ADDRESS: Optional Externally accessible address of your node. It must include a port 26656 as well. If port 26656 is redirected please specify the redirected port. Example: PARAM_EXTERNAL_ADDRESS="1.2.3.4:26656"

Start

Prepare the start.env based on start.env.example. It contains the following variables:

  1. PARAM_PRIVATE_PEER_IDS: Optional Indicated the list of node ids that must be kept private. Usually the validator's node id is put here if you have such. Example: PARAM_PRIVATE_PEER_IDS="b7be7ed4cb265e052d89b4a6ea0b4aab512a1403"
  2. PARAM_PERSISTENT_PEERS: Optional List of comma separated triples (node id@ip:port). Each triples describes a connection endpoint. Set this only if you do not want to use the default values. Usually you do not want to use default while setting a clustered validator. Example: PARAM_PERSISTENT_PEERS="[email protected]:26656,[email protected]:26656"
  3. PARAM_VALIDATOR_MNEMONIC: Optional 1 The mnemonic phrase of a validator wallet. It must have at least 2000001 CUDOS. Example: PARAM_VALIDATOR_MNEMONIC="buzz silver junior gown when grow inmate motion legend spread penalty apple supply master badge setup adapt math turn mistake reject zebra all elite"
  4. PARAM_STAKING_AMOUNT: Optional 1 The amount that will be staked to your validator. It must be >= 2000000000000000000000000 acudos. You can stake your entire wallet's balance but 1000000000000000000 acudos that will be used for the staking transaction. Example: PARAM_STAKING_AMOUNT="2000000000000000000000000"
  5. KEYRING_OS_PASS: Optional 1 The password of your keyring. It must be at least 8 characters. Example: KEYRING_OS_PASS="11111111"

1 If you specify any of parameters from 2 to 4 inclusive then you must specify all of them.

Usage

There are 2 scripts - init and start.

Important: The side effect of executing any of these scripts will be a folder, defined in PARAM_SOURCE_DIR at .env on target computer

Important: Execute these scripts in the specifig order specifing in the launcher sequence below

Important: All of the scripts below must be executed from ./client folder.

Important: Make sure that ./src/init.sh and ./src/start.sh have execute permission.

Init

The command initializes the node including its empty database, folders, etc..

sudo ./src/init.sh

Start

The command starts the initialized node

sudo ./src/start.sh

Launch sequence for creating a standalone node of any type

Best for: Users that do not plan to have a validator or for a single validator node without seeds/sentries

  1. Connect to the target machine where the node will be running on.
  2. Prepare the .env file as described in the section above
  3. Prepare the init.env file as described in the section above
  4. Execute Init command
  5. Prepare the start.env. You can leave all the variable in it empty.
  6. Execute Start command

Launch sequence for creating a clustered validator with its seeds/sentries

Initialize the validator

  1. Connect to the target machine where the validator will be running on.
  2. Prepare the .env file as described in the section above
  3. Prepare the init.env file as described in the section above
  4. Execute Init command and copy the node id. It will be available in the console as a result of the execution of the Init command.

Initialize and start seeds/sentries

  1. Connect to the target machine where the node will be running on.
  2. Prepare the .env file as described in the section above
  3. Prepare the init.env file as described in the section above
  4. Execute Init command and copy the node id. It will be available in the console as a result of the execution of the Init command.
  5. Prepare the start.env. Set validator's node id to PARAM_PRIVATE_PEER_IDS.
  6. Execute Start command

Note: Execute this step for any seed/sentry node that you would like to have. Usually a clustered validator must have at least a sentry and a seed.

Start the validator

  1. Connect to the target machine where the validator was initialized.
  2. Prepare the start.env. Set validator's own node id to PARAM_PRIVATE_PEER_IDS. Set your sentries' triples (node id@ip:port) to PARAM_PERSISTENT_PEERS separated by commas. Set the rest of the three params as described in the Config section.
  3. Execute Start command