Logo
新用户订阅 RPC,首月享 6.5 折优惠查看优惠
RPC Assistant

BNB Testnet RPC: Endpoint, Chain ID, Faucet & Wallet Setup

摘要

BNB Smart Chain Testnet (BSC Testnet) uses chain ID 97 (0x61) and tBNB as gas. For light testing, you can use the official public endpoint https://bsc-testnet-dataseed.bnbchain.org (and other official dataseed endpoints), but those are rate-limited to 10,000 requests per 5 minutes and may disable eth_getLogs. OnFinality provides a public BNB testnet RPC at https://bnb-testnet.api.onfinality.io/public with EVM-compatible HTTPS and WebSocket support, archive data, and trace/API access for developers who need more consistent test infrastructure. To start, request tBNB from the BNB faucet, add the network to MetaMask with the correct settings, and verify connectivity with eth_chainId or eth_blockNumber. Keep the testnet endpoint separate from mainnet (chain ID 56 / 0x38). If you encounter 429 rate-limit errors or wrong-network rejections, switch to a private endpoint or recheck the chain ID. For contract deployment and CI/CD workflows, refer to the BNB Smart Chain Testnet Developer Guide.

关键要点

  • Use chain ID 97 (0x61) for BNB Smart Chain Testnet; never mainnet 56 (0x38).
  • The OnFinality public testnet endpoint is https://bnb-testnet.api.onfinality.io/public; official public endpoints are rate-limited.
  • Always verify eth_chainId and request tBNB from a faucet before deploying.
  • For CI/CD, contract testing, or historical state, use a private endpoint with archive and trace support.

BNB Testnet RPC Decision Checklist

Before connecting an app or CI/CD pipeline to BNB Smart Chain Testnet, verify the network parameters and provider capabilities. This checklist keeps testnet work isolated from mainnet and avoids wasted debugging time.

标准检查内容为什么重要
Chain IDMust be 97 (0x61) in every wallet, config file, and transaction.Using mainnet chain ID 56 (0x38) causes rejections or accidental mainnet sends.
Endpoint typePublic vs. private/dedicated endpoint and whether rate limits match your workload.Public endpoints often throttle at 10K/5min, which can stall CI/CD runs.
Faucet accessCan you reliably receive tBNB for the addresses you test with?Without gas tokens, contract deployment and transactions fail.
Logs and archiveDoes the endpoint support eth_getLogs and historical state queries?Some official public endpoints disable eth_getLogs; archive data is required for old-state analysis.
WebSocket supportIs a wss:// endpoint available for subscriptions?Real-time event monitoring needs a stable WebSocket connection.

Chain ID and Network Parameters

BNB Smart Chain Testnet is an EVM-compatible test network that mirrors BSC mainnet. It uses tBNB for gas and has its own chain ID to separate it from mainnet and other BNB ecosystem networks.

Current Public and OnFinality Testnet Endpoints

For quick experiments, BNB Chain maintains public RPC endpoints. The official documentation lists testnet endpoints such as https://bsc-testnet-dataseed.bnbchain.org and related dataseed addresses. These public endpoints are rate-limited and may restrict certain methods. OnFinality offers a public BNB testnet endpoint with EVM-compatible HTTPS and WebSocket support, archive data, and trace/API access.

标准检查内容为什么重要
Official publichttps://bsc-testnet-dataseed.bnbchain.orgFree, rate-limited, may disable eth_getLogs on some endpoints.
OnFinality publichttps://bnb-testnet.api.onfinality.io/publicProvided as part of OnFinality multi-chain RPC; supports HTTPS and WebSocket, archive, trace/API.

Adding BNB Testnet to MetaMask or Wallet

Most EVM wallets accept custom network configurations. Use the values below to add BNB Smart Chain Testnet manually, or use a network aggregator with the chain ID 97.

Requesting tBNB from a Faucet

tBNB is required for gas on the testnet. Use the official BNB Chain faucet or a trusted alternative. Most faucets require a wallet address and may have daily cooldowns or social verification.

  • Official BNB Chain Faucet: https://www.bnbchain.org/en/testnet-faucet (0.3 tBNB per request with cooldown)
  • Alternative faucets like Chainlink or QuickNode may provide additional tBNB; check current availability.
  • If you need larger amounts for CI/CD, consider requesting from multiple faucets or contacting BNB Chain support.

Verify the Endpoint with curl and eth_chainId

After configuring the network, confirm that your endpoint returns the expected chain ID and current block number. Use standard JSON-RPC calls.

  • Call eth_chainId to verify 0x61: curl -X POST https://bnb-testnet.api.onfinality.io/public -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
  • Call eth_blockNumber to check sync status: curl -X POST https://bnb-testnet.api.onfinality.io/public -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
  • If the response chain ID is 0x38, you are connected to mainnet; correct the RPC URL.

Public Endpoint Limitations and Troubleshooting

