Logo
RPC Assistant

BNB RPC Endpoint: Settings, Limits, and Debugging

摘要

A developer reference for BNB Smart Chain RPC endpoints. Learn the official RPC URLs, chain ID, rate limits, WebSocket support, and common error troubleshooting steps. Includes a decision checklist for choosing between public and private endpoints for production apps.

BNB RPC Decision Checklist

Before integrating a BNB Smart Chain RPC endpoint into your dApp or backend service, check these key points:

CriterionWhat to checkWhy it matters
Network matchConfirm chain ID (mainnet: 56, testnet: 97)Mismatches cause transaction failures or wrong state reads
Rate limitsKnow the free tier limits (e.g., 10k requests/5min on default endpoints)Avoid sudden throttling in production
Method supportVerify eth_getLogs, eth_call, and trace APIs are enabledMany dApps depend on these for analytics and indexing
WebSocket availabilityCheck if WSS URL is providedRequired for real-time event streams (e.g., pending transactions, logs)
Archive dataDoes the endpoint support archive state?Needed for historical queries and certain DEX backtesting
Failover strategyPlan multiple endpoints or a load-balanced providerSingle points of failure can halt your app
LatencyMeasure round-trip time from your deployment regionHigher latency degrades user experience, especially in DeFi
AuthenticationDoes the provider require an API key?Public endpoints may have lower reliability; private ones offer SLAs

BNB Smart Chain Network Overview

BNB Smart Chain (formerly Binance Smart Chain, BSC) is an EVM-compatible blockchain that runs in parallel with BNB Beacon Chain. It offers low transaction fees, fast block times (~3 seconds), and a high throughput of tens of millions of gas per second. The native token is BNB, used for gas and staking. BSC's compatibility with Ethereum tooling makes it a popular choice for DeFi, gaming, and NFT projects. Developers interact with the chain via JSON-RPC endpoints, which expose methods like eth_sendRawTransaction, eth_call, and eth_getLogs.

BNB RPC Endpoint Configuration

To connect to BNB Smart Chain, you need the following network parameters:

Official public RPC URLs provided by BNB Chain:

  • Mainnet: https://bsc-dataseed.bnbchain.org
  • Mainnet (alternative): https://bsc-dataseed1.bnbchain.org, https://bsc-dataseed2.bnbchain.org, etc.
  • Testnet: https://data-seed-prebsc-1-s1.bnbchain.org:8545

These endpoints have a rate limit of 10,000 requests per 5 minutes and eth_getLogs is disabled on some. For higher limits and archive support, consider a dedicated RPC provider.

Example of adding BSC Mainnet to MetaMask or other wallets using chainlist.org: visit https://chainlist.org/chain/56 and connect your wallet.

Sample Request

curl -X POST https://bsc-dataseed.bnbchain.org \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Response:

{"jsonrpc":"2.0","id":1,"result":"0x672df5"}

Rate Limits and Reliability Considerations

Public BSC endpoints are shared among many users. While sufficient for light usage, they can become unreliable under heavy load or during network congestion. Key limitations:

  • Rate limit: ~33 requests/second average (10k per 5 minutes)
  • Method bans: eth_getLogs is often disabled to reduce server strain
  • No WebSocket: Official public endpoints do not expose WSS
  • No archive: Only latest state is available; historical block data limited

For production apps, you need a provider that offers:

  • Higher rate limits or dedicated capacity
  • WebSocket support for real-time subscriptions
  • Archive data for historical queries
  • Global load balancing and failover

OnFinality provides RPC API services for BNB Smart Chain with multiple endpoints, including WebSocket and archive modes. Check the supported networks page for current offerings.

Common RPC Errors and Troubleshooting

eth_getLogs Disabled or Returns "Method not found"

Cause: Many public endpoints disable log retrieval to prevent abuse.

Solution: Switch to a provider that explicitly supports log filtering, or use WebSocket subscriptions to receive logs in real time. OnFinality's RPC API enables eth_getLogs on eligible plans.

"Rate limit exceeded" (HTTP 429 or 403)

Cause: You have exceeded the allowed requests per time window.

Solution: Implement client-side throttling, rotate among multiple endpoints, or upgrade to a private RPC endpoint without restrictive limits.

Transaction Replacement Underpriced

Cause: A replacement transaction has a lower gas price than the original pending one.

Solution: Use eth_maxPriorityFeePerGas to estimate appropriate fees, and ensure nonce management is correct.

Nonce Too Low

Cause: The transaction nonce is already used or skipped.

Solution: Track nonce per address using eth_getTransactionCount with "pending" parameter. For more see What is a Nonce in Blockchain?.

Connection Timeouts or Slow Responses

Cause: Network congestion, overloaded node, or geographic distance.

Solution: Choose an RPC provider with multiple regional entry points. OnFinality's dedicated node infrastructure can reduce latency for your specific deployment region.

Using WebSocket for Real-Time Data

WebSocket (WSS) endpoints allow you to subscribe to events like new blocks, pending transactions, and logs. This is essential for applications that need immediate updates without polling.

