ABCI Methods
Abci Methods (v0.38.x)
Download OpenAPI specification:Download
The Node RPC endpoints are intended for working with the blockchain consensus layer directly. These endpoints return information about the blocks, validators, and network layer itself while the API endpoints work at a higher level and are used to return information at the blockchain Application layer.
The RPC service would typically be used by users and applications that wish to retrieve information about raw blocks being produced or monitor for transactions and network activity.
The Node RPC service supports the following communication protocols:
- URI over HTTP
- JSONRPC over HTTP
- JSONRPC over websockets
A bearer token is required for all requests.
Exchange client id and client secret for a token:
curl -XPOST https://dev-v6yakh57b7z3ngqo.us.auth0.com/oauth/token \
-H \"content-type: application/json\" \
-d '{\"client_id\":\"<id>\",\"client_secret\":\"<secret>\",\"audience\":\"https://api.provlabs.com\",\"grant_type\":\"client_credentials\"}'
The returned token can then be used to make API calls:
curl -XGET -H \"Authorization: Bearer <token>\" https://pio-mainnet-1-rpc.provlabs.com/block?height=5
Arguments which expect strings or byte arrays may be passed as quoted
strings, like "abc" or as 0x-prefixed strings, like 0x616263.
JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.
curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' https://pio-mainnet-1-rpc.provlabs.com
JSONRPC requests can be also made via websocket.
The websocket endpoint is at /websocket, e.g. https://pio-mainnet-1-rpc.provlabs.com/websocket.
Asynchronous RPC functions like event subscribe and unsubscribe are
only available via websockets.
For example using the websocat tool, you can subscribe for 'NewBlock` events with the following command:
echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t wss://pio-mainnet-1-rpc.provlabs.com/websocket
Get info about the application.
Get info about the application.
Upon success, the Cache-Control header will be set with the default
maximum age.
Responses
Response samples
- 200
- 500
{- "jsonrpc": "2.0",
- "id": 0,
- "result": {
- "response": {
- "data": "{\"size\":0}",
- "version": "0.16.1",
- "app_version": "1",
- "last_block_height": "1314126",
- "last_block_app_hash": "C9AEBB441B787D9F1D846DE51F3826F4FD386108B59B08239653ABF59455C3F8"
}
}
}Query the application for some information.
Query the application for some information.
query Parameters
| path required | string Example: path="/a/b/c" Path to the data ("/a/b/c") |
| data required | string Example: data=IHAVENOIDEA Data |
| height | integer Default: 0 Example: height=1 Height (0 means latest) |
| prove | boolean Default: false Example: prove=true Include proofs of the transactions inclusion in the block |
Responses
Response samples
- 200
- 500
{- "error": "",
- "result": {
- "response": {
- "log": "exists",
- "height": "0",
- "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C",
- "value": "61626364",
- "key": "61626364",
- "index": "-1",
- "code": "0"
}
}, - "id": 0,
- "jsonrpc": "2.0"
}