Agoric testnet node installation

Stake SU
4 min readMar 28, 2021

Preamble

In order to successfully install Agoric node, you will need a server with at least 4 GB of RAM, decent connectivity, a drive with sufficient disk space and, please, have the port 26656 opened in order to connect to the Agoric peer-to-peer network. All the requirements tend to increase over time as Agoric network grows, so keep in mind that chosen redundant parameters of your equipment are the cornerstone of excellent performance and, moreover, they eventually become mandatory.

Install dependencies (Node.js and Go)

# if there are questions in the console when executing the commands — press Ycurl https://deb.nodesource.com/setup_12.x | sudo bash
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
sudo apt update
sudo apt upgrade -y
sudo apt install nodejs=12.* yarn build-essential jq -y
sudo rm -rf /usr/local/go
curl https://dl.google.com/go/go1.15.7.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
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
#you may check the version by going:go version# should return go version go1.15.7 linux/amd64

Install Agoric SDK

#choose the actual GIT-BRANCH from https://github.com/Agoric/agoric-sdk/wiki/Validator-Guide#Network-Status and replace its name instead of <GIT-BRANCH>\
git clone https://github.com/Agoric/agoric-sdk -b <GIT-BRANCH>
cd agoric-sdk
yarn install
yarn build
(cd packages/cosmic-swingset && make)
#you may check that current version matches the version described at https://github.com/Agoric/agoric-sdk/wiki/Validator-Guide#Network-Status
ag-chain-cosmos version — long
#should return something like this
name: agoriccosmos
server_name: ag-cosmos-server
version: <SOFTWARE-VERSION>
commit: <GIT-COMMIT>
build_tags: “”
go: go version go1.15.7 linux/amd64]

Install Node and Apply Network Parameters

curl https://devnet.agoric.net/network-config > chain.json
chainName=`jq -r .chainName < chain.json`
echo $chainName
#you may assign a name for your node by replacing <your_moniker> with a name of your choice
ag-chain-cosmos init — chain-id $chainName <your_moniker>
curl https://devnet.agoric.net/genesis.json > $HOME/.ag-chain-cosmos/config/genesis.json
ag-chain-cosmos unsafe-reset-all
peers=$(jq ‘.peers | join(“,”)’ < chain.json)
seeds=$(jq ‘.seeds | join(“,”)’ < chain.json)
echo $peers
echo $seeds
sed -i.bak ‘s/^log_level/# log_level/’ $HOME/.ag-chain-cosmos/config/config.toml
sed -i.bak -e “s/^seeds *=.*/seeds = $seeds/; s/^persistent_peers *=.*/persistent_peers = $peers/” $HOME/.ag-chain-cosmos/config/config.toml

Synchronization

sudo tee <<EOF >/dev/null /etc/systemd/system/ag-chain-cosmos.service
[Unit]
Description=Agoric Cosmos daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/go/bin/ag-chain-cosmos start — log_level=warn
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
cat /etc/systemd/system/ag-chain-cosmos.service
ag-chain-cosmos start — log_level=warn
sudo systemctl enable ag-chain-cosmos
sudo systemctl daemon-reload
sudo systemctl start ag-chain-cosmos
#you may check the status of syncing:
ag-cosmos-helper status 2>&1 | jq .SyncInfo
#should return an information block resembling this:
#{
“latest_block_hash”: “9A20078247W9164006F2E7C544A27C2K8488D5107F436645BJO94BAEBE50NJU3”,
“latest_app_hash”: “010EF4A62021F88D097591D6A31906CF9E5FA4359DC523B535E3C411DC6010B1”,
“latest_block_height”: “433555”,
“latest_block_time”: “2021–03–26T23:19:41.006715122Z”,
“catching_up”: true
}
#whenever you execute the above command it’s crucial that block height is increasing. Once you catch up the blockchain, “catching_up” status will switсh to false

Creating a Validator

Replace <your-key-name> with a name for your operator key that you will remember
ag-cosmos-helper keys add <your-key-name>
ag-cosmos-helper keys list
#right down the output to store the mnemonic securely

Tap the Faucet
Now you go to the Agoric Discord server, #faucet channel and type the following chat message with your generated Agoric address (the address: agoric1… address, not the pubkey: agoricpub1… public key) in order to receive tokens:
!faucet delegate agoric1…
Once you see a green check mark your tokens have been sent and you are good to go.

#you may check your balance
ag-cosmos-helper query bank balances `ag-cosmos-helper keys show -a <your-key-name>`

Catching up

#your node must catch up the rest of blockchain
while sleep 5; do
sync_info=`ag-cosmos-helper status 2>&1 | jq .SyncInfo`
echo “$sync_info”
if test `echo “$sync_info” | jq -r .catching_up` == false; then
echo “Caught up”
break
fi
done

Validator Pubkey

ag-chain-cosmos tendermint show-validator
chainName=`curl https://devnet.agoric.net/network-config | jq -r .chainName`
echo $chainName
ag-cosmos-helper tx staking create-validator \
— amount=50000000uagstake \
— broadcast-mode=block \
— pubkey=<your-agoricvalconspub1-key> \
— moniker=<your-node-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" \
— from=<your-key-name> \
— chain-id=$chainName \
— gas=auto \
— gas-adjustment=1.4
#you may check the status of your validator
ag-cosmos-helper status 2>&1 | jq .ValidatorInfo

After you have made these steps, your validator should be up and able to receive delegations. Note, that only 150 validators are eligible for block rewards. You can view the current list of validators here: https://explorer.testnet.agoric.com/. Additional nodes might be in demand over time so the set of current validators will expand.

Additional links

https://github.com/Agoric/agoric-sdk/wiki/Validator-Guide

--

--