Skip to content

Endpoint: fetch blocked skylink hashes #4

Description

@ro-tex

Overview

This endpoint will allow clients to fetch the list of block skylink hashes.

Design or Proposal

Add a new endpoint such as GET /hash.

Requesting the data should allow for limiting the period by a timestamp (e.g. all records after 2021-11-11).

There are two ways we can go about delivering the data:

  • pagination
  • limit on number of records

Pagination

This approach is quite simple - break the data down into pages with predefined size and allow provide a link to the next page in the payload. If that link is not present then the user has the last page of data.

Example payload:

{
    "hashes": [ <JSON Array of hash objects> ],
    "nextPage": <link to the next page>
}

This approach can work with the other standard approach where the offset if given by query parameters.

The main advantage of this approach is that clients won't need to process the data before querying the next page.

Limit the number of records returned

This works in a slight less obvious way but it achieves the same thing - we still limit the number of records we return but we do not provide pagination. Instead, the user can read and parse the data, figure out the last timestamp present and make a new request with that timestamp+1ns.

The main advantage of this approach is the sheer simplicity of not implementing pagination at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions