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 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0c9b468
Create README.md
samricotta Oct 26, 2024
fa80df0
Update README.md
samricotta Oct 30, 2024
72e3b67
Update README.md
samricotta Oct 30, 2024
12bf5c0
Update README.md
samricotta Oct 30, 2024
a652464
Update README.md
samricotta Oct 30, 2024
bbb9eed
Update README.md
samricotta Oct 30, 2024
f2d4734
Update README.md
samricotta Oct 31, 2024
0d86a88
Update README.md
samricotta Nov 12, 2024
a21af5e
Update pages node and validator
samricotta Nov 15, 2024
f2a855b
update to formatting
samricotta Nov 15, 2024
25c8d75
Update README.md
samricotta Nov 15, 2024
17c63eb
Update README.md
samricotta Nov 15, 2024
931b9b5
Review comments part 1
samricotta Nov 18, 2024
43a0dc7
Update README.md
samricotta Nov 19, 2024
b9de762
Update README.md
samricotta Nov 19, 2024
9c5d79f
Update README.md
samricotta Nov 19, 2024
eaf6943
updates to secuity and monitoring
samricotta Nov 20, 2024
d3765c7
update security and monitoring
samricotta Nov 20, 2024
35145f8
networks landing page
samricotta Nov 20, 2024
c887828
review updates
samricotta Nov 22, 2024
b1ccfcf
update sections - review
samricotta Nov 22, 2024
0974f3b
Update README.md
samricotta Nov 22, 2024
30dd52d
update docs
samricotta Nov 27, 2024
35b58e5
WIP
samricotta Nov 27, 2024
225c88a
comments
samricotta Nov 27, 2024
82be18b
fix table of contents
samricotta Nov 27, 2024
81405cd
edits
samricotta Nov 27, 2024
6d7bf4d
Update README.md
samricotta Nov 27, 2024
7def697
update
samricotta Nov 27, 2024
312803e
Update README.md
samricotta Nov 27, 2024
c61ec3f
node guide updates
vitsalis Nov 27, 2024
027ac27
more updates
vitsalis Nov 27, 2024
0a7beab
Updates from review
samricotta Nov 28, 2024
700b0b2
Part 1 of review comments
samricotta Dec 2, 2024
43fe9b6
Update README.md
samricotta Dec 3, 2024
38ffac4
Update README.md
samricotta Dec 4, 2024
a63f477
Update README.md
samricotta Dec 4, 2024
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 -->
269 changes: 269 additions & 0 deletions bbn-test-5/babylon-node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
# Babylon Node Setup

## Table of Contents

