Grid Daemon REST API (0.1.0)

Download OpenAPI specification:Download

A REST API providing HTTP/JSON interface to Hyperledger Grid.

Transaction

Submits a list of transaction batches to the distributed ledger

This endpoint can be used to submit batches to the underlying distributed ledger. The operation called by this endpoint will depend on which distributed ledger is supporting this deployment of Grid. Regardless of the underlying ledger, the body of this request must be a valid list of Sabre batches.

If the Grid Daemon is running against a Sawtooth distributed ledger, then the batches are forwarded to the /batches endpoint of the Sawtooth REST API.

If the Grid Daemon is running against Splinter, then the service_id query parameter is required for this request. The Grid Daemon will use the service ID to forward the transaction to an endpoint on the Splinter Daemon for the Scabbard service corresponding to the provided service ID.

The API will return immediately with a status of 202. There will be no data object, only a link to a /batch_statuses endpoint to be polled to check the status of submitted batches.

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

wait
integer

The number of seconds to wait for batches to be committed before returning.

Request Body schema: application/octet-stream

A binary encoded protobuf BatchList

Array of objects (Batch)

Responses

Fetches the committed statuses for a set of batches

Fetches an array of objects with a status and id for each batch requested. There are four possible statuses with string values 'COMMITTED', 'INVALID', 'PENDING', and 'UNKNOWN'.

The batch(es) you want to check can be specified using the id filter parameter. If a wait time is specified in the URL, the API will wait to respond until all batches are committed, or the time in seconds has elapsed. If the value of wait is not set (i.e., ?wait&id=...), or it is set to any non-integer value other than false, the wait time will be just under the API's specified timeout (usually 300).

Note that because this route does not return full resources, the response will not be paginated, and there will be no head or paging properties.

query Parameters
id
required
string

A comma-separated list of batch IDs

wait
integer

The number of seconds to wait for batches to be committed before returning.

service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
[]

Location

Lists all locations

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetches a single location with the given ID

path Parameters
location_id
required
string

ID of the location to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "location_id": "0099474000005",
  • "location_namespace": "UNSET_NAMESPACE",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Pike

Lists all agents

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetches an agent with the given public key

path Parameters
public_key
required
string

Public key of the agent to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter.

Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
  • "org_id": 6016,
  • "active": "true",
  • "roles": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Lists all organizations