From f702c9a5cdcc8a5b201e80a5baed300f067a32c7 Mon Sep 17 00:00:00 2001 From: Luis Paris Date: Thu, 12 Mar 2020 17:11:16 -0400 Subject: [PATCH 1/3] add api-reference index file for trace_api_plugin --- .../01_nodeos/03_plugins/trace_api_plugin/api-reference/index.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/01_nodeos/03_plugins/trace_api_plugin/api-reference/index.md diff --git a/docs/01_nodeos/03_plugins/trace_api_plugin/api-reference/index.md b/docs/01_nodeos/03_plugins/trace_api_plugin/api-reference/index.md new file mode 100644 index 00000000000..6451c708686 --- /dev/null +++ b/docs/01_nodeos/03_plugins/trace_api_plugin/api-reference/index.md @@ -0,0 +1 @@ + From 45ab4843dd6ecc1b04931e01a56982ec6b67524e Mon Sep 17 00:00:00 2001 From: Luis Paris Date: Thu, 12 Mar 2020 17:14:11 -0400 Subject: [PATCH 2/3] add reference to trace_api swagger file in docs.json --- docs.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs.json b/docs.json index 4cc2e2acfd5..698c666cecb 100644 --- a/docs.json +++ b/docs.json @@ -51,6 +51,15 @@ "disable_filters": true, "disable_summary_gen": true } + }, + { + "name": "swagger", + "options": { + "swagger_path": "plugins/trace_api_plugin/trace_api.swagger.yaml", + "swagger_dest_path": "nodeos/plugins/trace_api_plugin/api-reference", + "disable_filters": true, + "disable_summary_gen": true + } } ] } From 5ff323e2d07be06026846a35ee2346e6265b35a4 Mon Sep 17 00:00:00 2001 From: Luis Paris Date: Thu, 12 Mar 2020 17:42:52 -0400 Subject: [PATCH 3/3] add trace_api swagger file --- .../trace_api_plugin/trace_api.swagger.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 plugins/trace_api_plugin/trace_api.swagger.yaml diff --git a/plugins/trace_api_plugin/trace_api.swagger.yaml b/plugins/trace_api_plugin/trace_api.swagger.yaml new file mode 100644 index 00000000000..3c6875402ff --- /dev/null +++ b/plugins/trace_api_plugin/trace_api.swagger.yaml @@ -0,0 +1,52 @@ +openapi: 3.0.0 +info: + title: Trace API + version: 1.0.0 + license: + name: MIT + url: https://opensource.org/licenses/MIT + contact: + url: https://eos.io +servers: + - url: '{protocol}://{host}:{port}/v1/' + variables: + protocol: + enum: + - http + - https + default: http + host: + default: localhost + port: + default: "8080" +components: + schemas: {} +paths: + /trace_api/get_block: + post: + description: Returns a block object containing retired actions and related metadata. + operationId: get_block + requestBody: + content: + application/json: + schema: + type: object + required: + - block_num + properties: + block_num: + type: string + description: Provide a `block number` + responses: + "200": + description: OK - valid response payload + content: + application/json: + schema: + $ref: "https://eosio.github.io/schemata/v2.0/oas/Block.yaml" + "400": + description: Error - requested block number is invalid (not a number, larger than max int) + "404": + description: Error - requested data not present on node + "500": + description: Error - exceptional condition while processing get_block; e.g. corrupt files