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

What is Bittensor RPC and how do you connect to it?

摘要

Bittensor RPC enables developers to interact with Bittensor's decentralized AI network via Substrate (subtensor) and EVM APIs. This reference covers mainnet and testnet endpoints, chain settings, code examples, and criteria for choosing an RPC provider for your dApp or AI agent.

Bittensor RPC Decision Checklist

Before integrating Bittensor RPC, evaluate these key aspects:

CriterionWhat to checkWhy it matters
Network typeMainnet (Finney) or testnet?Different endpoints, chain IDs, and token values. Testnet uses Test TAO.
API layerSubstrate native or EVM?Bittensor offers both. Substrate for chain state, EVM for smart contracts.
Endpoint typeShared public, shared premium, or dedicated?Public endpoints have rate limits; dedicated nodes offer consistent performance.
Geographic latencyProvider node locationsLower latency reduces response times for time-sensitive applications.
Reliability guaranteesUpstream redundancy, failoverEnsure your provider maintains high availability and handles load spikes.
Archive dataFull history needed?Archive nodes allow historical queries; essential for analytics or auditing.
Support for WebSocketsReal-time subscriptions?Required for live feeds (e.g., new blocks, event logs).
Pricing modelPay-as-you-go vs. fixed monthlyMatch your usage pattern to avoid overpaying or hitting limits.

Understanding Bittensor's Dual RPC Architecture

Bittensor is a decentralized AI network built on the Subtensor blockchain, a Substrate-based layer 1 chain. It also includes a Frontier EVM runtime, enabling both native Substrate RPC methods and Ethereum-compatible JSON-RPC calls. This dual architecture means developers can choose the interface that best suits their application:

  • Substrate RPC (chain_getBlockHash, state_getMetadata) – for querying chain state, staking, and subnet operations.
  • EVM RPC (eth_blockNumber, eth_call, eth_sendTransaction) – for deploying and calling smart contracts on the EVM side.

The chain ID for the EVM is 964 (mainnet) and 945 (testnet). The native token is TAO.

Bittensor Mainnet (Finney) RPC Endpoints and Chain Settings

Public mainnet endpoints (subject to rate limits):

  • https://lite.chain.opentensor.ai/ (EVM)
  • https://rpc.blockmachine.io/ (EVM)
  • https://bittensor-finney.api.onfinality.io/public (Substrate + EVM, available via API key for higher limits)
  • wss://bittensor-finney.api.onfinality.io/public (WebSocket)

Chain settings for wallet or dApp configuration:

FieldValue
Network NameBittensor Finney
RPC URL (EVM)https://lite.chain.opentensor.ai/ or any provider endpoint
Chain ID964 (0x3C4)
Currency SymbolTAO
Block Explorerhttps://taostats.io

For Substrate-native interactions, use the same endpoints with the chain_getBlock etc. methods.

Bittensor Testnet RPC Endpoints and Chain Settings

Testnet endpoints for development and testing:

  • https://test.chain.opentensor.ai/ (EVM)
  • https://bittensor-testnet.drpc.org (EVM, via dRPC)
  • wss://test.chain.opentensor.ai/ (WebSocket)

Chain settings:

FieldValue
Network NameBittensor Testnet
RPC URL (EVM)https://test.chain.opentensor.ai/ or provider endpoint
Chain ID945 (0x3B1)
Currency SymbolTest TAO
Block Explorerhttps://testnet.taostats.io

Test TAO can be requested from the Bittensor Discord or faucet (check official channels).

How to Connect to Bittensor RPC

Here's a basic curl example to fetch the latest block number via EVM JSON-RPC:

curl -X POST https://lite.chain.opentensor.ai/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Using Substrate RPC to get a block hash:

curl -X POST https://bittensor-finney.api.onfinality.io/public \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"chain_getBlockHash","params":[0],"id":1}'

In JavaScript (Web3.js or ethers.js):

const { ethers } = require("ethers");

const provider = new ethers.providers.JsonRpcProvider("https://lite.chain.opentensor.ai/");

async function getBlockNumber() {
  const blockNumber = await provider.getBlockNumber();
  console.log("Current Bittensor block:", blockNumber);
}

getBlockNumber();

For Substrate, use the Polkadot.js API:

const { ApiPromise, WsProvider } = require("@polkadot/api");

async function connect() {
  const provider = new WsProvider("wss://bittensor-finney.api.onfinality.io/public");
  const api = await ApiPromise.create({ provider });
  const chain = await api.rpc.system.chain();
  console.log("Connected to:", chain);
}

connect();

Bittensor RPC Provider Evaluation Criteria

When choosing an RPC provider for Bittensor, consider the following criteria:

CriterionWhat to checkWhy it matters
API layer supportSubstrate and EVMEnsure the provider exposes both; some only offer one.
Rate limitsRequests per second (RPS)Production dApps need high RPS; shared free endpoints may throttle.
Geographic distributionNode locationsGlobal nodes reduce latency for users worldwide.
Uptime SLAProvider's historical uptimeImportant for production applications.
WebSocket supportReal-time subscriptionsRequired for live updates (e.g., new blocks, events).
Archive accessFull historical stateNeeded for analytics or backtesting.
Pricing transparencyPer-request or fixed monthlyChoose a model that fits your budget and usage.

