rpc: index block events to support block event queries (#6226)

This commit is contained in:
Aleksandr Bezobchuk
2021-03-22 11:47:35 -04:00
committed by GitHub
parent 99c73dd3c1
commit 003f394512
27 changed files with 1353 additions and 188 deletions
+56
View File
@@ -1021,6 +1021,62 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/block_search:
get:
summary: Search for blocks by BeginBlock and EndBlock events
description: |
Search for blocks by BeginBlock and EndBlock events.
See /subscribe for the query syntax.
operationId: block_search
parameters:
- in: query
name: query
description: Query
required: true
schema:
type: string
example: "block.height > 1000 AND valset.changed > 0"
- in: query
name: page
description: "Page number (1-based)"
required: false
schema:
type: integer
default: 1
example: 1
- in: query
name: per_page
description: "Number of entries per page (max: 100)"
required: false
schema:
type: integer
default: 30
example: 30
- in: query
name: order_by
description: Order in which blocks are sorted ("asc" or "desc"), by height. If empty, default sorting will be still applied.
required: false
schema:
type: string
default: "desc"
example: "asc"
tags:
- Info
responses:
"200":
description: List of paginated blocks matching the search criteria.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockSearchResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/tx:
get:
summary: Get transactions by hash