🌍Babylon Chain: Setting Up Your Validator Node (bbn-test-3)

ilaNihas 🌍
14 min readFeb 24, 2024

--

© by BabylonChain

Following the success of my guide on setting up a Babylon Node for the bbn-test-2 chain from December 29, 2023, I’m here to help you get started with the new bbn-test-3 chain. The Babylon team has announced that this new chain, featuring Bitcoin staking on the testnet, will take over from the old one. This update is big news because it brings in Bitcoin staking on the testnet, showing Babylon is always looking to get better. Whether you’re looking to upgrade your current installation or set up a Babylon validator from the scratch, this guide will walk you through the process.

If you’re not familiar with the Babylon Chain and require an introduction to this project, or simply need a quick refresher, feel free to check out my previous blog post for all the necessary details.

Becoming an active validator on the bbn-test-3 chain means you need to have more ubbn tokens than the last validator on the list, giving you more voting power in the network. This means might need to claim a lot of testnet tokens from the faucet and then delegate them to your node. It’s a tough competition to get enough tokens to be at the top, so make sure you’re ready for the challenge.

To see how many tokens you might need, check out the Babylonscan website. It shows you how the tokens are spread out among validators, which can help you plan your strategy to become an active validator.

Step 1: Order And Configure Your VPS

If you’ve already set up a validator, you can skip this part. Otherwise, you’ll need to rent a VPS (Virtual Private Server) to proceed. Using a VPS offers several advantages, such as enhanced performance, scalability and reliability. I’ll guide you through the process of renting a VPS at a lower cost, and show you how to configure it. Follow the steps below to get your VPS ready for the node installation. Research VPS providers: Take some time to explore different VPS providers available in the market. Consider factors like pricing, reputation, and customer reviews to find the right fit for your needs. Look for plans that offer the appropriate amount of resources (CPU, RAM, storage) to support your node. Contabo is my preferred choice due to their combination of affordable pricing, reliable performance, and user-friendly interface.

I personally use and trust Contabo for my blockchain nodes. I’ve recently joined their affiliate program to recommend their services. If you decide to use my affiliate links for Contabo, you’ll be supporting my work at no extra cost to you. This support is important for continuing our journey together in the fascinating world of crypto, and using these affiliate links is a direct and impactful way to back my efforts. Thank you very much for your support!

Minimum hardware specifications needed for this node:

4 CPU
32 GB RAM
1 TB NVMe

While the new hardware requirements are higher now, I’ll stick with the Cloud VPS 2 package for the time being. However, considering the network’s growth, it might be wise to opt for the Cloud VPS 3 package in the long run.

I will initially select a rental period of 1 month, with the flexibility to extend it later if needed:

Make sure to choose the option “European Union (Germany)”:

For the best storage solution, I recommend selecting the 400GB SSD storage type.

To access Docker with Ubuntu 22.04, navigate to the “Apps & Panels” section and make the appropriate selection:

To prioritize security, I highly recommend to generate a password and securely store it to ensure maximum protection:

For the final step, it’s recommended to leave the sections titled “Object Storage”, “Networking”, and “Add-Ons” in their default state without any modifications. If you are new to Contabo, please create an account; otherwise, login using your existing credentials. Provide your personal data by filling in the required fields. Complete the remaining fields with your personal information, and click the “Next” button to proceed with the payment. After successfully completing the payment for your order, you will receive an initial email. Within approximately 15 minutes, you will receive a second email containing all the information needed to connect to your VPS.

Step 2: Connect To Your VPS via SSH

Download and install most recent edition of PuTTY by visiting the official website:

You will find the IP adress of your VPS in the second email. Launch PuTTY, enter the IP address of your VPS and click “Open”:

Once the server interface is open, you will be prompted to provide login details; simply enter “root” as the user and use your chosen password:

Congratulations! You are now successfully logged into your server:

Step 3a: Preparations — Update Packages

To continue, we can update the packages by running the following commands in the terminal. The first part of the command (sudo apt update) updates the package lists for upgrades, and the second part (sudo apt upgrade -y) actually performs the upgrades with the “-y” flag allowing for automatic confirmation of prompts during the upgrade process:

sudo apt update && sudo apt upgrade -y

Step 3b: Preparations — Install Build Tools


sudo apt -qy install curl git jq lz4 build-essential

Step 4: Backup Your Keys

If you are not already running a validator node, you can move ahead to the next steps. But if you do, it’s important to back up your existing keys.

  1. Navigate to the Configuration Directory: Start by moving to the directory where your Babylon node’s configuration files are stored, by entering the following command in your terminal:
cd /root/.babylond/config/

2. Open and Backup Keys: You’ll find several key files here that are essential for your node’s identity and security. Open each file one at a time with nano, copy its contents, and save them securely on your local computer. Here are the commands to open each file:

