Agoric Testnet for dummies

Polyatskiy Anton
2 min readMar 29, 2021

--

1. Select an all-purpose server with at least 4 GB of RAM, good connectivity, and a SSD with at sufficient disk space. Ubuntu 20.04 would be a good choice.

2. Open port 26656

3. Install Node.js

sudo apt install curl 
curl 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

4. Install Go

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 EOFsource $HOME/.profile

5. Install Agoric SDK

export GIT_BRANCH="@agoric/sdk@2.15.1" git clone https://github.com/Agoric/agoric-sdk -b $GIT_BRANCH cd agoric-sdk npm install -g yarn yarn install yarn build (cd packages/cosmic-swingset && make)ag-chain-cosmos version --long | grep version

6. Configuring Your Node

Check the Network Parameters

curl https://testnet.agoric.net/network-config > chain.json chainName=`jq -r .chainName < chain.json` echo $chainName

Apply Network Parameters

replace <your-node-name> with a name for your node

ag-chain-cosmos init --chain-id $chainName <your-node-name>
curl https://testnet.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

7. Syncing Your 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
ExecStart=$HOME/go/bin/ag-chain-cosmos start --log_level=warn
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable ag-chain-cosmos sudo systemctl daemon-reload sudo systemctl start ag-chain-cosmos

Wait, wait, wait

ag-cosmos-helper status 2>&1 | jq .SyncInfo

If catching_up: true wait and repeat the previous step until it becomes false

8. Creating a Validator

ag-cosmos-helper keys add wallet 
ag-cosmos-helper keys list

Go to the Agoric Discord server #testnet-faucet channel and send the following chat message with your generated Agoric address (the address: agoric1..)

replace <…> below with your data

chainName=`curl https://testnet.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> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--from=wallet \
--chain-id=$chainName \
--gas=auto \
--gas-adjustment=1.4
ag-cosmos-helper status 2>&1 | jq .ValidatorInfo

Now you can check your node: https://testnet.explorer.agoric.net/validators

More information here: https://gist.github.com/dckc/c6d4c5800daca0bd3439aee3e024b317

--

--

No responses yet