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: filterv2 REST API #746

Closed
richard-ramos opened this issue Sep 15, 2023 · 9 comments
Closed

feat: filterv2 REST API #746

richard-ramos opened this issue Sep 15, 2023 · 9 comments
Labels
E:REST API service node See https://github.com/waku-org/pm/issues/82 for details

Comments

@richard-ramos
Copy link
Member

Implement filterV2 REST API, following this openapi yml file: https://github.com/waku-org/nwaku/pull/1890/files#diff-d0d5d66c0f96582065344acd54ce7f1b65fb973ed201435ac0689020c3464dce
The REST api is currently located at https://github.com/waku-org/go-waku/tree/master/cmd/waku/server/rest

The focus of the task should be limited to only the REST server as the RPC can be considered deprecated and will be removed eventually so it's not worth it to add FilterV2 functionality to it.

@harsh-98
Copy link
Contributor

harsh-98 commented Oct 9, 2023

For /v2/subscriptions/{requestId} in nwaku filter yaml, I tried to check if we store ping request id in server.go but i couldn't find it being used. So, there is no relation btw requestId and peerId. As a result, i can't check if there is a subscription for given request Id.
For this should i store requestId to peerId in a map?
Or will peerId be supplied as requestId in subscription/{requestId} endpoint get request?
Or does the requestId refers to subscriptionDetails.Id not the id generated for ping request?

@harsh-98
Copy link
Contributor

harsh-98 commented Oct 9, 2023

Is this functionality to be implemented for LightNode or FullNode?

@harsh-98
Copy link
Contributor

@richard-ramos filter v2 get messages endpoint only takes ContentTopic, no pubsubTopic. Does this mean to derive the pubsubTopic from contentTopic or to get messages on all pubsubTopics that matches contentTopic? https://github.com/waku-org/nwaku/blob/master/waku/waku_api/rest/filter/openapi.yaml#L335-L348

@richard-ramos
Copy link
Member Author

I think this is where we need to deviate from the defined openapi.yaml file.

We need to be able to optionally define the pubsub topic. If it is not defined, we need to derive the pubsub topic from the content topics (similar to this https://github.com/waku-org/go-waku/blob/5dfbd98c74d21664caea1d6722c28d120f52c04b/waku/v2/protocol/filter/client.go#L144C3-L156), but if specified, we need to return the messages that match both the content topic and pubsub topic.

@richard-ramos
Copy link
Member Author

Perhaps a separate endpoint? i.e.: /filter/v2/messages_by_pubsubTopic/{pubsubTopic}/{contentTopic}:

@harsh-98
Copy link
Contributor

Ok, i will add both endpoints, /filter/v2/messages_by_pubsubTopic/{pubsubTopic}/{contentTopic} and /filter/v2/messages/{contentTopic}, where pubsub is derived from contentTopic.

@harsh-98
Copy link
Contributor

harsh-98 commented Nov 6, 2023

Weekly update

  • achieved: Completed. Working on rust-binding issues.

@fryorcraken fryorcraken added the E:REST API service node See https://github.com/waku-org/pm/issues/82 for details label Nov 7, 2023
@chaitanyaprem
Copy link
Collaborator

@richard-ramos is this something that is required on rust-bindings?
Else we can descope this from go-waku.

@richard-ramos
Copy link
Member Author

Not required. REST server is not used in bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:REST API service node See https://github.com/waku-org/pm/issues/82 for details
Projects
Archived in project
Development

No branches or pull requests

4 participants