Installing the Babylon binary requires a Golang installation.
Install Golang 1.23 by following the instructions here
Once installed, to verify your installation, run:
go version
Next, clone the Babylon codebase and install the Babylon binary:
git clone [email protected]:babylonlabs-io/babylon.git
cd babylon
# tag corresponds to the version of the software
# you want to install -- depends on which
# height you sync from
git checkout <tag>
make install
This command does the following:
- Builds the daemon
- Installs the binary
- Makes the
babylond
command globally accessible from your terminal
You can verify your installation by executing the version
command:
babylond version
If your shell cannot find the installed binary, make sure $GOPATH/bin
is in
your shell's $PATH
. Use the following command to add it to your profile,
depending on your shell:
echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.profile
Make sure to restart your terminal session after running the above command.
In this section we will initialize your node and create the necessary
configuration directory through the init
command.
This command will generate several important configuration files
including app.toml
, client.toml
, and genesis.json
:
babylond init <moniker> --chain-id bbn-test-5 --home <path>
Parameters:
<moniker>
: A unique identifier for your node for examplenode0
--chain-id
: The chain ID of the Babylon chain you connect to--home
: optional flag that specifies the directory where your node files will be stored, for example--home ./nodeDir
The default home directory for your Babylon node is:- Linux/Mac:
~/.babylond/
- Windows:
%USERPROFILE%\.babylond\
- Linux/Mac:
After initialization, you'll need to modify the following configuration files:
- On
app.toml
, update the the following settings:
# Base configuration
# Minimum gas prices that this node will accept
minimum-gas-prices = "0.005ubbn"
iavl-cache-size ="5000" # will result in 3GB of memory usage
iavl-disable-fastnode=false
[btc-config]
# Configures which bitcoin network should be used for checkpointing
# valid values are: [mainnet, testnet, simnet, signet, regtest]
network = "signet" # The Babylon testnet connects to the signet Bitcoin network
Parameters:
minimum-gas-prices
: The minimum gas price (in this example we use0.005ubbn
) that your node will accept for transactions. Transactions with lower gas prices will be rejected.iavl-cache-size
: Default is "5000" (uses ~3GB of memory). Setting to 0 disables the IAVL tree caching, which reduces memory usage but significantly impacts RPC query performance.iavl-disable-fastnode
: Default is false. Setting to true disables the fast node feature, which reduces memory usage but significantly impacts RPC query performance.btc-config.network
: Specifies which Bitcoin network to connect to for checkpointing. For testnet-5, we use "signet" which is Bitcoin's test network.
Note: If you're running a validator or RPC node that needs to handle queries, it's recommended to keep these default values for optimal performance. Only adjust these if you're running a node with limited memory resources.
- On
config.toml
, populate your seed nodes using entries from the network page:
# P2P Configuration Options
# This is only an example and should be replaced with actual testnet seed
# nodes.
# Comma separated list of seed nodes to connect to
seeds = "[email protected]:26656"
Parameters:
seeds
: Comma separated list of seed nodes that your node will connect to for discovering other peers in the network
Next, you'll need to obtain the network's genesis file. This file contains the initial state of the blockchain and is crucial for successfully syncing your node. You can inspect the file here or use the following commands to download it directly:
wget https://github.com/babylonlabs-io/networks/raw/main/bbn-test-5/genesis.tar.bz2
tar -xjf genesis.tar.bz2 && rm genesis.tar.bz2
mv genesis.json <path>/config/genesis.json # You must insert the home directory of your node
Before starting your node sync, it's important to note that the initial release
at genesis was v0.9.0
, while subsequently there have been software upgrades.
There are three options you can choose from when syncing:
- Sync through a network snapshot (fastest method)
- Sync through state sync (quick catch-up without full history)
- Sync from scratch (complete sync from block 1)
Snapshot syncing is the fastest way to get your node up to date with the network. A snapshot is a compressed backup of the blockchain data taken at a specific height. Instead of processing all blocks from the beginning, you can download and import this snapshot to quickly reach a recent block height.
You can obtain the network snapshot here.
To extract the snapshot, utilize the following command:
tar -xvf bbn-test-5.tar.gz -C <path>
Parameters:
bbn-test-5.tar.gz
: Name of the compressed blockchain snapshot file<path>
: Your node's home directory
After importing the state, you can now start your node as specified in section Start the node.
State sync downloads only the current blockchain state (account balances, validator set, and module states) instead of processing the entire chain history. While this means you won't have historical data, state sync allows your node to quickly catch up to the current state without downloading and verifying the entire blockchain history. To find the state-sync server from our networks homepage.
To utilize state sync, you'll need to update a few flags in your config.toml
:
[statesync]
enable = true
rpc_servers = "Y"
trust_height = X
trust_hash = "Z"
Parameters:
enable
: Activates state sync functionalityrpc_servers
: List of RPC servers to fetch state sync data fromtrust_height
: Block height to trust for state synctrust_hash
: Block hash corresponding to the trusted height
You can find the current state sync configuration values on our networks homepage.
Once configured, proceed to Start the node.
Lastly, you can also sync from scratch, i.e., sync from block 1
. Syncing from
scratch means downloading and verifying every block from the beginning
of the blockchain (genesis block) to the current block.
This will require you to use different babylond
binaries for each version and
perform the babylon software upgrade when needed.
-
First, follow the installation steps in Section 1 using the genesis software version
v0.9.0
in place of<tag>
. -
Start your node as specified in section Start the node.
Your node will sync blocks until it reaches an upgrade height.
At that point, you will have to get the new software version defined by that height, and go back to step (1) in order to install it and restart.
You will have to repeat the above two steps until you sync with the full blockchain.
You can start your node using the following command:
babylond start --chain-id bbn-test-5 --home <path> --x-crisis-skip-assert-invariants
Parameters:
start
: This is the command to start the Babylon node.--chain-id
: Specifies the ID of the blockchain network you're connecting to.--home
: Sets the directory for the node's data and configuration files and dependent on where the files were generated for you from the initialization (e.g.--home ./nodeDir
)--x-crisis-skip-assert-invariants
: Skips state validation checks to improve performance. Not recommended for validator nodes.
Congratulations! Your Babylon node is now set up and syncing blocks.