CUDOS Validator Setup Guide

0) Environment Setup

# Install Docker, Git and jQuery via the yum package manager.
$ sudo yum install docker git jq -y
# Start the Docker daemon.
$ sudo service docker start
# Install docker-compose by downloading the binary from the GitHub download archive.
$ curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Make docker-compose executable for the current user.
$ chmod +x /usr/local/bin/docker-compose
$ mkdir ~/cudos
$ cd ~/cudos
$ git clone --depth 1 --branch v0.2 https://github.com/CudoVentures/cudos-node.git CudosNode
$ git clone --depth 1 --branch v0.3 https://github.com/CudoVentures/cudos-builders.git CudosBuilders
$ git clone --depth 1 --branch v0.2 https://github.com/CudoVentures/cosmos-gravity-bridge.git CudosGravityBridge
$ cd ~/cudos/docker/binary-builder
$ sudo docker-compose --env-file binary-builder.arg -f binary-builder.yml -p cudos-binary-builder up --build --detach

1) Validator Setup

  • The CUDOS validator, which participates in on-chain consensus by voting on and proposing blocks, and which is used by the orchestrator to make its call against the CUDOS chain
  • The Gravity Bridge Orchestrator, which manages the token flow between CUDOS and Ethereum
  • An Ethereum full node, which is used by the orchestrator to make its calls against Ethereum

1.1) Ethereum Full Node Setup

$ cd ~/cudos/CudosBuilders/docker/ethereum
$ sudo docker-compose -f ethereum-full.yml -p ethereum up --build --detach
$ sudo docker logs -f ethereum

1.2) CUDOS Validator Node Setup

# Navigate to the full-node directory of CudosBuilders.
$ cd ~/cudos/CudosBuilders/docker/full-node
# Make a copy of the example full-node env file and open it with a text editor of your choice.
$ cp full-node.env.example full-node.client.testnet.public01.env
$ nano full-node.client.testnet.public01.env
# Add the following contents to the file. Once you're done, save the changes and close the file.
MONIKER=<Insert your validator moniker here>
SHOULD_USER_GLOBAL_PEERS=false
# Initialize the full node.
$ sudo docker-compose --env-file full-node.client.testnet.public01.arg -f init-full-node.yml -p cudos-init-full-node-client-testnet-public-01 up --build
$ ls ~/cudos
CudosBuilders CudosData CudosGravityBridge CudosNode
/\
||
This directory should be there.
$ ls ~/cudos/CudosData/cudos-data-full-node-client-testnet-public-01
config data tendermint.nodeid
$ cat ~/cudos/CudosData/cudos-data-full-node-client-testnet-public-01/tendermint.nodeid
  • Repeat the “0) Environment Setup” step on the sentry node.
  • Follow the official Sentry Setup Guide.
    For step 6, you’ll need the validator’s node ID from the text file mentioned above, and the validator’s public IP address. Make sure port 26656 is open for in- and outbound connections. For now, you don’t have to enter any other peer addresses other than you validator’s.
  • Get the sentry’s node ID, copy and paste it into a text file on your local computer. You’ll be needing it shortly.
$ cat ~/cudos/CudosData/cudos-data-sentry-node-client-testnet-public-01/tendermint.nodeid
  • Ideally, you’ll want to set up at least two sentry nodes for effective DDoS protection. Just repeat the three steps above on another host machine.
