Skip to content

Latest commit

 

History

History
81 lines (63 loc) · 3.14 KB

rest.rst

File metadata and controls

81 lines (63 loc) · 3.14 KB

Unofficial FAQ: Sawtooth REST API

[PREVIOUS | HOME | NEXT]

Warning

This FAQ was written by a non-expert so may contain both fiction and fact!

sawtooth-rest-api --bind (-B)
specifies where your rest-api would listen. The default is http://localhost:8008
sawtooth-rest-api --connect (-C)
specifies where your rest-api can reach to the validator. The default is http://localhost:4004

TCP Port 8008. It was 8080 before the 1.0 release and old examples and diagrams may use the old port number.

Use localhost to access the REST API from the Validator Docker container or from where the Validator is running. For example, to get state history (equivalent to sawtooth state list) type:

curl http://localhost:8008/state

From the Client Docker container, access from rest-api. For example:

curl http://rest-api:8008/state

These are the supported REST API commands:

POST /batches
Submit a protobuf-formatted batch list to the validator
GET /batches
Fetch a paginated list of batches from the validator
GET /batches/{batch_id}
Fetch the specified batch
GET /batch_status
Fetch the committed statuses for a set of batches
GET /state
Fetch a paginated list of leaves for the current state, or relative to a particular head block
GET /state/{address}
Fetch a particular leaf from the current state
GET /blocks
Fetch a paginated list of blocks from the validator
GET /blocks/{block_id}
Fetch the specified block
GET /transactions
Fetch a paginated list of transactions from the validator.
GET /transactions/{transaction_id}
Fetch the specified transaction
GET /peers
Fetch a list of current peered validators

For more information, see the Sawtooth REST API Reference at https://sawtooth.hyperledger.org/docs/core/releases/latest/rest_api.html

It means the transaction processor for this transaction is not running.

Most likey you are not putting the transaction into a batch or the batch in a batchlist for posting to the REST API. This is required, even for a single transaction.

The Sawtooth REST API doesn't support CORS. To allow cross-origin access to the Sawtooth API, put it behind a proxy.

[PREVIOUS | HOME | NEXT]

© Copyright 2018, Intel Corporation.