Browse Source

rpc: add chunked genesis endpoint (#299)

* rpc: add chunked genesis endpoint

* fix lint

* feedback

* add info about error

* fix lint

Co-authored-by: marbar3778 <marbar3778@yahoo.com>
pull/7804/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
5559e14355
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 1 deletions
  1. +40
    -1
      spec/rpc/README.md

+ 40
- 1
spec/rpc/README.md View File

@ -30,6 +30,7 @@ This file defines the JSON-RPC spec of Tendermint. This is meant to be implement
| [Commit](#commit) | ✅ | ✅ |
| [Validators](#validators) | ✅ | ✅ |
| [Genesis](#genesis) | ✅ | ✅ |
| [GenesisChunked](#genesischunked) | ✅ | ❌ |
| [ConsensusParams](#consensusparams) | ✅ | ❌ |
| [UnconfirmedTxs](#unconfirmedtxs) | ✅ | ❌ |
| [NumUnconfirmedTxs](#numunconfirmedtxs) | ✅ | ❌ |
@ -796,7 +797,8 @@ curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\
### Genesis
Get Genesis of the chain.
Get Genesis of the chain. If the response is large, this operation
will return an error: use `genesis_chunked` instead.
#### Request
@ -856,6 +858,43 @@ curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\
}
```
### GenesisChunked
Get the genesis document in a chunks to support easily transfering larger documents.
#### Parameters
- `chunk` (integer): the index number of the chunk that you wish to
fetch. These IDs are 0 indexed.
#### Request
##### HTTP
```sh
curl http://127.0.0.1:26657/genesis_chunked?chunk=0
```
##### JSONRPC
```sh
curl -X POST https://localhost:26657 -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"genesis_chunked\",\"params\":{\"chunk\":0}}"
```
#### Response
```json
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"chunk": 0,
"total": 10,
"data": "dGVuZGVybWludAo="
}
}
```
### ConsensusParams
Get the consensus parameters.


Loading…
Cancel
Save