Open vsubhuman opened 5 years ago
@CodeSandwich
@vincenthz This feature will require fetching blocks from store by height. Right now we can fetch only by hash. Is it by design or can I add this feature?
This links to input-output-hk/jormungandr#694
@NicolasDP Does it only link or should this issue be superseded by GraphQL in explorer mode?
@NicolasDP I have worked with many blockchain platforms to integrate them into a cryptocurrency wallet and ADA testnet is truly a nightmare!
Is your feature request related to a problem/context ? Please describe if applicable. No technical way to query a specific block by knowing the chain height of the block.
Describe the solution you'd like It would be awesome to have a new API endpoint that would take the height as a number and return the raw block or 404.
Maybe something like
/api/v0/height/{height}
.If
{height} <= 0
- response 400 if{height} > tip_height
- response 404Additional context This endpoint would allow traversing the chain without a help of a second endpoint to query block hashes, we could just start with
1
and query next height until receiving 404, with checking the parent-child relationship preserving on our side, and if we see that the block at the next height refers to some different part - we can just drop N latest blocks and restart with earlier height value.