Skip to main content

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_getRoundNumber - Returns the round number of the latest Unicity Certificate.
  • state_getUnit - Returns the unit data, optionally including the state proof.
  • state_getUnitsByOwnerID - Returns units 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.

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": {
"txRecord": "0x00",
"txProof": "0x00"
}
}