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

chore: remove whitespaces and recomendation to zero cache #448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
82 changes: 40 additions & 42 deletions bbn-test-5/babylon-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
2. [Sync from scratch](#32-sync-from-scratch)
4. [Start the node](#4-start-the-node)

## 1. Install Babylon Binary
## 1. Install Babylon Binary

Installing the Babylon binary requires a Golang installation.

Expand All @@ -31,14 +31,14 @@ cd babylon
# you want to install -- depends on which
# height you sync from
git checkout <tag>
# we use this to ensure that the testnet-specific upgrade data
# we use this to ensure that the testnet-specific upgrade data
# are included in the binary
BABYLON_BUILD_OPTIONS="testnet" make install
BABYLON_BUILD_OPTIONS="testnet" make install
```
<!-- TODO: testnet tag to be defined -->
This command does the following:
- Builds the daemon
- Installs the binary
- Installs the binary
- Makes the `babylond` command globally accessible from your terminal

You can verify your installation by executing the `version` command:
Expand All @@ -47,20 +47,20 @@ 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,
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:
```shell
echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.profile
```shell
echo 'export PATH=$HOME/go/bin:$PATH' >> ~/.profile
```

Make sure to restart your terminal session after running the above command.

## 2. Set up your node, home directory, and configuration

In this section we will initialize your node and create the necessary
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
This command will generate several important configuration files
including `app.toml`, `client.toml`, and `genesis.json`:

```shell
Expand All @@ -70,7 +70,7 @@ babylond init <moniker> --chain-id bbn-test-5 --home <path>
Parameters:
- `<moniker>`: A unique identifier for your node for example `node0`
- `--chain-id`: The chain ID of the Babylon chain you connect to
- `--home`: *optional* flag that specifies the directory where your
- `--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/`
Expand All @@ -85,9 +85,6 @@ After initialization, you'll need to modify the following configuration files:
# Minimum gas prices that this node will accept
minimum-gas-prices = "0.002ubbn"

iavl-cache-size = 0
iavl-disable-fastnode = true

[btc-config]

# Configures which bitcoin network should be used for checkpointing
Expand All @@ -96,20 +93,14 @@ network = "signet" # The Babylon testnet connects to the signet Bitcoin network
```

Parameters:
- `minimum-gas-prices`: The minimum gas price your node will accept for
transactions. The Babylon protocol enforces a minimum of `0.002ubbn` and
- `minimum-gas-prices`: The minimum gas price your node will accept for
transactions. The Babylon protocol enforces a minimum of `0.002ubbn` and
any transactions with gas prices below your node's minimum will be rejected.
- `iavl-cache-size`: Default is `781250`. 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
- `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
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.

2. On `config.toml`, update the the following settings:
Expand All @@ -129,19 +120,19 @@ timeout_commit = "10s"
```

Parameters:
- `seeds`: Comma separated list of seed nodes that your node will connect to for
- `seeds`: Comma separated list of seed nodes that your node will connect to for
discovering other peers in the network; you can obtain seed endpoints from
[here](../README.md#seed-nodes)
- `persistent_peers`: Comma separated list of nodes that your node will use as
persistent peers; you can obtain peers from [here](../README.md#peers)
- `timeout_commit`: The Babylon network block time has to be set to
- `timeout_commit`: The Babylon network block time has to be set to
**10 seconds**

Note: You can use either seeds, persistent peers or both.

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](../README.md#genesis) or use the
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](../README.md#genesis) or use the
following commands to download it directly:

```shell
Expand All @@ -150,7 +141,7 @@ mv genesis.json <path>/config/genesis.json # You must insert the home directory
```

## 3. Prepare for sync
Before starting your node sync, it's important to note that the initial release
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 two options you can choose from when syncing:
Expand All @@ -159,9 +150,9 @@ There are two options you can choose from when syncing:

### 3.1. Sync through a network snapshot

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
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](../README.md#state-snapshot).
Expand All @@ -181,15 +172,15 @@ After importing the state, you can now start your node as specified in section

### 3.2. Sync from scratch

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
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
This will require you to use different `babylond` binaries for each version and
perform the babylon software upgrade when needed.

1. First, follow the installation steps in [Section 1](#1-install-babylon-binary)
using the genesis software version `v0.9.0` in place of `<tag>`.
using the genesis software version `v0.9.0` in place of `<tag>`.

2. Start your node as specified in section [Start the node](#4-start-the-node).

Expand All @@ -198,7 +189,14 @@ Your node will sync blocks until it reaches a software upgrade height.
At that point, you will have to perform the steps matching the corresponding
[upgrade height](./upgrades/README.md).

You will have to go over all the software upgrades until you sync with the
Note: When building the upgrade binary, include the following build flag so that
testnet-specific upgrade data are included in the binary:

```shell
BABYLON_BUILD_OPTIONS="testnet" make install
```

You will have to go over all the software upgrades until you sync with the
full blockchain.

## 4. Start the node
Expand All @@ -212,10 +210,10 @@ babylond start --chain-id bbn-test-5 --home <path> --x-crisis-skip-assert-invari
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
- `--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
- `--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.
Loading