Skip to content

Commit

Permalink
bsc: better alignment and merge of node types (bnb-chain#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
emailtovamos authored Nov 15, 2024
1 parent c5e99a4 commit d53e3d7
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 138 deletions.
59 changes: 57 additions & 2 deletions docs/bnb-smart-chain/developers/node_operators/archive_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,65 @@ Running an archive node will take a high cost as it includes all the block and s

### Run with an Erigon client

[Erigon](https://github.com/node-real/bsc-erigon) now supports the BSC mainnet. The latest version allows you to sync an archive node from scratch in just 3 days, using 4.3 TB of disk space. You can use Erigon to operate an archive node; for more information, please refer to the [Erigon Node](./erigon_node.md).
[Erigon](https://github.com/node-real/bsc-erigon) now supports the BSC mainnet. The latest version allows you to sync an archive node from scratch in just 3 days, using 4.3 TB of disk space. You can use Erigon to operate an archive node as shown below.


### Run with a Reth client

[Reth](https://github.com/bnb-chain/reth) now supports the BSC network and demonstrates superior performance compared to Geth and Erigon in recent benchmark tests. You can utilize reth to operate an archive node; for more information, refer to [Reth Node](./reth_node.md).
[Reth](https://github.com/bnb-chain/reth) now supports the BSC network and demonstrates superior performance compared to Geth and Erigon in recent benchmark tests. You can utilize reth to operate an archive node (as well as full node); for more information, refer to [Full Node](./full_node.md).



---
title: BSC Erigon Node Deployment Guide
---

### BSC Erigon Node Deployment

BSC Erigon, maintained by the Node Real team, is a fork of Erigon aimed at becoming the premier archive node implementation for the BSC network.

## Hardware Requirements

To ensure optimal performance of your BSC Erigon node, we recommend the following hardware specifications:

* RAM: 64GB or more (higher RAM correlates with better performance)
* Storage: SSD or NVMe
- Archive Node: Minimum 5TB
- Fast Node: Minimum 700GB

## BSC Erigon Node Deployment Steps

### 1. Obtain the Erigon Binary

Option 1: Build from source
```shell
git clone https://github.com/node-real/bsc-erigon.git
cd bsc-erigon
make erigon
```
Option 2: Use Docker image
```shell
docker pull ghcr.io/node-real/bsc-erigon:${latest_version}
```
### 2. Launch the Erigon Node
By default, the node will run in archive mode. Syncing from scratch typically takes about 3 days.
```shell
./build/bin/erigon \
--datadir="<your_data_directory_path>" \
--chain=bsc \
--port=30303 \
--http.port=8545 \
--authrpc.port=8551 \
--torrent.port=42069 \
--private.api.addr=127.0.0.1:9090 \
--http --ws \
--http.api=eth,debug,net,trace,web3,erigon,bsc
```
**Note**: To avoid port conflicts, specify different ports for each chain if running multiple instances.

### 3. Running a Fast Node (Non-Archive Mode)
Add the --prune.mode=minimal flag to start a fast node. This mode retains only the last 3 days of state and block data, supporting debug_trace* operations for the past 3 days.

If you prefer not to spend days syncing, you can obtain fast node snapshots from [community-maintained repositories](https://github.com/48Club/bsc-snapshots).

By following these steps, you can flexibly deploy either a full BSC Erigon node or a fast node based on your requirements. Whichever option you choose, BSC Erigon will provide you with an efficient and reliable node service.
53 changes: 0 additions & 53 deletions docs/bnb-smart-chain/developers/node_operators/erigon_node.md

This file was deleted.

4 changes: 4 additions & 0 deletions docs/bnb-smart-chain/developers/node_operators/fast_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ EnableMsgEvents = false
## start a fast node
./geth --tries-verify-mode full --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0
```


### Additional Fast Node Option (Erigon)
Refer to the Erigon documentation for running a fast node using Erigon.
76 changes: 76 additions & 0 deletions docs/bnb-smart-chain/developers/node_operators/full_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,79 @@ Please read [this guide](node_maintenance.md)
## Upgrade Geth
Please read [this guide](upgrade_geth.md)
---
title: Reth Node - BSC Develop
---
# Reth Node for BSC
BSC Reth is a cutting-edge Rust client developed in collaboration with Paradigm, designed to provide seamless support for BNB Smart Chain (BSC). It aims to enhance client diversity on the BNB Chain by offering a secure and efficient execution client.
## Hardware Specifications
To run BSC Reth effectively, ensure your system meets the following hardware requirements:
* CPU with 16+ cores
* 128GB RAM
* High-performance NVMe SSD with at least 4TB of free space for a full node and 8TB for an archive node
* Broadband internet connection with upload/download speeds of 25 MB/s
### Running BSC Reth
1. Download source code and build binary.
```shell
git clone https://github.com/bnb-chain/reth.git
cd reth
make build-bsc
```
2. Start the reth node, it will run in archive mode by default. You can add the `--full` flag to start a full node.
```shell
# for mainnet
export network=bsc
# for testnet
# export network=bsc-testnet
./target/release/bsc-reth node \
--datadir=./datadir \
--chain=${network} \
--http \
--http.api="eth, net, txpool, web3, rpc" \
--log.file.directory ./datadir/logs
```
3. Optionally, you can run the reth node with docker.
```shell
# for mainnet
export network=bsc
# for testnet
# export network=bsc-testnet
# check this for version of the docker image, https://github.com/bnb-chain/reth/pkgs/container/bsc-reth
export version=latest
# the directory where reth data will be stored
export data_dir=/xxx/xxx
docker run -d -p 8545:8545 -p 30303:30303 -p 30303:30303/udp -v ${data_dir}:/data \
--name bsc-reth ghcr.io/bnb-chain/bsc-reth:${version} node \
--datadir=/data \
--chain=${network} \
--http \
--http.api="eth, net, txpool, web3, rpc" \
--log.file.directory /data/logs
```
## Snapshot
To synchronize a BSC reth node from scratch to the current block height can be a time-consuming process.
As We benchmark [Reth(v1.0.0)](https://github.com/bnb-chain/reth/releases/tag/v1.0.0) on AWS [lm4gn.8xlarge](https://instances.vantage.sh/aws/ec2/im4gn.8xlarge)(32 core 128G) with 2 x 7500 NVMe SSD for BSC mainnet.
It may take approximately 30 days to sync the latest block on BSC mainnet for an archive node and 24 days for a full node.
Given the extended duration required for stage synchronization of the BSC network, the BNB Chain team is developing a segmented snapshot download solution, scheduled for release in the near future.
Currently, developers seeking to expedite the process can obtain archive node snapshots from [community-maintained repositories](https://github.com/fuzzland/snapshots).
These snapshots offer a faster alternative to syncing from genesis, allowing for quicker node setup and network participation.
74 changes: 0 additions & 74 deletions docs/bnb-smart-chain/developers/node_operators/reth_node.md

This file was deleted.

19 changes: 10 additions & 9 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ nav:
- Faucet: ./bnb-smart-chain/developers/faucet.md
- Node Operators:
- Node Best Practices: ./bnb-smart-chain/developers/node_operators/node_best_practices.md
- Full Node: ./bnb-smart-chain/developers/node_operators/full_node.md
- Archive Node: ./bnb-smart-chain/developers/node_operators/archive_node.md
- Fast Node: ./bnb-smart-chain/developers/node_operators/fast_node.md
- Erigon Node: ./bnb-smart-chain/developers/node_operators/erigon_node.md
- Reth Node: ./bnb-smart-chain/developers/node_operators/reth_node.md
- Boot Node: ./bnb-smart-chain/developers/node_operators/boot_node.md
- Docker Image: ./bnb-smart-chain/developers/node_operators/docker.md
- Upgrade Geth: ./bnb-smart-chain/developers/node_operators/upgrade_geth.md
- Node Maintenance: ./bnb-smart-chain/developers/node_operators/node_maintenance.md
- Node Types:
- Full Node: ./bnb-smart-chain/developers/node_operators/full_node.md
- Archive Node: ./bnb-smart-chain/developers/node_operators/archive_node.md
- Fast Node: ./bnb-smart-chain/developers/node_operators/fast_node.md
- Insfrastructure & Setup:
- Boot Node: ./bnb-smart-chain/developers/node_operators/boot_node.md
- Docker Image: ./bnb-smart-chain/developers/node_operators/docker.md
- Maintenance & Upgrades:
- Upgrade Geth: ./bnb-smart-chain/developers/node_operators/upgrade_geth.md
- Node Maintenance: ./bnb-smart-chain/developers/node_operators/node_maintenance.md
- EOA Paymaster:
- Overview: ./bnb-smart-chain/developers/paymaster/overview.md
- Paymaster API Spec: ./bnb-smart-chain/developers/paymaster/paymaster-api.md
Expand Down

0 comments on commit d53e3d7

Please sign in to comment.