Example WebSocket subscription to new block headers:

const WebSocket = require('ws');
const ws = new WebSocket('wss://bsc-ws.nodereal.io'); // example WSS endpoint

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_subscribe',
    params: ['newHeads']
  }));
});

ws.on('message', (data) => {
  console.log('New block:', JSON.parse(data));
});

Many third-party providers offer WSS endpoints. OnFinality's RPC service includes WebSocket support for BNB Smart Chain; check the pricing page for details.

Choosing an RPC Provider for Production

When your dApp outgrows public endpoints, evaluate providers on:

  • Throughput: Can it handle your peak request volume without rate limiting?
  • Data access: Do you need archive, trace, or debug methods?
  • Reliability: What is the uptime SLA? Is there multi-region failover?
  • Latency: Are there nodes near your users or backend servers?
  • WebSocket: Is WSS available with the same reliability as HTTP?

For a detailed framework, see our guide on How to Choose an RPC Provider.

OnFinality offers both shared RPC API and dedicated nodes for BNB Smart Chain, giving you flexibility to scale from development to high-traffic production.

Key Takeaways

  • BNB Smart Chain uses chain ID 56 (mainnet) and 97 (testnet) with official public RPC endpoints at bsc-dataseed.bnbchain.org.
  • Public endpoints have rate limits and method restrictions; evaluate your app's needs early.
  • For real-time data and higher throughput, use WebSocket and a managed RPC provider.
  • Common issues like eth_getLogs disabled and rate limiting can be avoided by choosing an appropriate provider.
  • Always test with a testnet (on Testnet) before mainnet deployment.

Frequently Asked Questions

Q: What is the difference between BNB Beacon Chain and BNB Smart Chain?

A: BNB Beacon Chain handles staking and governance, while BNB Smart Chain is the EVM-compatible chain for smart contracts and dApps. The RPC endpoints covered here are for BNB Smart Chain (formerly BSC).

Q: Can I use Ethereum tools with BNB Smart Chain?

A: Yes, BSC is fully EVM-compatible, so you can use MetaMask, Hardhat, Truffle, and other Ethereum developer tools with minimal changes.

Q: How do I get BNB testnet tokens?

A: Use the BSC Testnet faucet at https://testnet.bnbchain.org/faucet-smart to request BNB for testing.

Q: Does OnFinality support BNB Smart Chain?

A: Yes, OnFinality offers both public and private RPC endpoints for BNB Smart Chain mainnet and testnet. See the supported networks page for details.

Q: What is the block time of BSC?

A: Approximately 3 seconds, making it faster than Ethereum mainnet.

RPC 知识库

相关 RPC 内容

Network Rpc

Optimism RPC:如何连接OP主网并选择最佳端点

# Optimism RPC:如何连接OP主网并选择最佳端点 Optimism是以太坊领先的Layer 2扩容解决方案,采用Optimistic Rollups技术,在继承以太坊安全性的同时提供低成本、快速的交易。要与OP主网交互——无论是发送交易、查询链上数据还是构建dApp——您需要一个Opti...

Network Rpc

Binance Smart Chain 开发者需要了解什么?

Binance Smart Chain (BSC) 是一条兼容 EVM 的区块链,提供低费用和快速出块时间。开发者可以使用 Solidity、Hardhat 和标准的以太坊工具来构建 dApp。本文涵盖链基础知识、RPC 端点设置、智能合约部署以及选择基础设施的关键考虑因素。...

Network Rpc

什么是Polygon RPC端点,如何选择合适的端点?

# 什么是Polygon RPC端点,如何选择合适的端点? Polygon RPC(远程过程调用)端点是一个URL,允许您的dApp、钱包或后端服务与Polygon区块链通信。由于Polygon兼容EVM,您可以使用标准的以太坊JSON-RPC方法来查询余额、发送交易以及与智能合约交互。RPC提供商...

Network Rpc

Metis API:链设置、RPC 方法和提供商选择

Metis API 是指 Metis Andromeda 第二层区块链的 JSON-RPC 接口,这是一个兼容以太坊的 Rollup。本文涵盖链配置、基本 RPC 方法、如何连接钱包和 dApp,以及为生产工作负载选择可靠 RPC 提供商的标准。...

Network Rpc

Polygon RPC 节点:端点、链设置及如何选择提供商

Polygon RPC 节点是一个端点,允许您的 dApp 或钱包通过 JSON-RPC 与 Polygon 网络通信。本页面涵盖 Polygon 主网和 Amoy 测试网的官方链设置,列出公共和付费 RPC 提供商,并提供选择适合您工作负载的基础设施的决策清单。...

Testnet Rpc

BNB智能链测试网RPC:端点设置、水龙头和调试

BNB智能链测试网(链ID 97)是一个兼容EVM的测试环境,用于在主网部署前构建和测试dApp。本页面提供官方RPC端点、链配置、水龙头链接和常见调试技巧,帮助开发者快速上手。...

永远不用担心基础设施

OnFinality 消除了 DevOps 的繁重工作,让您能够更聪明、更快地构建。

开始