How to Set Up a BSC Mainnet RPC Node (Non-Mining)

Β·

Setting up a Binance Smart Chain (BSC) mainnet RPC node allows developers and blockchain enthusiasts to interact directly with the BSC network, enabling seamless access to on-chain data and transaction execution. This guide walks you through the complete process of deploying a non-mining BSC full node on a high-performance server, optimized for stability, speed, and long-term operation.


Server Requirements

To ensure smooth synchronization and stable operation, BSC nodes demand robust hardware due to their high resource consumption.

Disk Storage

⚠️ Cloud storage such as AWS EBS or Alibaba Cloud disks often suffer from poor I/O performance. Use local NVMe SSDs for optimal results. Block data can exceed 1.9TB, so 2TB drives are insufficient.

Bandwidth

High bandwidth significantly reduces initial synchronization time. A 1Gbps connection can cut sync duration from over a week to just a few days when using snapshots.

Operating System

Ensure your OS is up-to-date before proceeding.


Environment Preparation

Before installing the BSC client, prepare your environment with essential tools and dependencies.

sudo yum update -y
sudo yum install screen iftop iotop -y

Install Go (Golang)

BSC’s geth client is built using Go. Install it via package manager:

sudo yum install golang -y

Alternatively, compile from source:

cd /root/
wget https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz
tar zxvf go1.4-bootstrap-20170531.tar.gz
cd /root/go/src/
./all.bash

πŸ‘‰ Learn how to optimize blockchain node performance with advanced configuration tools.


Create a Persistent Session Using Screen

Use screen to maintain a persistent background session that survives network disconnections.

screen -S bsc
πŸ” Tip: Detach from the session using Ctrl+A, then press D. Reattach later with screen -r bsc.

This ensures uninterrupted node operation even if your SSH connection drops.


Install the BSC Client

Set Up Data Directory

Choose a dedicated directory for BSC data:

mkdir -p /data/bsc/data

You can customize this path based on your disk layout.

Download and Compile the Client

cd /root
wget -O binance-chain-v1.1.4.tar.gz https://github.com/binance-chain/bsc/archive/refs/tags/v1.1.4.tar.gz
tar -xvf binance-chain-v1.1.4.tar.gz
rm -fr binance-chain-v1.1.4.tar.gz

cd /root/bsc-1.1.4
make all

Verify Installation

Check the version to confirm successful build:

/root/bsc-1.1.4/build/bin/geth version

Expected output includes BSC-specific version details indicating correct compilation.


Configure Node Settings

Download the required configuration files:

Place both files in /data/bsc/.

These files define chain parameters and network behavior. Ensure they match the official BSC mainnet specs.


Configure Firewall Rules

Allow incoming connections on critical ports:

firewall-cmd --permanent --zone=public --add-port=30311/tcp  # P2P communication
firewall-cmd --permanent --zone=public --add-port=8575/tcp  # HTTP RPC
firewall-cmd --permanent --zone=public --add-port=8576/tcp  # WebSocket RPC
firewall-cmd --reload

If you're unfamiliar with firewalld, temporarily disable it (not recommended for production):

systemctl stop firewalld
systemctl disable firewalld

Speed Up Sync with Snapshots

Downloading the entire blockchain from scratch can take weeks. Use official snapshots to accelerate synchronization.

Download Latest Snapshot

Visit BSC Snapshots GitHub for updated links.

Example command:

cd /data/bsc/data
wget -O geth.tar.gz 'https://s3.ap-northeast-1.amazonaws.com/dex-bin.bnbstatic.com/geth-20211031.tar.gz?AWSAccessKeyId=AKIAYINE6SBQPUZDDRRO&Signature=ESK5xmr5f1AIK4Mr6our%2FALXzQk%3D&Expires=1638310885'
tar zxvf geth.tar.gz

Ensure extracted folders like chaindata and keystore reside directly under /data/bsc/data. Adjust paths if needed:

mv ./geth/* /data/bsc/data/

πŸ‘‰ Access real-time blockchain analytics to monitor your node’s performance efficiently.


Initialize and Start the Node

Initialize Genesis Configuration

Run this only once before first launch:

/root/bsc-1.1.4/build/bin/geth --datadir /data/bsc/data --config /data/bsc/config.toml --syncmode "fast" --cache=10240 init /data/bsc/genesis.json

Skipping this step leads to sync failures.

Launch the Node

After initialization, start the node:

ulimit -n 65535
/root/bsc-1.1.4/build/bin/geth --datadir /data/bsc/data --config /data/bsc/config.toml --syncmode "fast" --cache=8192 --rpc.allow-unprotected-txs --txlookuplimit 0 --allow-insecure-unlock

Detach safely with Ctrl+A, then D.


Test and Verify Node Status

Use curl to check synchronization status:

Check Sync Progress

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://127.0.0.1:8575

If fully synced, response returns "result": false.

Get Current Block Number

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8575

Compare with BscScan to verify alignment.


Stop the Node Gracefully

Reattach to the screen session and stop the process:

screen -r bsc
# Press Ctrl+C and wait for clean shutdown

Avoid force-killing the process to prevent database corruption.


Important Notes and Best Practices


Frequently Asked Questions (FAQ)

Q: Can I use cloud providers like AWS or Alibaba Cloud?
A: Only if you use local NVMe SSDs. Standard cloud volumes lack sufficient I/O performance for stable BSC operation.

Q: Why does my node keep crashing?
A: Most commonly due to low file descriptor limits or slow disk I/O. Check logs and run dmesg | grep -i kill for OOM errors.

Q: Do I need to mine or stake to run this node?
A: No. This setup is for RPC services only β€” no mining, validation, or staking involved.

Q: How do I upgrade the node software?
A: Download the new release, recompile, stop the current node, replace binaries, and restart.

Q: Is there an alternative to compiling from source?
A: Pre-built binaries may be available, but compiling ensures compatibility and security.

Q: Can I expose my RPC endpoint publicly?
A: Yes, but secure it with authentication and rate limiting to prevent abuse.


Core Keywords for SEO

BSC RPC node, Binance Smart Chain full node, set up BSC node, BSC mainnet, non-mining BSC node, BSC geth client, blockchain node setup, BSC synchronization


πŸ‘‰ Explore developer tools that integrate seamlessly with your BSC node deployment.