Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: testnet 5 documentation for Babylon validators #369

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# Networks
# Babylon Networks

This repository contains information about networks launched by Babylon Labs.
Welcome to the Babylon Networks repository. This is your central hub
for network participation information, whether you're running a node,
operating as a validator, providing finality services, or participating
in the covenant committee.


## Network Participants

### Node Operators
Run a Babylon node to participate in the network
- [Node Setup Guide](babylon-node/README.md)

### Validators
Help secure the network by running a validator node and participating in consensus.
- [Validator Setup Guide](babylon-validators/README.md)

### Finality Providers
Provide finality services for the Babylon network.
- [Registration and Phase 2 Guide](https://github.com/babylonlabs-io/finality-provider/blob/sam/docs-fp/docs/finality-provider-phase2.md)
- [Network Information](finality-providers/README.md)
- [Finality Provider Registry](finality-providers/registry/)
- [Finality Provider Signatures](finality-providers/sigs/)
<!-- add the registry and sigs in when we have it -->

### Covenant Committee
Information for the Babylon Bitcoin Covenant Committee.
- [Committee Overview](covenant-committee/README.md)

## Additional Resources
- [Documentation](https://docs.babylonlabs.io)
- [Discord Community](https://discord.gg/babylonchain)
- [GitHub Repository](https://github.com/babylonlabs-io)

<!-- update links when we have them -->
196 changes: 196 additions & 0 deletions bbn-test-5/babylon-node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Babylon Node Setup

# Babylon Node Setup

## Table of Contents

1. [Install Babylon Binary](#install-babylon-binary)
2. [Setup Node Home Directory and Configuration](#setup-your-node-home-directory-and-configuration)
3. [Sync Node](#sync-node)
4. [Monitoring Your Node](#monitoring-your-node)
5. [Security Recommendations](#security-recommendations)
6. [Next Steps](#next-steps)

## Install Babylon Binary

1. Install [Golang 1.23](https://go.dev/dl)
2. Verify installation:

```shell
go version
```

3. Clone and build Babylon:
```shell
git clone [email protected]:babylonlabs-io/babylon.git
cd babylon
git checkout bbn-test-5
make install
```
<!-- TODO: testnet tag to be defined -->
This command does the following:
- Builds the daemon
- Compiles all the Go packages in the project
- Installs the binary
- Makes the `babylond` command globally accessible from your terminal

Now that the binary has been successfully installed,
let's check the available actions through the `babylond` command:

```shell
babylond
Available Commands:
add-genesis-account Add a genesis account to genesis.json
collect-gentxs Collect genesis txs and output a genesis.json file
comet CometBFT subcommands
config Utilities for managing application configuration
...
```

If the `babylond` command isn't found, ensure `$GOPATH/bin` is in your shell's
`$PATH`. Add it with:

```shell
echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.profile
```
Comment on lines +50 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a cross-platform command?


## Setup your node, home directory, and configuration

Initialize your node and create the necessary configuration directory.
This command will generate several important configuration files
including `app.toml`, `client.toml`, and `genesis.json`:

```shell
babylond init <moniker> --chain-id bbn-test-5 --home <path>
```

The `<moniker>` is a unique identifier for your node (e.g. `node0`).
The `--home` flag specifies the directory where your node files will be stored (e.g. `--home ./nodeDir`).

After initialization, you'll need to modify the following configuration files:

1. First, open `app.toml` and update these the following settings:

```shell
# Base configuration
minimum-gas-prices = "0.005ubbn"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we should explain that these settings will disable IAVL cache to make the node utilize less memory.
In case of a node that will serve heavy RPC query load, these settings shouldn't be used.

iavl-cache-size = 0
iavl-disable-fastnode=true
samricotta marked this conversation as resolved.
Show resolved Hide resolved

[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
```

Navigate to `config.toml`. Add in your seed, as shown below:

```shell
#P2P Configuration Options

# Comma separated list of seed nodes to connect to
seeds = "[email protected]:26656" # This is only an example of the testnet seed and should be replaced with the actual seed node.
```
Please head to [Nodes.Guru](https://nodes.guru) for the latest seed node.
<!-- update with link to seed node when available -->

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 get it from:

1. The official Babylon Networks repository: [bbn-test-5](https://github.com/babylonlabs-io/networks/tree/main/bbn-test-5)

2. Or download directly using these commands:

```shell
wget https://github.com/babylonlabs-io/networks/raw/main/bbn-test-5/genesis.tar.bz2 # TODO: update this file name if necessary
tar -xjf genesis.tar.bz2 && rm genesis.tar.bz2
mv genesis.json <path>/config/genesis.json #insert your --home <path>
```

>Note: Verify that the `chain-id` in the genesis file matches the one used in
your initialization command (`bbn-test-5`). This ensures your node connects
to the correct network.

## Sync Node

We are now ready to sync the node.
samricotta marked this conversation as resolved.
Show resolved Hide resolved

```shell
babylond start --chain-id bbn-test-5 --home <path> --x-crisis-skip-assert-invariants
```

Lets go through the flags of the above command:

- `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
is dependant on where the files were generated for you from the initialization (e.g. `--home ./nodeDir`)

### Options for Syncing
samricotta marked this conversation as resolved.
Show resolved Hide resolved
<!-- TODO: update accordingly with the new sync method when available -->

You have two options for syncing your node:

1. **Sync through Network Peers**
- Use the seed node configuration mentioned earlier in `config.toml`
- Additional peers can be added under the `persistent_peers` setting
<!-- Add peer list when available -->

2. **Sync from Snapshot**
- For faster syncing, you can use a snapshot instead of syncing from genesis
- Snapshots are periodic backups of the chain state
- Find available snapshots at: <!-- Add link when available -->

>Note: Always verify snapshot sources and checksums before using them to ensure security.

## Monitoring Your Node

Your Babylon node exposes metrics through two Prometheus endpoints:
- `Port 1317`: API metrics
- `Port 26660`: CometBFT metrics

To enable metric collection, modify your `app.toml`:
```
[telemetry]
enabled = true
prometheus-retention-time = 600 # 10 minutes
[api]
enable = true
address = "0.0.0.0:1317"
```

Basic health monitoring should check:
- Node synchronization status
- Block height compared to network
- Connected peers count
- System resource usage (CPU, RAM, Disk)

## Security Recommendations

1. **Secure Key Management**
- Store keys in a separate, encrypted storage system
- Currently no secure keyring backend is supported for production use
- Offline backups

2. **Network Security**
- Only expose necessary gRPC, REST, and CometBFT Endpoints in app.toml and config.toml
as seen [here](https://docs.cosmos.network/main/learn/advanced/grpc_rest)
- Configure rate limiting in your reverse proxy (nginx/caddy) for public endpoints
- Use SSL/TLS certificates when exposing endpoints externally

3. **System Security**
- Keep the host system updated
- Monitor system logs for suspicious activity

4. **Performance Considerations**
- The node handles approximately 2,500 RPS on the native Cosmos SDK RPC endpoints
- Monitor resource usage during peak periods
- Ensure adequate disk space for chain growth
- Set up alerts for resource thresholds

## Next Steps

For information about becoming a Finality Provider in the Babylon network,
samricotta marked this conversation as resolved.
Show resolved Hide resolved
see our [Finality Provider Guide](../babylon-validators/README.md).
Loading