ligo/vendors/ocplib-resto
Grégoire Henry 33c3d1fcbd Alpha/RPC: add a low-level but typed RPC for context introspection
Example:

```
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/\?depth\=1 | jq
{
  "commitments": [],
  "contracts": {
    "global_counter": 0,
    "index": []
  },
  "cycle": [
    4,
    3,
    2,
    1,
    0
  ],
  "delegates": [
    "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
    "tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU",
    "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv",
    "tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv",
    "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"
  ],
  "last_block_priority": 0,
  "rolls": {
    "index": [],
    "next": 2000,
    "owner": {}
  },
  "votes": {
    "ballots": [],
    "current_period_kind": "proposal",
    "current_quorum": 8000,
    "listings": [],
    "proposals": []
  }
}
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/cycle/4\?depth\=2 | jq
{
  "last_roll": [
    [
      0,
      2000
    ]
  ],
  "nonces": [],
  "random_seed": "97d50852c159ada8e9f107e98f693b059ba28336c723e6cd0f6353eb3c0cb415",
  "roll_snapshot": 0
}
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/cycle/5\?depth\=2 | jq
{
  "last_roll": [
    [
      1,
      2000
    ],
    [
      0,
      2000
    ]
  ],
  "nonces": [],
  "roll_snapshot": 2
}
```
2018-06-06 10:54:33 +02:00
..
lib_ezresto Client refactor: use the error_monad for all RPC services 2018-02-12 16:54:08 +01:00
lib_ezresto-directory Resto: lift the lwt monad into Resto. 2018-06-06 10:54:33 +02:00
lib_resto Resto: export RPC_arg.eq to the protocol. 2018-06-06 10:54:33 +02:00
lib_resto-cohttp Resto: fix CORS 2018-05-12 23:58:20 +02:00
lib_resto-directory Alpha/RPC: add a low-level but typed RPC for context introspection 2018-06-06 10:54:33 +02:00
lib_resto-json Ocplib_json_typed: adapt code for inclusion in vendors 2018-05-04 18:48:00 +02:00
.gitignore Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
.ocp-indent Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
.travis.yml Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
CHANGES.md Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
jbuild Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
LICENSE Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
Makefile Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
ocplib-resto.version Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00
README.md Import new version of vendors/ocplib-resto 2017-12-04 15:51:59 +01:00

ocplib-resto (WIP)

This is a minimal OCaml library for type-safe HTTP/JSON RPCs.

This is based on a notion of service, à la Eliom, and it uses ocplib-json-typed for self-documenting JSON encoders.

See test_ezresto-directory/ezResto_test.ml or test_resto-directory/resto_test.ml for example.`