Sawtooth REST API (0.8.0)

Download OpenAPI specification:Download

This HTTP pragmatic REST API is built on top of Sawtooth's existing ZMQ/Protobuf infrastructure, simplifying client interaction with the blockchain by exposing endpoints that use common HTTP/JSON standards.

Sends a BatchList to the validator

Accepts a protobuf formatted BatchList as an octet-stream binary file and submits it to the validator to be committed.

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.

Request Body schema: application/octet-stream

A binary encoded protobuf BatchList

Array of objects (Batch)

Responses

Fetches a list of batches

Fetches a paginated list of batches from the validator.

query Parameters
head
string
Default: "latest"

Index or id of head block

start
string

Id to start paging (inclusive)

limit
integer
Default: 1000

Number of items to return

reverse
string

If the list should be reversed

Responses

Fetches a particular batch

path Parameters
batch_id
required
string

Batch id

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

A time in seconds to wait for commit

Responses

Fetches the committed statuses for a set of batches

Identical to GET /batch_statuses, but takes ids of batches as a JSON formatted POST body rather than a query parameter. This allows for many more batches to be checked and should be used for more than 15 ids.

Note that because query information is not encoded in the URL, no link will be returned with this query.

query Parameters
wait
integer

A time in seconds to wait for commit

Request Body schema: application/json

A JSON array of batch id strings

Array
string

Responses

Request samples

Content type
application/json
[
  • "89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c"
]

Fetches the data for the current state

Fetches a paginated list of entries for the current state, or relative to a particular head block. Using the address filter parameter will narrow the list to any entries that have an address beginning with the characters specified. Note that the partial address in address parameter should have even number of hexadecimal characters (i.e., complete bytes).

query Parameters
head
string
Default: "latest"

Index or id of head block

address
string

A partial address to filter leaves by

start
string

Id to start paging (inclusive)

limit
integer
Default: 1000

Number of items to return

reverse
string

If the list should be reversed

Responses

Fetches a particular leaf from the current state

Takes full 70-character address and fetches a particular leaf. For partial address (i.e., group of leaves) use /state above.

path Parameters
address
required
string

Radix address of a leaf

query Parameters
head
string
Default: "latest"

Index or id of head block

Responses

Fetches a list of blocks

Fetches a paginated list of blocks from the validator.

query Parameters
head
string
Default: "latest"

Index or id of head block

start
string

Id to start paging (inclusive)

limit
integer
Default: 1000

Number of items to return

reverse
string

If the list should be reversed

Responses

Fetches a particular block

path Parameters
block_id
required
string

Block id

Responses

Fetches a list of transactions

Fetches a paginated list of transactions from the validator.

query Parameters
head
string
Default: "latest"

Index or id of head block

start
string

Id to start paging (inclusive)

limit
integer
Default: 1000

Number of items to return

reverse
string

If the list should be reversed

Responses

Fetches a particular transaction

path Parameters
transaction_id
required
string

Transaction id

Responses

Fetches the receipts for a set of transactions

Fetches an array of objects for each receipt requested.

The receipt(s) you want to retrieve can be specified using the id filter parameter, where id refers to the transaction id of the transaction the receipt is associated with.

query Parameters
id
required
string

A comma-separated list of transaction ids

Responses

Fetches the receipts for a set of transactions

Identical to GET /receipts, but takes ids of transactions as a JSON formatted POST body rather than a query parameter. This allows for many more receipts to be fetched and should be used with more than 15 ids.

Note that because query information is not encoded in the URL, no link will be returned with this request.

query Parameters
wait
integer

A time in seconds to wait for commit

Request Body schema: application/json

A JSON array of transaction id strings

Array
string

Responses

Request samples

Content type
application/json
[
  • "89807bfc9089e37e00d87d97357de14cfbc455cd608438d426a625a30a0da9a31c406983803c4aa27e1f32a3ff61709e8ec4b56abbc553d7d330635b5d27029c"
]

Fetches the endpoints of the authorized peers of the validator

Responses

Fetches information pertaining to the status of the validator

Responses