From a8721843e8d838882d8ae048e851a35a93dafa07 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 17:46:09 -0500 Subject: [PATCH] rpc: update docs (backport #9674) (#9792) * rpc: update docs (#9674) Closes issue [#9522](https://github.com/tendermint/tendermint/issues/9522) by adding genesis chunked to the rpc docs (cherry picked from commit 4290ad29829fde50d8a32ef8e11295c4d28c481b) * docs: Expand on genesis_chunked description Signed-off-by: Thane Thomson Signed-off-by: Thane Thomson Co-authored-by: samricotta <37125168+samricotta@users.noreply.github.com> Co-authored-by: Thane Thomson --- docs/pre.sh | 2 +- rpc/openapi/openapi.yaml | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/docs/pre.sh b/docs/pre.sh index 37193d265..170f18110 100755 --- a/docs/pre.sh +++ b/docs/pre.sh @@ -1,3 +1,3 @@ #!/bin/bash -cp -a ../rpc/openapi/ .vuepress/public/rpc/ +cp -a ../rpc/openapi/* .vuepress/public/rpc/ diff --git a/rpc/openapi/openapi.yaml b/rpc/openapi/openapi.yaml index b19e45d33..1b4df070a 100644 --- a/rpc/openapi/openapi.yaml +++ b/rpc/openapi/openapi.yaml @@ -849,6 +849,41 @@ paths: application/json: schema: $ref: "#/components/schemas/ErrorResponse" + /genesis_chunked: + get: + summary: Get Genesis in multiple chunks + operationId: genesis_chunked + tags: + - Info + description: | + Get genesis document in multiple chunks to make it easier to iterate + through larger genesis structures. Each chunk is produced by converting + the genesis document to JSON and then splitting the resulting payload + into 16MB blocks, and then Base64-encoding each block. + + Upon success, the `Cache-Control` header will be set with the default + maximum age. + parameters: + - in: query + name: chunk + description: Sequence number of the chunk to download. + schema: + type: integer + default: 0 + example: 1 + responses: + "200": + description: Genesis chunk response. + content: + application/json: + schema: + $ref: "#/components/schemas/GenesisChunkedResponse" + "500": + description: Error + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorResponse" /dump_consensus_state: get: summary: Get consensus state @@ -1913,6 +1948,35 @@ components: properties: {} type: object + GenesisChunkedResponse: + type: object + required: + - "jsonrpc" + - "id" + - "result" + properties: + jsonrpc: + type: string + example: "2.0" + id: + type: integer + example: 0 + result: + required: + - "chunk" + - "total" + - "data" + properties: + chunk: + type: integer + example: 0 + total: + type: integer + example: 1 + data: + type: string + example: "Z2VuZXNpcwo=" + DumpConsensusResponse: type: object required: