ChainOS RPC Endpoints

RPC Overview

ChainOS provides a comprehensive set of RPC endpoints for interacting with the blockchain. This reference covers the available endpoints, their parameters, and response formats.

RPC Basics

The ChainOS RPC server is based on Tendermint RPC and provides HTTP and WebSocket interfaces:

Configuration

The RPC server is configured in the config.toml file:

[rpc]
# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://0.0.0.0:26657"

# A list of origins a cross-domain request can be executed from
cors_allowed_origins = []

# Maximum number of simultaneous connections
max_open_connections = 1000

# Maximum number of unique client subscriptions
max_subscription_clients = 100

Request Format

RPC requests follow the JSON-RPC 2.0 specification:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "method_name",
  "params": {
    "param1": "value1",
    "param2": "value2"
  }
}

For HTTP GET requests, parameters can be provided as query parameters:

http://node-address:26657/method_name?param1=value1¶m2=value2

Blockchain Endpoints

Endpoints for retrieving blockchain information:

Block

Get block information at a specified height.

GET /block?height={height}

Parameters:

Example:

curl http://localhost:26657/block?height=1000

Blockchain

Get a range of blocks.

GET /blockchain?minHeight={min_height}&maxHeight={max_height}

Parameters:

Example:

curl http://localhost:26657/blockchain?minHeight=1000&maxHeight=1010

Block Results

Get the results of block execution at a specified height.

GET /block_results?height={height}

Parameters:

Example:

curl http://localhost:26657/block_results?height=1000

Commit

Get block commit information at a specified height.

GET /commit?height={height}

Parameters:

Example:

curl http://localhost:26657/commit?height=1000

Genesis

Get the genesis file.

GET /genesis

Example:

curl http://localhost:26657/genesis

Node Endpoints

Endpoints for retrieving node information:

Health

Get node health status.

GET /health

Example:

curl http://localhost:26657/health

Status

Get node status information.

GET /status

Example:

curl http://localhost:26657/status

Net Info

Get network information.

GET /net_info

Example:

curl http://localhost:26657/net_info

Consensus State

Get consensus state information.

GET /consensus_state

Example:

curl http://localhost:26657/consensus_state

Dump Consensus State

Get detailed consensus state information.

GET /dump_consensus_state

Example:

curl http://localhost:26657/dump_consensus_state

Transaction Endpoints

Endpoints for working with transactions:

Broadcast Transaction (Sync)

Broadcast a transaction and wait for it to be checked.

GET /broadcast_tx_sync?tx={tx}

Parameters:

Example:

curl http://localhost:26657/broadcast_tx_sync?tx=DEADBEEFDEADBEEFDEADBEEF

Broadcast Transaction (Async)

Broadcast a transaction without waiting for a response.

GET /broadcast_tx_async?tx={tx}

Parameters:

Example:

curl http://localhost:26657/broadcast_tx_async?tx=DEADBEEFDEADBEEFDEADBEEF

Broadcast Transaction (Commit)

Broadcast a transaction and wait for it to be committed to a block.

GET /broadcast_tx_commit?tx={tx}

Parameters:

Example:

curl http://localhost:26657/broadcast_tx_commit?tx=DEADBEEFDEADBEEFDEADBEEF

Transaction

Get transaction information by hash.

GET /tx?hash={hash}&prove={prove}

Parameters:

Example:

curl http://localhost:26657/tx?hash=0xABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789&prove=true

Search for transactions matching the query.

GET /tx_search?query={query}&prove={prove}&page={page}&per_page={per_page}&order_by={order_by}

Parameters:

Example:

curl http://localhost:26657/tx_search?query=tx.height>1000+AND+tx.height<1005&prove=true

ABCI Endpoints

Endpoints for interacting with the ABCI application:

ABCI Info

Get information about the ABCI application.

GET /abci_info

Example:

curl http://localhost:26657/abci_info

ABCI Query

Query the ABCI application.

GET /abci_query?path={path}&data={data}&height={height}&prove={prove}

Parameters:

Example:

curl http://localhost:26657/abci_query?path="/store/bank/key"&data=DEADBEEF&height=1000&prove=true

Validator Endpoints

Endpoints for retrieving validator information:

Validators

Get the validator set at a specified height.

GET /validators?height={height}&page={page}&per_page={per_page}

Parameters:

Example:

curl http://localhost:26657/validators?height=1000&page=1&per_page=100

Event Endpoints

Endpoints for subscribing to events:

Subscribe

Subscribe to events via WebSocket.

// WebSocket request
{
  "jsonrpc": "2.0",
  "method": "subscribe",
  "id": 1,
  "params": {
    "query": "tm.event='NewBlock'"
  }
}

Parameters:

Example Queries:

Unsubscribe

Unsubscribe from events via WebSocket.

// WebSocket request
{
  "jsonrpc": "2.0",
  "method": "unsubscribe",
  "id": 1,
  "params": {
    "query": "tm.event='NewBlock'"
  }
}

Parameters:

Public RPC Endpoints

The following public RPC endpoints are available for ChainOS:

Mainnet

  • Primary: https://rpc.chainos.network
  • Backup: https://rpc-backup.chainos.network
  • Archive: https://archive-rpc.chainos.network (includes historical data)

Testnet

  • Primary: https://testnet-rpc.chainos.network
  • Backup: https://testnet-rpc-backup.chainos.network

Rate Limits

Public RPC endpoints have rate limits to prevent abuse:

  • 100 requests per minute per IP for query endpoints
  • 20 requests per minute per IP for broadcast endpoints
  • 5 WebSocket connections per IP

For production applications, consider running your own node or using a dedicated RPC provider.

RPC Security

When exposing RPC endpoints publicly, follow these security best practices:

Need Help?

If you need assistance with the ChainOS RPC endpoints, join our Discord community where our team and other developers can help.