From 2c48d99350114fb288dcb35d837cc408f3829fc4 Mon Sep 17 00:00:00 2001 From: qybdyx Date: Wed, 25 Sep 2024 14:10:53 +0800 Subject: [PATCH 1/2] update erigon doc --- .../developers/node_operators/archive_node.md | 17 +------- .../developers/node_operators/erigon_node.md | 41 +++++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 docs/bnb-smart-chain/developers/node_operators/erigon_node.md diff --git a/docs/bnb-smart-chain/developers/node_operators/archive_node.md b/docs/bnb-smart-chain/developers/node_operators/archive_node.md index 5be2d2f514..cf2db18886 100644 --- a/docs/bnb-smart-chain/developers/node_operators/archive_node.md +++ b/docs/bnb-smart-chain/developers/node_operators/archive_node.md @@ -27,23 +27,8 @@ 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) has supported BSC mainnet. You can also refer to [Free public BNB Smart Chain Archive Snapshot](https://github.com/allada/bsc-archive-snapshot) for the guide to run a BSC archive node with an Erigon client. The owner has switched to using an Erigon client for a BSC archive node recently. You can download the archive snapshot which is a tarball from aws s3. The s3 path is "s3://public-blockchain-snapshots/bsc/erigon-latest.tar.zstd". This path is public, but is configured as requester-pays. Also this means you'll need an AWS account in order to download it. +[Erigon](https://github.com/node-real/bsc-erigon) has supported BSC mainnet. The latest erigon support to sync a archive node in 3 days from scratch with 4.3 TB disk usage. You can utilize erigon to operate an archive node; for more information, refer to [Erigon Node](./erigon_node.md). -* Command to download to local dir: - -``` -aws s3 cp --request-payer=requester "s3://public-blockchain-snapshots/bsc/erigon-latest.tar.zstd" local_data_dir - -tar --use-compress-program=unzstd -xvf erigon-latest.tar.zstd -``` - -* Command to run: - -``` -./erigon --chain=bsc --datadir local_data_dir -``` - -The known Issue with an Erigon client is that it does not really keep up with the latest blocks as mentioned in the Github. If you want to keep up with the latest blocks it is suggested to run a BSC archive node with high performance disk such as NVME, or run a BSC full node with a Geth client at the same time which means you need one proxy that will ask Erigon if it has the block height and if not forward it to the Geth client. ### Run with a Reth client diff --git a/docs/bnb-smart-chain/developers/node_operators/erigon_node.md b/docs/bnb-smart-chain/developers/node_operators/erigon_node.md new file mode 100644 index 0000000000..b9aeaeb648 --- /dev/null +++ b/docs/bnb-smart-chain/developers/node_operators/erigon_node.md @@ -0,0 +1,41 @@ +--- +title: Erigon Node - BSC Develop +--- + +# Erigon Node for BSC + +Bsc Erigon is a support by node-real, which is a fork of Erigon. It aim to be the best archive node. + +## Hardware Specifications + +To run BSC Erigon effectively, ensure your system meets the following hardware requirements: + +* 64GB RAM (More ram will have higher performance) +* SSD or NVMe. With at least 5TB for an archive node and 700 GB for a fast-node. + +## Running BSC Erigon + +1. Download source code and build binary. +```shell +# Build by self +git clone https://github.com/node-real/bsc-erigon.git +cd bsc-erigon +make erigon + +# Download docker image +docker pull ghcr.io/node-real/bsc-erigon:${latest_version} +``` + +2. Start the erigon node, it will run in archive mode by default, to sync from scratch need about 3 days. +```shell +# Define 6 flags to avoid conflicts: --datadir --port --http.port --authrpc.port --torrent.port --private.api.addr. Example of multiple chains on the same machine: +# mainnet +./build/bin/erigon --datadir="" --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 + + +# sepolia +./build/bin/erigon --datadir="" --chain=chapel --port=30304 --http.port=8546 --authrpc.port=8552 --torrent.port=42068 --private.api.addr=127.0.0.1:9091 --http --ws --http.api=eth,debug,net,trace,web3,erigon,bsc +``` + +3. Start a minimal size of bsc erigon node(Not archive). You can add the `--prune.mode=minimal` flag to start a fast node. It will keep 3 days state and block data, support debug_trace* 3day's history. If you run fast-node and don't want spend days to sync. You can obtain fast node snapshots from [community-maintained repositories](https://github.com/48Club/bsc-snapshots). + diff --git a/mkdocs.yml b/mkdocs.yml index 4ce346d625..08a7240dca 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -126,6 +126,7 @@ nav: - 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 From 1ea305ab74e834c8890aacd1ba18e9a2dfca65db Mon Sep 17 00:00:00 2001 From: qybdyx Date: Wed, 25 Sep 2024 15:14:24 +0800 Subject: [PATCH 2/2] update erigon doc --- .../developers/node_operators/archive_node.md | 2 +- .../developers/node_operators/erigon_node.md | 56 +++++++++++-------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/bnb-smart-chain/developers/node_operators/archive_node.md b/docs/bnb-smart-chain/developers/node_operators/archive_node.md index cf2db18886..aeef459e5f 100644 --- a/docs/bnb-smart-chain/developers/node_operators/archive_node.md +++ b/docs/bnb-smart-chain/developers/node_operators/archive_node.md @@ -27,7 +27,7 @@ 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) has supported BSC mainnet. The latest erigon support to sync a archive node in 3 days from scratch with 4.3 TB disk usage. You can utilize erigon to operate an archive node; for more information, refer to [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; for more information, please refer to the [Erigon Node](./erigon_node.md). ### Run with a Reth client diff --git a/docs/bnb-smart-chain/developers/node_operators/erigon_node.md b/docs/bnb-smart-chain/developers/node_operators/erigon_node.md index b9aeaeb648..4ccbf2ac9e 100644 --- a/docs/bnb-smart-chain/developers/node_operators/erigon_node.md +++ b/docs/bnb-smart-chain/developers/node_operators/erigon_node.md @@ -1,41 +1,53 @@ --- -title: Erigon Node - BSC Develop +title: BSC Erigon Node Deployment Guide --- -# Erigon Node for BSC +# BSC Erigon Node Deployment Guide -Bsc Erigon is a support by node-real, which is a fork of Erigon. It aim to be the best archive node. +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 Specifications +## Hardware Requirements -To run BSC Erigon effectively, ensure your system meets the following hardware requirements: +To ensure optimal performance of your BSC Erigon node, we recommend the following hardware specifications: -* 64GB RAM (More ram will have higher performance) -* SSD or NVMe. With at least 5TB for an archive node and 700 GB for a fast-node. +* RAM: 64GB or more (higher RAM correlates with better performance) +* Storage: SSD or NVMe + - Archive Node: Minimum 5TB + - Fast Node: Minimum 700GB -## Running BSC Erigon +## BSC Erigon Node Deployment Steps -1. Download source code and build binary. +### 1. Obtain the Erigon Binary + +Option 1: Build from source ```shell -# Build by self git clone https://github.com/node-real/bsc-erigon.git cd bsc-erigon make erigon - -# Download docker image +``` +Option 2: Use Docker image +```shell docker pull ghcr.io/node-real/bsc-erigon:${latest_version} ``` - -2. Start the erigon node, it will run in archive mode by default, to sync from scratch need about 3 days. +### 2. Launch the Erigon Node +By default, the node will run in archive mode. Syncing from scratch typically takes about 3 days. ```shell -# Define 6 flags to avoid conflicts: --datadir --port --http.port --authrpc.port --torrent.port --private.api.addr. Example of multiple chains on the same machine: -# mainnet -./build/bin/erigon --datadir="" --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 - - -# sepolia -./build/bin/erigon --datadir="" --chain=chapel --port=30304 --http.port=8546 --authrpc.port=8552 --torrent.port=42068 --private.api.addr=127.0.0.1:9091 --http --ws --http.api=eth,debug,net,trace,web3,erigon,bsc +./build/bin/erigon \ +--datadir="" \ +--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. -3. Start a minimal size of bsc erigon node(Not archive). You can add the `--prune.mode=minimal` flag to start a fast node. It will keep 3 days state and block data, support debug_trace* 3day's history. If you run fast-node and don't want spend days to sync. You can obtain fast node snapshots from [community-maintained repositories](https://github.com/48Club/bsc-snapshots). +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.