# For the address book:
nano addrbook.json

# For the blockchain's initial configuration:
nano genesis.json

# For your node's unique identifier:
nano node_key.json

# For your validator's private key:
nano priv_validator_key.json

3. Move to the Data Directory: Some keys are stored in a different directory. Change to the data directory and back up your validator state, use these command:

cd /root/.babylond/data/
nano priv_validator_state.json

4. Backup Wallet Information: Finally, make sure you have a backup of your wallet information. Navigate to the key ring directory and open the wallet information file:

cd /root/.babylond/key_ring/
nano wallet.info

Step 5: Install GO

Make sure you install the latest version of GO, whether it’s a fresh installation or an update:

ver="1.22.0"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Step 6: Declare Your Moniker Variable

Begin by replacing “YOUR_MONIKER_GOES_HERE” with your desired validator name. This can be either the same as your previous validator or an entirely new one.

export MONIKER=YOUR_MONIKER_GOES_HERE

Step 7: Remove Your Old Installation

Removing your old Babylon node installation is a important step to start fresh or update to the bbn-test-3 chain, especially if you’re transitioning from an earlier version. Whether you’re updating an existing installation or setting up for the first time, executing these commands will ensure a clean state without affecting your system negatively.:

sudo systemctl disable babylon
sudo rm /etc/systemd/system/babylon.service
sudo systemctl daemon-reload
rm -rf $HOME/.babylond
rm -rf babylon
sudo rm -rf $(which babylond)

Step 8: Download And Build Binaries

To get the latest version of the Babylon project and prepare it for installation, you’ll need to clone the project’s repository from GitHub and build the source code.

# Clone project repository
cd $HOME
git clone https://github.com/babylonchain/babylon.git
cd babylon
git checkout v0.8.5

# Build binaries
make build

Step 9: Preparing The Directories And Install Cosmovisor

Preparing the directories and setting up your Babylon node with Cosmovisor ensures smooth upgrades and management. Here’s how to set up the directories and move your BabylonD file correctly:

# Prepare directories
mkdir -p ~/.babylond
mkdir -p ~/.babylond/cosmovisor
mkdir -p ~/.babylond/cosmovisor/genesis
mkdir -p ~/.babylond/cosmovisor/genesis/bin
mkdir -p ~/.babylond/cosmovisor/upgrades

# Install Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

# Move BabylonD file to Cosmovisor directory
mv build/babylond $HOME/.babylond/cosmovisor/genesis/bin/
rm -rf build

# Create application symlinks
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

# Set node CLI configuration
babylond config set client chain-id bbn-test-3
babylond config set client keyring-backend test
babylond config set client node tcp://localhost:20657

Stp 10: Initialize The Node

Initializing your Babylon node involves several important steps to make sure it’s correctly configured to join the network. Here’s a step-by-step guide to properly initialize your node, obtain the necessary genesis file, configure network settings, and set up network peers and seeds. Please execute these commands one at a time in your terminal to avoid any issues:

# Initialize the node:
babylond init $MONIKER --chain-id bbn-test-3

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

# Download addrbook from Nodejumper
curl -L https://snapshots-testnet.nodejumper.io/babylon-testnet/addrbook.json > $HOME/.babylond/config/addrbook.json

# Add seeds
sed -i -e 's|^seeds *=.*|seeds = "8da45f9ff83b4f8dd45bbcb4f850999637fbfe3b@seed0.testnet.babylonchain.io:26656,4b1f8a774220ba1073a4e9f4881de218b8a49c99@seed1.testnet.babylonchain.io:26656,9cb1974618ddd541c9a4f4562b842b96ffaf1446@3.16.63.237:26656,03ce5e1b5be3c9a81517d415f65378943996c864@18.207.168.204:26656,a5fabac19c732bf7d814cf22e7ffc23113dc9606@34.238.169.221:26656,ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@testnet-seeds.polkachu.com:20656,798836777efb5555cfb940129e2073b44f9117e5@141.94.143.203:55706,86e9a68f0fd82d6d711aa20cc2083c836fb8c083@222.106.187.14:56000,326fee158e9e24a208e53f6703c076e1465e739d@babylon-testnet.cosmos-spaces.zone:26659,5e02bb2c9a644afae6109bf2c264d356fad27618@15.165.166.210:26656"|' $HOME/.babylond/config/config.toml

# Change network to signet:
sed -i -e "s|^\(network = \).*|\1\"signet\"|" $HOME/.babylond/config/app.toml

# Set minimum gas price:
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.00001ubbn\"|" $HOME/.babylond/config/app.toml

# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
$HOME/.babylond/config/app.toml

