github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/docs/source/cli/sawtooth-rest-api.rst (about) 1 .. 2 Copyright 2017 Intel Corporation 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 16 .. _rest-api-cli-reference-label: 17 18 ***************** 19 sawtooth-rest-api 20 ***************** 21 22 The ``sawtooth-rest-api`` command starts the REST API and connects to 23 the validator. 24 25 The REST API is designed to run alongside a validator, 26 providing potential clients access to blockchain and state data 27 through common HTTP/JSON standards. It is a stateless process, and 28 does not store any part of the blockchain or blockchain state. Instead 29 it acts as a go between, translating HTTP requests into validator 30 requests, and sending back the results as JSON. As a result, running 31 the Sawtooth REST API requires that a validator already be running and 32 available over TCP. 33 34 Options for ``sawtooth-rest-api`` specify the bind address for the host and port 35 (by default, ``http://localhost:8008``) and the TCP address where the 36 validator is running (the default is ``tcp://localhost:4004``). An 37 optional timeout value configures how long the REST API will wait for 38 a response for the validator. 39 40 .. literalinclude:: output/sawtooth-rest-api_usage.out 41 :language: console 42 43 .. Licensed under Creative Commons Attribution 4.0 International License 44 .. https://creativecommons.org/licenses/by/4.0/