JSON-RPC Methods

186 methods across 23 namespaces available on Subtensor nodes

Understanding JSON-RPC

What is JSON-RPC? JSON-RPC is the primary protocol for communicating with a Subtensor node. Methods are grouped into namespaces like state, chain, and author that cover reading state, navigating blocks, and submitting extrinsics.

Both v1 and v2 methods are available. Subtensor nodes expose legacy v1 methods and several v2 namespaces (chainHead_v1, chainSpec_v1, transaction_v1, transactionWatch_v1). Only archive_unstable_* is absent.

Archive vs pruned nodes: Methods accepting an at block hash for historical queries require an archive node. Pruned nodes only retain ~256 recent blocks. See /learn/technical/query-stack for details.

account

1 method

Alias for system account queries.

author

9 methods

Submit extrinsics and manage session keys. The entry point for writing to the chain.

chain

19 methods

Read block data, headers, and finalization status. The primary way to navigate the chain history.

chainHead_v1

9 methods

Substrate JSON-RPC v2 chain head tracking. Follow and query the best chain.

chainSpec_v1

3 methods

Substrate JSON-RPC v2 chain specification queries.

childstate

7 methods

Query child storage tries. Used internally by some pallets for nested storage.

debug

5 methods

EVM debug methods for inspecting blocks and transactions.

delegateInfo

3 methods

Subtensor-specific: query delegate information via runtime API.

eth

45 methods

Ethereum JSON-RPC compatibility layer. Standard EVM methods for interacting with Subtensor's EVM.

net

3 methods

Ethereum network information.

neuronInfo

4 methods

Subtensor-specific: query neuron data via runtime API.

offchain

3 methods

Offchain worker local storage access.

payment

2 methods

Fee estimation for extrinsics before submission.

rpc

1 method

Introspection — list available RPC methods on this node.

state

23 methods

Query runtime state, storage, and metadata. The workhorse namespace for reading chain data.

subnetInfo

18 methods

Subtensor-specific: query subnet configuration, metagraphs, and hyperparameters via runtime API.

subscribe

1 method

Legacy subscription alias.

swap

3 methods

Subtensor-specific: TAO/Alpha token swap simulation and pricing.

system

20 methods

Node health, version, peers, and properties. Useful for monitoring and diagnostics.

transaction_v1

2 methods

Substrate JSON-RPC v2 transaction broadcasting.

transactionWatch_v1

2 methods

Substrate JSON-RPC v2 transaction status watching.

unsubscribe

1 method

Legacy unsubscribe alias.

web3

2 methods

Ethereum Web3 utility methods.

For Developers

Call RPC methods directly with curl or via polkadot.js:

# curl — check node health
curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"system_health","params":[]}' \
  https://entrypoint-finney.opentensor.ai

# polkadot.js — query storage
const { ApiPromise, WsProvider } = require('@polkadot/api');
const api = await ApiPromise.create({
  provider: new WsProvider('wss://entrypoint-finney.opentensor.ai:443')
});

// Read a storage value
const hash = await api.rpc.chain.getFinalizedHead();
const block = await api.rpc.chain.getBlock(hash);
console.log('Block number:', block.block.header.number.toNumber());

// Subscribe to new blocks
api.rpc.chain.subscribeNewHeads((header) => {
  console.log('New block:', header.number.toNumber());
});

Methods marked unsafe require running the node with --rpc-methods unsafe. Methods marked subscription require a WebSocket connection.