Skip to main content

Setting Up a Full Node

Learn how to set up the full node for the Babylon system.


setfullnode

Note

This guide requires having Babylon installed on a Linux System. The instructions can be found on the Installation page The version to install is specified at the bbn-test-2 network info page.

1. Initialize the Node Directory

First, initialize a node configuration directory under ~/.babylond. The $NODENAME variable specifies the name you aim to give your node.

babylond init $NODENAME --chain-id bbn-test-2

Then, retrieve the genesis file and place it in the node directory:

wget https://github.com/babylonchain/networks/raw/main/bbn-test-2/genesis.tar.bz2
tar -xjf genesis.tar.bz2 && rm genesis.tar.bz2
mv genesis.json ~/.babylond/config/genesis.json

2. Add Peers and Modify Configuration

Edit the configuration file at ~/.babylond/config/config.toml and modify the seeds and persistent_peers attributes to contain appropriate seeds and peers of your choice. The full list of Babylon approved seeds and peers can be found under the bbn-test-2 network info page.

Edit the configuration file at ~/.babylond/config/app.toml and modify the btc-network attribute to contain the appropriate BTC network parameters as below.

[btc-config]
network = "mainnet"

On the same file, you can also modify the minimum-gas-prices attribute and set it to a value of your choosing. For example,

minimum-gas-prices = "0.00001ubbn"

3. Setup Cosmovisor

To install the latest version of Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

Create the necessary directories

mkdir -p ~/.babylond
mkdir -p ~/.babylond/cosmovisor
mkdir -p ~/.babylond/cosmovisor/genesis
mkdir -p ~/.babylond/cosmovisor/genesis/bin
mkdir -p ~/.babylond/cosmovisor/upgrades

Copy the babylond binary into the cosmovisor/genesis folder

cp $GOPATH/bin/babylond ~/.babylond/cosmovisor/genesis/bin/babylond

Setup a cosmovisor service:

sudo tee /etc/systemd/system/babylond.service > /dev/null <<EOF
[Unit]
Description=Babylon daemon
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start --x-crisis-skip-assert-invariants
Restart=always
RestartSec=3
LimitNOFILE=infinity

Environment="DAEMON_NAME=babylond"
Environment="DAEMON_HOME=${HOME}/.babylond"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"

[Install]
WantedBy=multi-user.target
EOF

4. Start the Node

sudo -S systemctl daemon-reload
sudo -S systemctl enable babylond
sudo -S systemctl start babylond

You can check the status of the node by running

systemctl status babylond