Official public endpoints are convenient but come with constraints. Understand these before relying on them for automated testing.

  • Rate limits: Official BNB Chain public endpoints are limited to 10,000 requests per 5 minutes. Exceeding this may return HTTP 429.
  • eth_getLogs: Some official public endpoints disable eth_getLogs to reduce load. Use a provider that supports it or switch to WebSocket subscriptions.
  • Wrong network: If a transaction is rejected with a chain ID mismatch, verify that your wallet/dApp uses 97 (0x61), not 56 (0x38).
  • 429 Too Many Requests: Reduce request frequency, implement backoff, or move to a private endpoint with higher limits.
标准检查内容为什么重要
SymptomHTTP 429 Too Many RequestsRate limit exceeded; backoff or upgrade endpoint.
Symptometh_getLogs returns error or emptyMethod disabled on some official public endpoints; use provider with log support.
SymptomTransaction rejected with invalid chain IDWallet or app configured for mainnet (56); update to 97.

When to Use a Dedicated or Private Testnet RPC

For continuous integration, load testing, or dApps that need historical state or trace calls, a shared public endpoint may be insufficient. OnFinality offers dedicated testnet RPC access with higher limits, archive data, and WebSocket support. Use placeholders for private endpoints and keep credentials out of code repositories.

  • Create a private endpoint under /networks/bnb-testnet and use an API key placeholder like YOUR_API_KEY.
  • Do not hardcode private endpoints or API keys in client-side code.
  • For contract deployment and CI/CD automation, a private endpoint reduces flakiness from public rate limits.

Developer Guide for Contracts and CI/CD

Once the endpoint is working, move from connection testing to contract workflows. The BNB Smart Chain Testnet Developer Guide covers deployment, testing, and CI/CD integration in more detail.

常见问题

What is the BNB testnet chain ID?

The BNB Smart Chain Testnet chain ID is 97 (0x61 in hexadecimal). Mainnet uses 56 (0x38).

How do I get tBNB for testing?

Use the official BNB Chain faucet at https://www.bnbchain.org/en/testnet-faucet, or trusted third-party faucets. Most have daily limits and may require social verification.

Can I use the same RPC endpoint for mainnet and testnet?

No. Mainnet and testnet require different endpoints and chain IDs. Using the wrong endpoint will fail or connect to the wrong network.

Does OnFinality support WebSocket and archive data for BNB testnet?

Yes, according to OnFinality's network configuration, the service provides EVM-compatible HTTPS and WebSocket RPC, archive support, and trace/API access for BNB Smart Chain. See /networks/bnb-testnet.

Why am I getting 429 Too Many Requests?

You may have exceeded the rate limit of a public endpoint. Implement backoff, reduce request frequency, or switch to a private endpoint with higher limits.

RPC 知识库

相关 RPC 内容

网络 RPCBase

什么是 Base 节点,如何运行或连接一个?

Base 节点是一个与 Base 网络同步的客户端,Base 网络是以太坊 Layer 2 汇总。运行一个节点可以让您直接、无需信任地访问链上数据,但需要大量的硬件和维护。对于大多数开发者来说,使用像 OnFinality 这样的托管 RPC 提供商更快、更可靠。...

网络 RPCSui

Sui 主网 RPC:如何连接及注意事项

了解如何连接 Sui 主网 RPC 端点,理解 JSON-RPC 方法,并评估生产应用的基础设施选项。本指南涵盖链设置、请求示例以及选择公共节点和专用节点的关键考虑因素。...

网络 RPCAvalanche

Polygon 主网 RPC:如何连接到链 ID 137?

Polygon 主网是一条 EVM 兼容链,链 ID 为 137,原生 Gas 代币为 POL。要连接,请将您的钱包或应用指向 HTTP 或 WebSocket RPC 端点,并在发送交易前确认链 ID 匹配 137。OnFinality 提供用于测试的公共 Polygon 端点,以及用于需要一致容...

区块链基础设施多链

Web3 桥接 API 在跨链开发中如何比较?

Web3 桥接 API 使开发者能够将跨链资产转移和消息传递集成到 dApp 中。本指南比较了流行的桥接 API,涵盖支持的链、安全模型、延迟和开发者体验等标准,帮助您为项目选择合适的桥接 API。...

RPC 提供商选择Solana

哪些 Solana RPC 服务提供针对 NFT 和 DeFi 数据定制的增强 API?

大多数 Solana RPC 提供商都暴露相同的核心 JSON-RPC 接口,因此对于 NFT 和 DeFi 工作负载,真正的区别在于提供商处理代币账户、程序日志、压缩 NFT 和高容量 getProgramAccounts 调用的能力。增强 API 通常意味着在标准 RPC 之上叠加索引或专用方法...

网络 RPCPolygon

Polygon MATIC API:开发者应该了解什么?

Polygon MATIC API 是指开发者用于与 Polygon PoS 链交互的一组接口,包括用于读写区块链数据的 JSON-RPC 端点。本指南解释了不同类型的 API——从原始 RPC 到 SDK 和索引器——以及如何为你的应用选择正确的 API。...

永远不用担心基础设施

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

开始