ligo/docs/doc_gen/rpcs/usage.rst
Grégoire Henry d6f79edae2 Shell/RPC: rework /blocks
- start using `GET` and query parameters instead of `POST`  when
  meaningful

- inline parsed protocol data and metadata in block headers

- inline parsed protocol data and metadata in operations

- split the RPC in four categories:

  - static data, available explicitly in block headers and operations

  - static "metadata", information that were computed while validating
    a block or an operation, but which are not explicit in the block
    header (e.g. the baker of a block, the list of internal
    transfer... (currently not implemented, but that's WIP))

  - "context" all the static data we may read in the context
    (contracts balance, list of delegates, ...)

  - "helpers" are some RPC that may perform some computation.
2018-06-06 10:54:33 +02:00

31 lines
1.3 KiB
ReStructuredText

This document contains the list of RPC services provided by the Tezos
node. It is generated from the OCaml source code (master branch).
Usage
*****
In order to interact with a Tezos node, you may use RPC calls through the
client using this command ``tezos-admin-client rpc (get|post) <url>``.
For instance, if you wish to request the current balance of a given
block and contract, you can call the associated RPC via the command :
``$ tezos-admin-client rpc post
/blocks/<block_id>/proto/context/contracts/<contract_id>/balance``.
A RPC may takes an *input* and generates an *output* both in JSON
format. For example, the previous RPC call, that does not require an
input, would display on the standard output : ``{ "balance":
"4000000000000" }``. When calling a RPC that requires an input
through command-line, you will be prompted to provide the JSON input
in your default configured text editor. Alternatively, you can provide
the JSON input using command
``$ tezos-admin-client rpc post <url> with <JSON>``. Don't forget to quote
the JSON according to your shell rules.
You can also obtain the list of RPCs on the command line with
``tezos-admin-client rpc list /``, and the description of each service
using ``tezos-admin-client rpc format <url>``.
Of course, you can use your standard HTTP tool or library as well to
perform all these tasks.