XOLIX Explorer Logo

JSON-RPC Specification

Directly interact with the XOLIXBlock node using the JSON-RPC API.

Introduction

The XOLIXBlock API provides developers with direct, low-level access to the blockchain node's data and functions. All endpoints are accessed via HTTP POST requests to the RPC endpoint, which is running for this explorer at http://34.236.120.103:8545.

All requests must be a JSON object conforming to the JSON-RPC 2.0 specification, containing jsonrpc, method, params, and an id.

eth_sendRawTransaction

Submits a pre-signed, serialized transaction to the network. The transaction will be added to the mempool and gossiped to other peers for inclusion in a future block.

Parameters:

[signed_tx_hex: string]

# This requires a real, signed transaction in hex format.
curl -X POST --data '{
  "jsonrpc":"2.0",
  "method":"eth_sendRawTransaction",
  "params":["0x..."],
  "id":1
}' -H "Content-Type: application/json" http://34.236.120.103:8545

Example Response:

{
  "jsonrpc": "2.0",
  "result": "0x...some_tx_hash...",
  "id": 1
}

xolix_getLatestBlocks

Retrieves a list of the most recently mined blocks.

Parameters:

[limit: number]

curl -X POST --data '{
  "jsonrpc":"2.0",
  "method":"xolix_getLatestBlocks",
  "params":[5],
  "id":1
}' -H "Content-Type: application/json" http://34.236.120.103:8545

Example Response:

{
  "jsonrpc": "2.0",
  "result": [ /* Array of Block objects */ ],
  "id": 1
}

xolix_getMempool

Retrieves a list of all transactions currently pending in the mempool, gossiped across the network.

Parameters:

[]

curl -X POST --data '{
  "jsonrpc":"2.0",
  "method":"xolix_getMempool",
  "params":[],
  "id":1
}' -H "Content-Type: application/json" http://34.236.120.103:8545

Example Response:

{
  "jsonrpc": "2.0",
  "result": [ /* Array of SignedTransaction objects */ ],
  "id": 1
}

xolix_readContract

Executes a read-only (view/pure) function on a smart contract.

Parameters:

[contractAddress: string, methodName: string, args: any[]]

curl -X POST --data '{
  "jsonrpc":"2.0",
  "method":"xolix_readContract",
  "params":["0x...", "balanceOf", ["0x..."]],
  "id":1
}' -H "Content-Type: application/json" http://34.236.120.103:8545

Example Response:

{
  "jsonrpc": "2.0",
  "result": "50000000000000000000",
  "id": 1
}