Agoric Validator Setup

Provalidator
Provalidator Blog
Published in
4 min readMar 31, 2021

[Phase 1: Onboarding] Testnet Validator Node Setup Guide

This guide is written in accordance with Agoric Testnet [Phase 1: Onboarding]

Agoric Incentivized Testnet

On March 24, Agoric’s anticipated testnet has finally commenced. This incentivized testnet will last until June, 2021 and rigorously test the network’s resilience — including the validator community’s overall competence.

We are thrilled to join Agoric’s incentivized testnet and proud to be selected as one of the 150 validators among 6000+ applicants. We plan to actively participate in each of the phases and share our experience to the community.

For more information regarding the testnet, please visit the Agoric Incentivized Testnet page for an overview.

Validator Setup Guide

This guide is based on the official validator guide created by the Agoric team.

Hardware specification: 4 CPU / 32GB RAM / Ubuntu 18.04 LTS

* default install
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential make jq net-tools gcc -y

Prerequisites

1. Install Node.js

# Download the nodesource PPA for Node.js
curl https://deb.nodesource.com/setup_12.x | sudo bash
# Download the Yarn repository configuration
# See instructions on https://legacy.yarnpkg.com/en/docs/install/
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# Update Ubuntu
sudo apt update
sudo apt upgrade -y
# Install Node.js, Yarn, and build tools
# Install jq for formatting of JSON data
sudo apt install nodejs=12.* yarn build-essential jq -y

2. Install Go

# First remove any existing old Go installation
sudo rm -rf /usr/local/go
# Install correct Go version
curl https://dl.google.com/go/go1.15.7.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
# Update environment 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

3. Install Agoric-SDK

git clone https://github.com/Agoric/agoric-sdk -b <GIT-BRANCH>
cd agoric-sdk
# Install and build Agoric Javascript packages
yarn install
yarn build
# Install and build Agoric Cosmos SDK support
(cd packages/cosmic-swingset && make)

Config Node

1. Check the Network Parameters

# First, get the network config for the current network.
curl https://testnet.agoric.net/network-config > chain.json
# Set chain name to the correct value
chainName=`jq -r .chainName < chain.json`
# Confirm value: should be something like agoricdev-N.
echo $chainName

2. Apply Network Parameters

# Replace <your_moniker> with the public name of your node.
# NOTE: The `--home` flag (or `AG_CHAIN_COSMOS_HOME` environment variable) determines where the chain state is stored.
# By default, this is `$HOME/.ag-chain-cosmos`.
ag-chain-cosmos init --chain-id $chainName <your_moniker># Download the genesis file
curl https://testnet.agoric.net/genesis.json > $HOME/.ag-chain-cosmos/config/genesis.json
# Reset the state of your validator.
ag-chain-cosmos unsafe-reset-all

3. Adjust configuration

# Set peers variable to the correct value
peers=$(jq '.peers | join(",")' < chain.json)
# Set seeds variable to the correct value.
seeds=$(jq '.seeds | join(",")' < chain.json)
# Confirm values, each should be something like "077c58e4b207d02bbbb1b68d6e7e1df08ce18a8a@178.62.245.23:26656,..."
echo $peers
echo $seeds
# Fix `Error: failed to parse log level`
sed -i.bak 's/^log_level/# log_level/' $HOME/.ag-chain-cosmos/config/config.toml
# Replace the seeds and persistent_peers values
sed -i.bak -e "s/^seeds *=.*/seeds = $seeds/; s/^persistent_peers *=.*/persistent_peers = $peers/" $HOME/.ag-chain-cosmos/config/config.toml

Syncing Node

To enable the Prometheus exporter, set the desired listening TCP port number in the $OTEL_EXPORTER_PROMETHEUS_PORT environment variable before running the node.

sudo tee <<EOF >/dev/null /etc/systemd/system/ag-chain-cosmos.service
[Unit]
Description=Agoric Cosmos daemon
After=network-online.target
[Service]
User=$USER
Environment="OTEL_EXPORTER_PROMETHEUS_PORT=9464"
ExecStart=$HOME/go/bin/ag-chain-cosmos start --log_level=warn
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF

Prometheus config

1. Cosmos SDK metrics

vi ~/.ag-chain-cosmos/config/app.toml

[telemetry]
enabled = true
prometheus-retention-time = 60
[api]
# Note: this key is "enable" (without a "d", not "enabled")
enable = true
address = "tcp://0.0.0.0:1317"

2. Tendermint metrics

vi ~/.ag-chain-cosmos/config/config.toml

[instrumentation]
prometheus = true
prometheus_listen_addr = ":26660"

Node Architecture

https://forum.cosmos.network/t/sentry-node-architecture-overview/454

Firewall Config

Validator node is configured in a way to not expose its IP. Thus, validator server only allows TCP 26656(sentry node) as its in-bounds. On the other hand, sentry server opens TCP 26656 to everyone.

Edit config.toml edit

vi $HOME/.ag-chain-cosmos/config/config.toml

Validator Server Config

pex = false

laddr = "tcp://127.0.0.1:26657"

unsafe = true

prometheus = true

Sentry Server Config

pex = true

seeds = “ ”

persistent_peers = "validator-node-id@validator-ip:validator-port“

unconditional_peer_ids = “validator-node-id”

private_peer_ids = “my_validator-node-id”

Get nodeid command

ag-chain-cosmos tendermint show-node-id

About Provalidator

Provalidator is a professional Proof-of-Stake validator and decentralized infrastructure provider. We provide enterprise-level validation services to pivotal blockchain networks. Our team — spread across EU and Asia forming a distributed personnel — have multiple years of operating various Proof-of-Stake blockchain validator nodes.

Our team is available 24/7 to respond to any validator node issue and has built multiple layers to protect and monitor our infrastructure. Using private/public and multi-cloud, multi-region sentry node architecture, we try to protect our delegator’s interest.

Our mission is to support blockchain infrastructure.

We support base layer networks along with early stage blockchain applications through a holistic and long term approach.

Follow us for the latest updates and contact us for building partnerships.

Website | Twitter | Medium

Email: business@provalidator.com

--

--