Chain ID Latest Version Tag Custom Port
agoric-3 agoric-upgrade-15 127

Setup validator name

Replace YOUR_MONIKER_GOES_HERE with your validator name


Install dependencies

Add package repository for Node.js

curl -fsSL | sudo -E bash -

Add package repository for Yarn

curl -Ls | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Update system and install build tools

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential nodejs=18.* yarn
sudo apt -qy upgrade

Install Go

sudo rm -rf /usr/local/go
curl -Ls | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)

Download and build binaries

# Clone project repository
cd $HOME
rm -rf agoric-upgrade-15
git clone agoric-upgrade-15
cd agoric-upgrade-15
git checkout agoric-upgrade-15

# Install and build Agoric Javascript packages
yarn install && yarn build

# Install and build Agoric Cosmos SDK support
(cd packages/cosmic-swingset && make)

# Prepare binaries for Cosmovisor
mkdir -p $HOME/.agoric/cosmovisor/genesis/bin
ln -s $HOME/agoric-upgrade-15/bin/agd $HOME/.agoric/cosmovisor/upgrades/agoric-upgrade-15/bin/agd

# Create application symlinks
sudo ln -s $HOME/.agoric/cosmovisor/genesis $HOME/.agoric/cosmovisor/current -f

# Link binaries
sudo rm -f /usr/local/bin/agd
sudo tee /usr/local/bin/agd > /dev/null << EOF
exec \$HOME/.agoric/cosmovisor/current/bin/agd "\$@"
sudo chmod 777 /usr/local/bin/agd

Install Cosmovisor and create a service

# Download and install Cosmovisor
go install

# Create service
sudo tee /etc/systemd/system/agoric.service > /dev/null << EOF
Description=agoric node service

ExecStart=$(which cosmovisor) run start

sudo systemctl daemon-reload
sudo systemctl enable agoric.service

Initialize the node

# Set node configuration
agd config chain-id agoric-3
agd config keyring-backend file
agd config node tcp://localhost:12757

# Initialize the node
agd init $MONIKER --chain-id agoric-3

# Download genesis and addrbook
curl -Ls > $HOME/.agoric/config/genesis.json
curl -Ls > $HOME/.agoric/config/addrbook.json

# Add seeds
sed -i -e "s|^seeds *=.*|seeds = \"\"|" $HOME/.agoric/config/config.toml

# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.025ubld\"|" $HOME/.agoric/config/app.toml

# Set pruning
sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "19"|' \

# Set custom ports
sed -i -e "s%^proxy_app = \"tcp://\"%proxy_app = \"tcp://\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:12760\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":12766\"%" $HOME/.agoric/config/config.toml
sed -i -e "s%^address = \"tcp://\"%address = \"tcp://\"%; s%^address = \":8080\"%address = \":12780\"%; s%^address = \"\"%address = \"\"%; s%^address = \"\"%address = \"\"%; s%:8545%:12745%; s%:8546%:12746%; s%:6065%:12765%" $HOME/.agoric/config/app.toml

Download latest chain snapshot

curl -L | tar -Ilz4 -xf - -C $HOME/.agoric
[[ -f $HOME/.agoric/data/upgrade-info.json ]] && cp $HOME/.agoric/data/upgrade-info.json $HOME/.agoric/cosmovisor/genesis/upgrade-info.json

Start service and check the logs

sudo systemctl start agoric.service && sudo journalctl -u agoric.service -f --no-hostname -o cat