Node setup for Babylon Chain

Node setup requres some basic knowlage of Linux OS and server managment. Setting up the node can be daunting and chalanging task. This is a short guide how to set up the node.

Update the system and install the essentials:

sudo apt update && sudo apt full-upgrade -y && apt install build-essential 
sudo apt install vim /or apt install nano 
sudo apt install entr jq make git ufw wget 

Install GO and Cosmovisor

sudo rm -r /usr/local/go/
wget https://golang.org/dl/go1.22.0.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
rm go1.22.0.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc
echo 'export PATH=$PATH:$HOME/go/bin' >> $HOME./bashrc
source $HOME/.bashrc
 
# Install cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
sudo mv ~/go/bin/cosmovisor /usr/local/bin

Clone the repository and install node binary

cd $HOME 
git clone https://github.com/babylonchain/babylon.git
cd babylon 
git checkout v0.8.3 # always doublecheck from the official team for the right version
make install

Set up cosmovisor

mkdir -p $HOME/.babylond/cosmovisor/genesis/bin
mkdir -p $HOME/.babylond/cosmovisor/upgrades
mv $HOME/go/bin/babylond $HOME/.babylond/cosmovisor/genesis/bin/
sudo ln -s $HOME/.babylond/cosmovisor/genesis $HOME/.babylond/cosmovisor/current -f
sudo ln -s $HOME/.babylond/cosmovisor/current/bin/babylond /usr/local/bin/babylond -f
 
# Create service file
 
sudo tee /etc/systemd/system/babylond.service > /dev/null <<EOF
[Unit]
Description=”Babylon Chain node”
After=network-online.target
 
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
WorkingDirectory=$HOME/.babylond
Restart=on-failure 
RestartSec=5
LimitNOFILE=65535
Environment=”DAEMON_NAME=babylond”
Environment=”DAEMON_HOME=$HOME/.babylond”
Environment=”DAEMON_ALLOW_DOWNLOAD_BINARIES=false”
Environment=”DAEMON_RESTART_AFTER_UPGRADE=true”
Environment=”UNSAFE_SKIP_BACKUP=true”
Environment=”PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.babylond/cosmovisor/current/bin”
 
[Install]
WantedBy=multi-user.target
EOF
 
sudo systemctl daemon-reload
sudo systemctl enable babylond.service

Set up the node

# Please when using this guide replace “YOUR_MONIKER” with name for your node.
 
babylond init YOUR_MONIKER --chain-id bbn-test-3
 
# Get address book and genesis.json
wget https://raw.githubusercontent.com/Cogwheel-Validator/docs/main/files/babylon-testnet/genesis.json -O $HOME/.babylond/config/genesis.json
wget https://raw.githubusercontent.com/Cogwheel-Validator/docs/main/files/babylon-testnet/addrbook.json -O $HOME/.babylond/config/addrbook.json
 
 
#Do some changes to the settings
sed -i -e “s|^minimum-gas-prices *=.*|minimum-gas-prices = \”0.0001ubbn\”| $HOME/.babylond/config/app.toml
sed -i -e “s|^timeout_commit *=.*|timeout_commit = \”30s\”| $HOME/.babylond/config/config.toml

Use state sync or snapshot to catch up

Use snapshot or state sync to catch up.

Links to snapshots. You only need from one provider.
https://polkachu.com/testnets/babylon/snapshots
https://services.kjnodes.com/testnet/babylon/snapshot/

Start the node

sudo systemctl start babylond  && sudo journalctl -fu babylond -o cat