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 内容

区块链基础设施Efinity

运行以太坊节点仍然有利可图吗?

运行以太坊节点仍然可能值得,但盈利与否取决于你把什么算作回报。全节点或归档节点很少能直接获得协议收入;它提供的是可靠访问、隐私和独立性。质押会增加奖励,但需要 32 ETH 和运维纪律。对大多数开发者和团队来说,真正的问题是:把硬件、带宽、维护和机会成本都算进去之后,自托管是否比付费使用托管 RPC...

网络 RPCEth Sepolia

什么是以太坊公共 RPC,以及何时应该使用它?

以太坊公共 RPC 是一个共享的、无需认证的 JSON-RPC 端点,允许任何开发者读取以太坊数据并广播交易,而无需运行节点。它非常适合原型设计、钱包配置和低流量脚本,但共享容量和速率限制使其不适合需要稳定吞吐量、归档数据或 WebSocket 订阅的生产工作负载。 本页解释了如何连接到以太坊公共 ...

区块链基础设施Efinity

什么是 Solana 轻节点,何时应该使用它?

Solana 轻节点是一种客户端,它只保留验证账户和交易所需的状态,而不是存储完整账本。它适用于需要快速读取而无需运行验证者级硬件的钱包、仪表盘和边缘服务。对于大多数生产应用,托管 RPC 端点或专用节点可以替代自行运行轻客户端的运维负担。本文解释了轻节点在 Solana 上的作用、它与验证者和全节...

区块链基础设施

智能合约安全最佳实践:开发者检查清单

了解Solidity开发者必备的智能合约安全最佳实践,包括重入保护、访问控制和安全的数学运算。了解可靠RPC端点等基础设施选择如何支持安全部署和监控。...

网络 RPCTON

TON JSON-RPC:端点、方法及使用方法

TON JSON-RPC 是通往开放网络(The Open Network)的 JSON-RPC 2.0 接口,让您可以通过单个 HTTPS 端点查询账户状态、运行智能合约 get 方法以及发送交易。本文解释了端点结构、常用方法、身份验证,以及如何在公共、托管和专用 TON RPC 基础设施之间进行...

网络 RPCArbitrum

Arbitrum API 概览:RPC 端点、链设置与生产环境配置

Arbitrum API 是一个 JSON-RPC 接口,可让您的应用在 Arbitrum One(链 ID 42161)和 Arbitrum Sepolia(链 ID 421614)上读取状态并提交交易。您只需将 HTTP 或 WebSocket 客户端指向 Arbitrum RPC 端点,并调用...

永远不用担心基础设施

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

开始