Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how lazy pagination works #426

Open
0x009922 opened this issue Nov 3, 2023 · 0 comments
Open

Document how lazy pagination works #426

0x009922 opened this issue Nov 3, 2023 · 0 comments
Labels
I-concepts Core Iroha concepts (data model, operations, mechanics)

Comments

@0x009922
Copy link
Contributor

0x009922 commented Nov 3, 2023

Description

Query API supports lazy pagination. Currently it is not documented in the reference (https://hyperledger.github.io/iroha-2-docs/api/torii-endpoints.html#query). I propose to document it.

How it works

Originally posted by @Arjentix: #397 (comment)

So basically after hyperledger-iroha/iroha#3958 users should send either SignedQuery with Pagination and Sorting or just ForwardCursor.

SignedQuery -- an Iroha query signed by a user keypair
Pagination -- struct with two numbers: limit of indexing and start of indexing. If both are zeros, then pagination is not applied
Sorting -- currently we support sorting only by a metadata key of an asset metadata. So that user can place Name (string with some contrains on its content) inside and then all output assets will be sorted by a value of the specified key if there is some. Sorting can contain nothing as well, in that case it won't be applied.
ForwardCursor -- at first you don't have it. But if the output of your query is a big array, then you'll get a cursor from Iroha with a part of the answer. To get the other parts you should provide this cursor to Iroha in a new request. Repeat this step until cursor is depleted (you'll know that by getting empty cursor or error).

@0x009922 0x009922 added documentation M-meta Issues/PRs on the documentation itself (presentation, localization, navigation, etc.) labels Nov 3, 2023
@github-actions github-actions bot added the iroha2 label Nov 3, 2023
@nxsaken nxsaken added I-concepts Core Iroha concepts (data model, operations, mechanics) and removed iroha2 M-meta Issues/PRs on the documentation itself (presentation, localization, navigation, etc.) labels May 16, 2024
@nxsaken nxsaken added the A-important High-impact, important change label May 24, 2024
@nxsaken nxsaken modified the milestone: 2.0.0-rc.1.0 May 27, 2024
@nxsaken nxsaken removed A-important High-impact, important change labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-concepts Core Iroha concepts (data model, operations, mechanics)
Projects
None yet
Development

No branches or pull requests

2 participants