# Change ports
sed -i -e "s%:1317%:20617%; s%:8080%:20680%; s%:9090%:20690%; s%:9091%:20691%; s%:8545%:20645%; s%:8546%:20646%; s%:6065%:20665%" $HOME/.babylond/config/app.toml
sed -i -e "s%:26658%:20658%; s%:26657%:20657%; s%:6060%:20660%; s%:26656%:20656%; s%:26660%:20661%" $HOME/.babylond/config/config.toml

# Download latest chain data snapshot from Nodejumper
curl "https://snapshots-testnet.nodejumper.io/babylon-testnet/babylon-testnet_latest.tar.lz4" | lz4 -dc - | tar -xf - -C "$HOME/.babylond"

Next, let’s focus on setting up the peers. Polkachu has shared a list of 138 active peers, available at this link. For demonstration purposes, I’ll add just 10 peers into my config.toml file. If you encounter any synchronization issues with the Babylon chain, experimenting with various peers from the list until you discover a stable set is advisable. Regularly monitoring and updating your peer list is important, especially if you notice any synchronization difficulties:

# Set peers:
PEERS="56d2c917f551a666496b310faadd88b38685af0b@84.247.163.172:26656,c5063e78072963f0cbc6388bb4a7bb3d77a4e800@161.97.161.20:26668,19e816dece206d37d997b6ba14798ffe2a6d48f3@213.199.46.11:20656,622e09c119a856440e60cb62d01ca500bf1774e2@173.212.216.118:20656,c0dbb8639101cf99f3df80bff6405b87134fd018@194.163.133.53:26656,a5df6bacac3e3f13abfb042cd5f903a70abb7179@144.91.87.204:20656,e3410ef295b3b3366867789a218336a31a11d5c7@213.199.38.74:26656,79574e7b3a38d5258fe474665bb93c347f653548@213.199.50.102:26656,3d9388e82d76fa4c49c59677b360237552a147a7@109.199.111.55:26656,6c70ab8f7f2be0b15646d00da9da6980b5ab2063@193.87.163.5:16456"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.babylond/config/config.toml

Part 11: Create The Corresponding Service

Creating a systemd service for your Babylon node ensures it can run as a background service, automatically start on boot, and restart in case of failure. Here’s how to set up the service correctly:

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

To finalize the setup and ensure your Babylon node service is active and set to start automatically on your system’s boot, follow these steps:

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

Part 12: Check The Logs

Check the Service Status: Use this command to see if the babylond service is active and running without errors. This will provide information about the service’s status, including whether it’s active, loaded, and running.

systemctl status babylond

View the Logs: To monitor the babylond service's logs in real-time and check for any errors or important messages, run:

sudo journalctl -u babylond.service -f --no-hostname -o cat

If you encounter errors like “ERR Stopping peer for error err=EOF,” it’s generally safe to ignore them initially. Over time, your node’s address book will adjust, connecting only to reliable peers.

Check the Sync Status: To verify if your node has completed syncing with the blockchain, use:

babylond status | jq

When catching_up is false, your node is fully synced and ready for the next steps. This indicates that your Babylon node is up-to-date with the latest blockchain state and can participate in the network. The output will look like this:

To verify your Babylon node’s synchronization with the network, check its latest_block_height and compare this value to the latest block height listed on the Babylonscan website. A close or matching block height indicates your node is fully synced and up-to-date with the network.

Part 13: Create Or Import Your Wallet

If you’ve previously participated in bbn-test-2, you can import the mnemonic phrase to link the staker’s wallet account. Use the babylond keys add command with the --recover option to import your wallet using the mnemonic phrase. Replace <your_old_Wallet_name> with your old wallet name, which is probably named “wallet”:

babylond keys add "<your_old_wallet_name>" --recover

The output will look like this. Also, make sure to enter a keyring passphrase of your choice:

If this is your first time running any testnets, you’ll need to create a new wallet by executing:

babylond keys add wallet

Make sure to securely save your seed phrase provided during the wallet creation process, as it’s important for recovering your wallet in the future.

Part 14: Obtain Funds from the Babylon Testnet Faucet

To receive funds, visit the #faucet channel on the official Babylon Discord server. Here, you can request funds by sharing the address you previously created. Please note, in order to access the #faucet channel, you first need to visit the “get-a-role” channel and react with the “Computer” emoji. This action will grant you the necessary permissions to view the #faucet channel. Once in the channel, submit your request by typing !faucet followed by your address. For instance, you would type this to request funds for that specific address:

!faucet bbn16yzx3zfucs6fxu4hw3ack6ht4hgsp9wqrly2c9

You can check your wallet balance using this command:

babylond q bank balances $(babylond keys show wallet -a)

Ensure that you have successfully received 1,100,000 ubbn. Please be aware that you can only claim 1 BBN from the faucet every 24 hours.

Part 15: Generate a BLS Key Pair

As a validator, you are required to provide a BLS signature at the conclusion of each epoch. For this purpose, it’s essential to possess a BLS key pair, which will be used for signing information. This should be done using the address that was established in the preceding step.

