-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #555 from EspressoSystems/feat/timestamp-endpoints
Feat/timestamp endpoints
- Loading branch information
Showing
5 changed files
with
402 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[route.getnamespaceproof] | ||
PATH = ["block/:height/namespace/:namespace"] | ||
":height" = "Integer" | ||
":namespace" = "Integer" | ||
DOC = "Get the namespace proof for a set of VM transations and the NMT root" | ||
|
||
[route.gettimestampwindow] | ||
PATH = [ | ||
"headers/window/:start/:end", | ||
"headers/window/from/:height/:end", | ||
"headers/window/from/hash/:hash/:end", | ||
] | ||
":start" = "Integer" | ||
":end" = "Integer" | ||
":height" = "Integer" | ||
":hash" = "TaggedBase64" | ||
DOC = """ | ||
Get block headers in a time window. | ||
Returns all available headers, in order, whose timestamps fall between `:start` (inclusive) and | ||
`:end` (exclusive), or between the block indicated by `:height` or `:hash` (inclusive) and `:end` | ||
(exclusive). The response also includes one block before the desired window (unless the window | ||
includes the genesis block) and one block after the window. This proves to the client that the | ||
server has not omitted any blocks whose timestamps fall within the desired window. | ||
It is possible that not all blocks in the desired window are available when this endpoint is called. | ||
In that case, whichever blocks are available are included in the response, and `next` is `null` to | ||
indicate that the response is not complete. The client can then use one of the `/from/` forms of | ||
this endpoint to fetch the remaining blocks from where the first response left off, once they become | ||
available. If no blocks are available, not even `prev`, this endpoint will return an error. | ||
Returns | ||
```json | ||
{ | ||
"from": "integer", // block number of the first block in the window, unless the window is empty, | ||
// then block number of `next` | ||
"window": ["Header"], | ||
"prev": "Header", // nullable | ||
"next": "Header" // nullable | ||
} | ||
``` | ||
where a `Header` has the schema: | ||
```json | ||
{ | ||
"timestamp": "integer", | ||
"l1_block": { | ||
"timestamp": "integer", | ||
"number": "integer", | ||
}, | ||
"transactions_root": { | ||
"root": ["integer"] | ||
} | ||
} | ||
``` | ||
All timestamps are denominated in an integer number of seconds. | ||
""" |
File renamed without changes.
Oops, something went wrong.