$ cd ~/cudos/CudosBuilders/docker/full-node
$ nano full-node.client.testnet.public01.env
# Add the following contents to the file. Once you're done, save the changes and close the file.
PERSISTENT_PEERS=<sentry1-node-id>@<sentry1-public.ip>:26656,<sentry2-node-id>@<sentry2-public.ip>:26656
# Set the configuration.
$ sudo docker-compose --env-file full-node.client.testnet.public01.arg -f config-full-node.yml -p cudos-config-full-node-client-testnet-public-01 up --build
# Start the full node.
sudo docker-compose --env-file full-node.client.testnet.public01.arg -f start-full-node.yml -p cudos-start-full-node-client-testnet-public-01 up --build --detach
# Logs can be viewed by running the following command.
$ sudo docker logs -f cudos-start-full-node-client-testnet-public-01
# Wait for the output of this command to be 'false'.
$ sudo docker exec -ti cudos-start-full-node-client-testnet-public-01 cudos-noded status | jq '.SyncInfo.catching_up'
# Check the progress by comparing the block height from the output of this command with the latest block height from the official block explorer.
$ sudo docker exec -ti cudos-start-full-node-client-testnet-public-01 cudos-noded status | jq '.SyncInfo.latest_block_height'
$ sudo docker exec -it cudos-start-full-node-client-testnet-public-01 bash
$ cudos-noded keys add validator --recover --keyring-backend file
$ cudos-noded keys list --keyring-backend file
$ cudos-noded tx staking create-validator \
--amount <STAKE> \
--from validator \
--pubkey $(cudos-noded tendermint show-validator) \
--moniker <YOUR_MONIKER> \
--chain-id <CHAIN_ID> \
--commission-rate <COM_RATE> \
--commission-max-rate <COM_MAX_RATE> \
--commission-max-change-rate <COM_MAX_CHANGE_RATE> \
--min-self-delegation 1 \
--gas auto \
--gas-prices 0.025acudos \
--gas-adjustment 1.80 \
--keyring-backend file \
-y
  • <STAKE> must be at least 1000000000000000000acudos (=1 CUDOS)
  • <YOUR_MONIKER> must be the same moniker you provided in ~/cudos/CudosBuilders/docker/full-node/full-node.client.testnet.public01.env
  • <CHAIN_ID> should be cudos-testnet-public for testnet (TBD for mainnet)
  • <COM_RATE> is the percentage of commission you want to take from all rewards, i.e. 0.10 means that you’ll take 10% of all rewards generated
  • <COM_MAX_RATE> is the maximum commission rate you’re committing to, i.e. 0.40 means that you’ll never take more than 40% of all rewards generated
  • <COM_MAX_CHANGE_RATE> is the maximum rate in percent, that you can change your commission rate per day, i.e. 0.20 means that per day, you can either increase or decrease your commission by 20% tops
$ cudos-noded q staking validators

1.3) Orchestrator Setup

$ cudos-noded keys add orchestrator --recover --keyring-backend file
$ cudos-noded keys list --keyring-backend file
$ cudos-noded tx gravity set-orchestrator-address <VALIDATOR_ADDRESS> <ORCH_ADDRESS> <ETH_ADDRESS>
  • <VALIDATOR_ADDRESS> is the validator’s operator address (cudosvaloper…). It can be retrieved with the following command.
$ cudos-noded keys show validator --bech val --keyring-backend file
  • <ORCH_ADDRESS> is the orchestrators address (cudos…). It can be retrieved with the following command.
$ cudos-noded keys show orchestrator --keyring-backend file
  • <ETH_ADDRESS> is the Ethereum address you created in Metamask (0x…).
$ cd ~/cudos/CudosBuilders/docker/orchestrator
$ cp orchestrator.env.example orchestrator.client.testnet.public01.env
$ nano orchestrator.client.testnet.public01.env
# Add the following contents to the file. Once you're done, save the changes and close the file.
ADDRESS_PREFIX="cudos"
FEES="<FEES>"
GRPC="http://<CUDOS_NODE_IP>:9090"
ETHRPC="http://<ETH_NODE_IP>:8545"
CONTRACT_ADDR="0xb22F2A4c231e69703FC524Eb2E3eb7B83C316F42"
COSMOS_ORCH_MNEMONIC="<ORCH_MNEMONIC>"
ETH_PRIV_KEY_HEX="<HEX_PRIV_KEY>"
  • <FEES> are the fees that you will have to pay for each bridge transaction, e.g 100acudos.
  • <CUDOS_NODE_IP> is the public IP address of the CUDOS validator node.
  • <ETH_NODE_IP> is the public IP address of the Ethereum full node.
  • <ORCH_MNEMONIC> is the mnemonic phrase of your orchestrator account.
  • <ETH_PRIV_KEY_HEX> is the hexadecimal representation if the Ethereum account’s private key, without the leading “0x”. Please follow this guide in order to export the private key from Metamask.
$ sudo docker-compose --env-file orchestrator.client.testnet.public01.arg -f orchestrator.release.yml -p cudos-orchestrator-client-testnet-public-01-release up --build --detach
$ sudo docker logs -f cudos-orchestrator-client-testnet-public-01-release

--

--

--

Validator operator in 20+ PoS blockchains. Visit us at www.blockscape.network.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

NumPy Tutorial — Introduction

Configuration Management in DevOps using Ansible

Cartesi System Review and SVET Rating

Cloud-native Hello World for Bioinformatics

{UPDATE} Guess The Movie Quiz Free ~ Learn famous holidays film title & name from trivia game Hack…

AWS Cost Anomaly Detection

The Comparable mixin

Laravel: Avoiding cache data-races

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
blockscapeLab

blockscapeLab

Validator operator in 20+ PoS blockchains. Visit us at www.blockscape.network.

More from Medium

Axelar Network Introduction

Overview of the Axelar Network project

Sourceless is releasing the platform account identifier — Web Non-Fungible Token (WNFT) — Web3…

Chihuahua ($HUAHUA) lists on Picasso Exchange with $100,000 in rewards