This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
C3 JSON RPC Specification
Miguel Mota edited this page Jun 27, 2018
·
28 revisions
List of supported C3 JSON RPC Specification methods
{
"jsonrpc": "2.0",
"id": 1,
"method": "c3_invokeMethod",
"params": [
"myMethodName",
"arg1",
"arg2"
]
}
Example success response
{
"jsonrpc": "2.0",
"id": 1,
"result": "123"
}
Example error response
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": "4002",
"message": "invalid arguments",
"data": ""
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "c3_forkImage",
"params": [
"{imageHash}",
"{stateBlockNumber}"
]
}
{
"jsonrpc": "2.0",
"id": "1",
[error|result]
}
- This member is REQUIRED on success.
- This member MUST NOT exist if there was an error invoking the method.
- The value of this member is determined by the method invoked on the Server.
- This member is REQUIRED on error.
- This member MUST NOT exist if there was no error triggered during invocation.
- The value for this member MUST be an Object as defined below
Error codes:
code | message | meaning |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |
-32600 | Invalid Request | The JSON sent is not a valid Request object. |
-32601 | Method not found | The method does not exist / is not available. |
-32602 | Invalid params | Invalid method parameter(s). |
-32603 | Internal error | Internal JSON-RPC error. |
-32000 to -32099 | Server error | Reserved for implementation-defined server-errors. |
{
"code": -32700,
"message": "a string message",
"data": {
...
}
}
-
c3_block
// return block by number -
c3_headBlockNumber
// return latest block number -
c3_imageStateBlocks
// return state blocks for image -
c3_nodePeerCount
// return peer count of node -
c3_nodePeerList
// return peer list of node -
c3_nodeImageList
// return images in node's registry -
c3_nodeInfo
// return info about the node -
c3_accountBalance
// return account balance -
c3_subscribeEvents
// subscribe to events