Skip to main content
Version: main branch

Alphabill Partition Node JSON-RPC API

This API reference shows you how to interact with the Alphabill partition node using the standard JSON-RPC API.

JSON-RPC Methods

Alphabill partition node JSON-RPC API consists of the following methods:

  • admin_getNodeInfo - Returns general information about the Alphabill partition node.
  • state_getRoundInfo - Returns current round information.
  • state_getUnit - Returns the unit data, optionally including the state proof.
  • state_getUnits - Returns unit identifiers.
  • state_getUnitsByOwnerID - Returns unit's identifiers by owner identifier.
  • state_sendTransaction - Sends a raw CBOR encoded signed transaction to the network. Returns the transaction hash, that can be used in with state_getTransactionProof method to confirm the execution of the transaction.
  • state_getTransactionProof - Returns the transaction execution proof, if the transaction has been executed. This method can be used to confirm the transaction, but also to get the proof needed as input for other transactions.
  • state_getBlock - Returns the raw CBOR encoded block for the given round number.
  • state_getTrustBase - Returns trust base for the given round number, in JSON format.

RPC HTTP Endpoint

Currently, RPC requests can be made using HTTP transport protocol. All JSON-RPC HTTP examples use the default host and port endpoint: http://127.0.0.1:26866/rpc

Data Formats

The format of the request body and response data is based the JSON-RPC 2.0 specification.

Request Format

To make a JSON-RPC request, send an HTTP POST request with a Content-Type: application/json header. The request object has the following members:

  • jsonrpc (string) - A string specifying the version of the JSON-RPC protocol. Must be exactly "2.0".
  • id (number) - A unique client-generated identifying integer.
  • method (string) - A string containing the method to be invoked.
  • params (array) - A JSON array of ordered parameter values.

Example request:

curl http://127.0.0.1:26866/rpc \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "state_getTransactionProof",
"params": [
"0xe883f3919c4072e459642a012cf7737cee311da0ade88aa14780484797784cd9"
]
}'

Response Format

The HTTP response data for a RPC request is a JSON object with the following fields:

  • jsonrpc (string) - Matching the request specification.
  • id (number) - Matching the request identifier.
  • result (array|number|object|string) - Requested data or success confirmation.

Example response:

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txRecordProof": "0x00"
}
}