babylond create-bls-key $(babylond keys show wallet -a)

Executing this command will generate a BLS key, which will then be stored in the $HOME/.babylond/config/priv_validator_key.json file. This file also contains the private key used by the validator for block signing. It's crucial to secure this file adequately to maintain the integrity and security of your validator operations. After creating a BLS key, you need to restart your node to load this key into memory. Restart your BabylonD service after this step:

sudo systemctl stop babylond
sudo systemctl start babylond

Part 16: Create the Validator

For the bbn-test-3 phase, creating a validator.json file with your validator details is a new requirement. Here's how to create and populate this file, and then use it to set up your validator. Make sure to replace placeholders with your actual information. Execute the following command. This will create a validator.json file in your home directory with your validator details:

sudo tee ~/validator.json > /dev/null <<EOF
{
"pubkey": $(babylond tendermint show-validator),
"amount": "1000000ubbn",
"moniker": "your_moniker",
"website": "https://yourwebsite.com",
"security": "contact@gmail.com",
"details": "description of your validator",
"commission-rate": "0.10",
"commission-max-rate": "0.20",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
EOF

Ensure you replace your_moniker, https://yourwebsite.com, contact@gmail.com, and "description of your validator" with your actual moniker, website, email address, and validator description. With the validator.json file ready, use the following command to create your validator on the blockchain. This command references the JSON file for validator details and executes the transaction to register your validator on the bbn-test-3 network:

babylond tx checkpointing create-validator ~/validator.json \
--chain-id="bbn-test-3" \
--gas="auto" \
--gas-adjustment="1.5" \
--gas-prices="0.025ubbn" \
--from=wallet

After executing the command to create your validator, the terminal will display a transaction. Make sure there are no error messages.

On the Babylon chain, becoming a validator is tied to the epoch cycle, with each epoch up to 1–2 hours on the testnet. To view your validator’s address, use:

babylond keys show wallet -a --bech val

To query your validator’s status information, run:

babylond query staking validator wallet

If your validator has been successfully created, the output from these commands will confirm its active status and provide relevant details such as your validator’s address and status information.

Also, you can verify and view your validator’s presence and status on the Babylonscan blockchain explorer by navigating to their website and searching for your moniker:

To delegate tokens to your node use the following command:

babylond tx epoching delegate $(babylond keys show wallet --bech val -a) 1000000ubbn --from wallet --chain-id bbn-test-3 --gas-adjustment 1.2 --gas 500000 --fees 10ubbn -y

As always, I recommend staying informed about Babylon by following their updates on Twitter and joining their Discord community. This way, you can keep up with all the latest news and information. For troubleshooting, consult the official documentation first, and if needed, seek assistance on the official Discord server or feel free to reach out to me directly on our Discord community.

Part 17: Bonus

The Babylon project is offering an exclusive opportunity to earn the first Babylon Beacon Badge NFT by completing specific tasks on Galxe, as part of their community collection. This unique initiative is open until March 5, 2024, and aims to engage the community in the ecosystem’s growth. Don’t miss this chance to be part of Babylon’s history and secure your Series 1 NFT by actively participating in the community tasks on Galxe.

Hey everyone, I’m excited to share that I’ve partnered with Dotcom Canvas, a standout German brand known for its exquisite crypto-themed wall art. Their acrylic glass pieces are particularly impressive.

Discover their unique collection via my affiliate link. For a special treat, use the code CRYPTOTRIBE at checkout to get a 15% discount. To see these art pieces in their full glory, take a peek at this promotional video. It’s a great way to visualize how they could elevate your space.

Let’s enjoy some awesome crypto art together!

Disclosure: By using my affiliate link for purchases, I receive a commission.

About me

Hi! I’m ilaNihas, a big football fan (or soccer, if you prefer). After 13 years in IT, I paused my career to explore crypto, blockchain, and Web3. I’m fascinated by the potential and constantly searching for interesting projects, airdrops, and new nodes to explore. Join me as I combine my passions for sports, writing, and tech. Let’s dive into the world of crypto and blockchain together!

Thanks for reading! Please share your feedback in a comment and follow me on my socials if you enjoyed the article. I’ve also set up a Discord community where we can get together and have discussions about interesting crypto-related topics. You’re welcome to join us and be part of the conversation → https://discord.gg/zN4dH35JJZ

Disclaimer

Please note that the content provided on this blog is intended solely for educational, informational, and entertainment purposes and should not be considered as financial advice. In summary, always do your own research, evaluate the information critically, and seek professional advice when necessary. Stay informed, exercise caution, and make well-informed decisions based on your own unique circumstances.

--

--

ilaNihas 🌍

Crypto reptile | Join us on this ride through the cryptoverse, as we explore the strangest corners of the blockchain -> https://discord.gg/zN4dH35JJZ