StakeAngle Services
Search
⌃K
⚒️

Installation

  1. 1.
    Update packages and install useful tools.
sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
  1. 2.
    Install go using snap.
sudo snap install go --classic && \
echo 'export GOPATH="$HOME/go"' >> ~/.profile && \
echo 'export GOBIN="$GOPATH/bin"' >> ~/.profile && \
echo 'export PATH="$GOBIN:$PATH"' >> ~/.profile && \
source ~/.profile && \
go version
  1. 3.
    Install Node.js
curl https://deb.nodesource.com/setup_16.x | sudo bash
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt install nodejs=16.* yarn build-essential git jq -y
node --version | grep 16
​
curl -o- -L https://yarnpkg.com/install.sh | bash
yarn --version
  1. 3.
    Install gcc-10 (not required for Ubuntu 22+)
sudo apt install gcc-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
gcc --version
  1. 4.
    Build the binary from source.
git clone https://github.com/Agoric/agoric-sdk
cd agoric-sdk
git checkout agoric-upgrade-13
yarn install && yarn build
(cd packages/cosmic-swingset && make)
agd version
  1. 5.
    Initialize your node.
curl https://main.agoric.net/network-config > chain.json
chainName=`jq -r .chainName < chain.json`
echo $chainName
​
agd init --chain-id $chainName <node_name>
  1. 6.
    Download genesis.
curl https://main.agoric.net/genesis.json > $HOME/.agoric/config/genesis.json
  1. 7.
    Add seeds and peers to config.toml.
peers=$(jq '.peers | join(",")' < chain.json)
seeds=$(jq '.seeds | join(",")' < chain.json)
sed -i.bak -e "s/^seeds *=.*/seeds = $seeds/; s/^persistent_peers *=.*/persistent_peers = $peers/" $HOME/.agoric/config/config.toml
  1. 8.
    Set up minimum gas price.
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.01ubld,0.005uist\"/;" $HOME/.agoric/config/app.toml
  1. 9.
    Set up pruning (optional).
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.agoric/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.agoric/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.agoric/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.agoric/config/app.toml
  1. 10.
    Create service file.
sudo tee /etc/systemd/system/agd.service > /dev/null <<EOF
[Unit]
Description=Agoric Daemon
After=network-online.target
​
[Service]
User=$USER
ExecStart=$(which agd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
​
[Install]
WantedBy=multi-user.target
EOF
  1. 11.
    Enable and start service.
systemctl daemon-reload
systemctl enable agd
systemctl restart agd
journalctl -u agd -f -o cat
If you would like to speed up the sync process, you may try using State Sync.
​