OnFinality offers both shared and dedicated Bittensor RPC endpoints with Substrate and EVM support, global load balancing, and WebSocket access. Check the Bittensor network page for up-to-date endpoint details and pricing.

Common Pitfalls and Troubleshooting

  • Wrong chain ID: When adding to MetaMask, ensure you use the correct chain ID (964 for mainnet, 945 for testnet). A common mistake is using 1 or 137.
  • Rate limiting: Public endpoints like lite.chain.opentensor.ai may return 429 Too Many Requests. Use a provider with a higher plan or dedicated node.
  • EVM vs Substrate: Some providers only expose one interface. If you need both, confirm beforehand.
  • Testnet TAO: You cannot get TAO from the mainnet faucet; use the testnet faucet (often via Discord).
  • WebSocket connections: Ensure your firewall allows WebSocket on port 443; some corporate networks block it.
  • Block finality: Bittensor uses Proof-of-Authority; ensure your application accounts for possible reorganizations (e.g., wait for a few confirmations).

Key Takeaways

  • Bittensor offers both Substrate native and EVM RPC interfaces; choose based on your application's needs.
  • Public endpoints are available for quick testing, but production applications should consider a dedicated or higher-tier shared provider for reliability and speed.
  • Always verify chain IDs and endpoint URLs from official sources to avoid phishing or misconfiguration.
  • OnFinality provides managed Bittensor RPC endpoints with flexible plans – see supported networks and pricing for details.
  • Test thoroughly on testnet before moving to mainnet, and monitor RPC performance regularly.

Frequently Asked Questions

What is Bittensor RPC? Bittensor RPC allows developers to interact with the Bittensor network programmatically, querying chain state, sending transactions, and accessing smart contracts.

What are the chain IDs for Bittensor? Mainnet: 964 (0x3C4). Testnet: 945 (0x3B1).

Do I need a separate RPC for Substrate and EVM? Some providers offer a single endpoint that handles both. Confirm with your provider.

How can I get Test TAO? Test TAO is available from the Bittensor testnet faucet, typically through the official Discord or community channels.

Can I use Bittensor RPC for free? Yes, there are public endpoints, but they come with rate limits. For production, consider a shared or dedicated plan.

Where can I find the latest Bittensor RPC endpoints? Check the official Bittensor documentation or a multi-chain RPC provider like OnFinality for up-to-date endpoints.

RPC 知识库

相关 RPC 内容

RPC 提供商选择Solana

顶级 Solana RPC 提供商的速率限制选项如何比较?

Solana RPC 提供商在实施速率限制方面有所不同:有些按 IP 限制每秒请求数,有些按计算单元或积分计量,高级套餐提供更高吞吐量或专用节点。本文比较了主要提供商的速率限制模型,并帮助您为工作负载选择合适的方案。...

RPC 故障排查

什么是加密中的 nonce?

# 什么是加密中的 nonce? Nonce(“一次性使用的数字”)是在加密通信中仅使用一次的独特任意数字。在像以太坊这样的区块链网络中,nonce 是一个顺序计数器,确保来自给定地址的交易按顺序处理,并防止重放攻击。每笔交易的 nonce 必须比同一账户的上一笔交易高 1;否则,网络会拒绝该交易。...

RPC 提供商选择

共享与专用 Solana RPC 节点的成本差异是什么?

共享 Solana RPC 节点按使用量计费——根据请求量、计算单元或数据传输——对于开发和低至中等流量来说成本效益高。专用 Solana RPC 节点有较高的固定月费,但提供可预测的性能、资源隔离和无速率限制争用。正确的选择取决于你的应用程序的流量模式、延迟要求和预算。...

网络 RPCGnosis

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

Gnosis Chain RPC 端点允许开发者通过 JSON-RPC 调用与 Gnosis Chain 网络交互。本文介绍了链设置、如何评估提供商以及在生产 dApp 中选择基础设施时应避免的常见陷阱。...

网络 RPCEthereumSolanaPolygonBasepeaq多链

开发者应如何评估 Sepolia、Polygon、Solana Devnet、Base Sepolia 和 peaq 上的 RPC 端点?

选择合适的 RPC 端点对于 dApp 的性能和可靠性至关重要。本指南将介绍五个流行网络(以太坊 Sepolia、Polygon、Solana Devnet、Base Sepolia 和 peaq)的关键评估标准——速率限制、链 ID、测试网可靠性以及何时升级到托管或专用基础设施。无论您是在测试网上...

网络 RPCSolana

什么是面向生产级 dApp 的最佳 Solana RPC 提供商?

# 什么是面向生产级 dApp 的最佳 Solana RPC 提供商? 最佳 Solana RPC 提供商之所以重要,是因为 Solana 应用依赖稳定的端点访问来执行读取、交易、仪表盘和后端工作流。合适的提供商应匹配你的工作负载,支持你所需的网络和测试网,使限制透明可见,并在共享 RPC 不再够用...

永远不用担心基础设施

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

开始