1. [Install Babylon Binary](#install-babylon-binary)
2. [Setup Node Home Directory and Configure](#setup-your-node-home-directory-and-configuration)
samricotta marked this conversation as resolved.
Show resolved Hide resolved
4. [Create Keys](#create-keys)
samricotta marked this conversation as resolved.
Show resolved Hide resolved
5. [Sync Node](#sync-node)
6. [Get Funds](#get-funds)


## Install Babylon Binary

1. Install [Golang 1.21](https://go.dev/dl)
samricotta marked this conversation as resolved.
Show resolved Hide resolved
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

You should expect to see the following output:

```shell
# Build output will show:
go install -mod=readonly -tags "netgo ledger mainnet" \
-ldflags '\
-X github.com/cosmos/cosmos-sdk/version.Name=babylon \
-X github.com/cosmos/cosmos-sdk/version.AppName=babylond \
-X github.com/cosmos/cosmos-sdk/version.Version=v0.13.0 \
-X github.com/cosmos/cosmos-sdk/version.
Commit=976e94b926dcf287cb487e8f35dbf400c7d930cc \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" \
-w -s' \
-trimpath ./...
```
samricotta marked this conversation as resolved.
Show resolved Hide resolved

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
```
samricotta marked this conversation as resolved.
Show resolved Hide resolved

## 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 two important configuration files:
samricotta marked this conversation as resolved.
Show resolved Hide resolved

1. First, open `app.toml` and update these essential settings from what is auto-generated:
samricotta marked this conversation as resolved.
Show resolved Hide resolved

```shell
# Base configuration
minimum-gas-prices = "0.005ubbn"
samricotta marked this conversation as resolved.
Show resolved Hide resolved
iavl-cache-size = 0
samricotta marked this conversation as resolved.
Show resolved Hide resolved
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"
samricotta marked this conversation as resolved.
Show resolved Hide resolved
```

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
samricotta marked this conversation as resolved.
Show resolved Hide resolved
tar -xjf genesis.tar.bz2 && rm genesis.tar.bz2
mv genesis.json ~/<path>/config/genesis.json #insert your --home <path>
samricotta marked this conversation as resolved.
Show resolved Hide resolved
```

>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.

## Create Keys

Keys are a fundamental component of your node's identity within the
Babylon network. This cryptographic key-pair serves multiple critical functions:
it allows you to interact with the network, send transactions, and manage your account.
Creating and securing your keys is one of the most important steps in setting up your node.

To generate your key, use the following command:

```shell
babylond --keyring-backend test keys add <name> --home <path>
```

The `<name>` specifies a unique identifier for the key.
The `--home` flag specifies the directory where your node files are
stored (the same path used in the initialization step e.g. `--home ./nodeDir`).

In this example, we use `--keyring-backend test`, that specifies
the usage of the `test` backend which stores the keys unencrypted on disk.

Alternatively, there are three options for the keyring backend:

- `test`: Stores keys unencrypted on disk. It’s meant for testing purposes and
should never be used in production.
- `file`: Stores encrypted keys on disk, which is a more secure option than test but
less secure than using the OS keyring.
- `os`: Uses the operating system's native keyring, providing the highest level of
security by relying on OS-managed encryption and access controls.

The execution result displays the address of the newly generated key and its
public key. Following is a sample output for the command:

```shell
- address: bbn1kvajzzn6gtfn2x6ujfvd6q54etzxnqg7pkylk9
name: <name>
pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey",
key: "Ayau+8f945c1iQp9tfTVaCT5lzhD8n4MRkZNqpoL6Tpo"}'
type: local
```

Make sure to securely store this information, particularly your
address and private key details. Losing access to these credentials
would mean losing access to your account and any funds associated with it.

## 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

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.

## Get Funds
samricotta marked this conversation as resolved.
Show resolved Hide resolved

To interact with the Babylon network, you'll need some BBN tokens to:
1. Pay for transaction fees (gas)
2. Send transactions
3. Participate in network activities

You can obtain testnet tokens through two methods:

1. Request funds from the Babylon Testnet Faucet
[here](#tbd)
<!-- add link to faucet -->
2. Join our Discord server and visit the #faucet channel:
samricotta marked this conversation as resolved.
Show resolved Hide resolved
[Discord Server](https://discord.com/channels/1046686458070700112/1075371070493831259)

Note: These are testnet tokens with no real value, used only for testing
and development purposes.

## Monitoring Your Node

Your Babylon node exposes metrics through two Prometheus endpoints:
- Port 1317: API metrics
- Port 26660: Tendermint metrics
samricotta marked this conversation as resolved.
Show resolved Hide resolved

To enable metric collection, modify your `app.toml`:
```
[telemetry]
enabled = true
prometheus-retention-time = 60
samricotta marked this conversation as resolved.
Show resolved Hide resolved
[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 RPC endpoints in `app.toml` and `config.toml`
samricotta marked this conversation as resolved.
Show resolved Hide resolved
- 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
- Implement regular security patches
samricotta marked this conversation as resolved.
Show resolved Hide resolved

4. **Performance Considerations**
- The node handles approximately 2,500 RPS on basic endpoints
samricotta marked this conversation as resolved.
Show resolved Hide resolved
- 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