Manual Installation
Let's explore the manual installation process as we set up a node with Cosmovisor!
Install Dependencies
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade
Secure Setup
This step is optional, and you can choose to skip ahead to configure moniker.
sudo adduser babylon --disabled-password -q
sudo usermod -aG sudo babylon
sudo -u babylon bash -c 'mkdir -p ~/.ssh && echo "YOUR_PUBLIC_SSH_KEY" >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys'
Configure Moniker
MONIKER="<your-moniker-name>"
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.20.10.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Build Binaries
cd $HOME
rm -rf babylon
git clone https://github.com/babylonchain/babylon.git
cd babylon
git checkout v0.7.2
make build
Latest commit : fee9407953347b6f78c9dc63c3dd141d936f4f04
mkdir -p $HOME/.babylond/cosmovisor/genesis/bin
mv build/babylond $HOME/.babylond/cosmovisor/genesis/bin/
rm -rf build
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
Cosmovisor Setup
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
Create Service
sudo tee /etc/systemd/system/babylon.service > /dev/null << EOF
[Unit]
Description=babylon node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.babylond"
Environment="DAEMON_NAME=babylond"
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
Enable Service
sudo systemctl daemon-reload
sudo systemctl enable babylon
Initialize Node
babylond config chain-id bbn-test-2
babylond config keyring-backend test
babylond config node tcp://localhost:21757
babylond init $MONIKER --chain-id bbn-test-2
Download Genesis & Addrbook
curl -Ls https://snap.nodex.one/babylon-testnet/genesis.json > $HOME/.babylond/config/genesis.json
curl -Ls https://snap.nodex.one/babylon-testnet/addrbook.json > $HOME/.babylond/config/addrbook.json
sha256sum genesis.json
: 091bd1c0ec67178faae923eb3b21020d6d4b5844de31bf314d7936168b3aa18c
Configure Seeds
sed -i -e "s|^seeds *=.*|seeds = \"d1d43cc7c7aef715957289fd96a114ecaa7ba756@testnet-seeds.nodex.one:21710\"|" $HOME/.babylond/config/config.toml
Configure Gas Prices
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.00001ubbn\"|" $HOME/.babylond/config/app.toml
Pruning Setting
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"|' \
$HOME/.babylond/config/app.toml
Custom Port
Please note that updating the port is optional!
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:21758\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:21757\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:21760\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:21756\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":21766\"%" $HOME/.babylond/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:21717\"%; s%^address = \":8080\"%address = \":21780\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:21790\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:21791\"%; s%:8545%:21745%; s%:8546%:21746%; s%:6065%:21765%" $HOME/.babylond/config/app.toml
Download Snapshots
curl -L https://snap.nodex.one/babylon-testnet/babylon-latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.babylond
[[ -f $HOME/.babylond/data/upgrade-info.json ]] && cp $HOME/.babylond/data/upgrade-info.json $HOME/.babylond/cosmovisor/genesis/upgrade-info.json
Start Service
sudo systemctl start babylon
The journey is not over yet, you must continue to become a validator in the way we have created below.
Becoming a Validator
Establish a Keyring and Obtain Funds
Validators are obligated to secure funds for two essential reasons:
- They must allocate funds for self-delegation.
- They should have funds available to cover transaction fees when submitting BLS signature transactions.
Right now, validators can only use the test keyring backend. In the future, Babylon will add support for other secure backends provided by the Cosmos SDK for validators.
babylond keys add wallet
babylond keys add wallet --recover
Request Faucet
Visit the #faucet
channel on the Babylon Discord (opens in a new tab). Example !faucet bbn1eg9w337d55fhfaald34pwlns4yrfamuw5hj47v
.
Validators are required to provide a BLS signature at the conclusion of each epoch. To accomplish this, a validator must possess a BLS key pair for signing information.
babylond create-bls-key $(babylond keys show wallet -a)
The provided command will generate a BLS key and append it to the $HOME/.babylond/config/priv_validator_key.json
file. This file is also used to store the private key used by the validator for signing blocks. It's essential to ensure that this file is adequately secured.
Restart Node
sudo systemctl restart babylond.service
Adjust Configuration
Additionally, you must specify the key name the validator will use to submit BLS signature transactions in the $HOME/.babylond/config/app.toml
file. Simply edit this file and assign the key name that holds funds in your keyring.
sed -i -e "s|^key-name *=.*|key-name = \"wallet\"|" $HOME/.babylond/config/app.toml
Finally, make sure to adjust the timeout_commit
value in the $HOME/.babylond/config/config.toml
file. This setting controls how long a validator waits before finalizing a block and moving to the next one.
sed -i -e "s|^timeout_commit *=.*|timeout_commit = \"10s\"|" $HOME/.babylond/config/config.toml
- Next you need to create a validator, please go here (opens in a new tab)
To become an active validator, you must bond more ubbn tokens than the last validator ranked by tokens bonded (or the validator set to not be full). Additionally, you need to have a minimum of 10,000,000 ubbn tokens bonded.