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

feat: HTTP REST API: Store Client API #1611

Closed
3 tasks
jm-clius opened this issue Mar 17, 2023 · 1 comment
Closed
3 tasks

feat: HTTP REST API: Store Client API #1611

jm-clius opened this issue Mar 17, 2023 · 1 comment
Assignees

Comments

@jm-clius
Copy link
Contributor

Background

This forms a subtask of #1076.
Nwaku nodes operating as 13/WAKU2-STORE clients can use the store protocol to query waku archive nodes for historical, cached messages.
Currently these queries can be triggered in clients in one of two ways:

The only way to externally trigger store queries to a remote archive is therefore using the JSON-RPC API.

However, the JSON-RPC API is clunky to use and call signatures outdated. As such, we've started migrating to an HTTP REST API. What's more, we've since simplified and flattened the internal Nim API for store client queries, removing unnecessary constructs like nested content filters, which still exists on the JSON-RPC API.

Suggested solution

Create and expose a Store Client HTTP REST API functionality. It should use the existing Relay REST API as inspiration and follow the same patterns and structure. Although, the JSON-RPC API can be referred to, the new API method should follow the simplified internal API to construct the query objects.

As part of this effort, #1575 should also be addressed - which simply allows store client API endpoints to be installed and exposed, regardless of node configuration.

Acceptance criteria

  • working HTTP Store Client REST API to perform history queries on remote archive nodes
  • sufficient unit tests for basic functionality
  • integration of Store Client API into the wakunode2 app
@Ivansete-status
Copy link
Collaborator

As per @jm-clius advise, we will use this HistoryResponse object instead of the one described in get_waku_v2_store_v1_messages and currently used by the JSON-RPC API.

That will make the solution simpler.

Ivansete-status added a commit that referenced this issue Mar 30, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests. Pending to implement the paginagion use cases.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (json-rpc & rest) without explicit storenode (#1575)
Ivansete-status added a commit that referenced this issue Apr 4, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)
Ivansete-status added a commit that referenced this issue Apr 4, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)
Ivansete-status added a commit that referenced this issue Apr 6, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)

* feat: always mounting the current node as storenode client
Ivansete-status added a commit that referenced this issue Apr 6, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)

* feat: always mounting the current node as storenode client
Ivansete-status added a commit that referenced this issue Apr 6, 2023
…1611)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)

* feat: always mounting the current node as storenode client
Ivansete-status added a commit that referenced this issue Apr 6, 2023
…1611) (#1630)

* feat: new rest api based on the current store json-rpc api and
following the same structure as the current relay rest api.

* feat: the store api attend GET requests to retrieve historical messages

* feat: unit tests.

* feat: allow return message to rest-client in case error (4XX or 5XX)

* chore: always allow to call the store api endpoints (only rest) without explicit storenode (#1575)

* feat: always mounting the current node as storenode client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants