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

NUT-XX: WebSocket state updates #98

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

NUT-XX: WebSocket state updates #98

wants to merge 10 commits into from

Conversation

Egge21M
Copy link
Contributor

@Egge21M Egge21M commented Mar 21, 2024

This is my second take on an optional WebSocket protocol to allow bidirectional messages between clients and mints. WebSockets allow mints to push updates to clients without clients constantly polling them.

The proposal uses ids to keep track of requests, which removed the need to close and open sockets all the time and also allows for multiple request on a single socket connection.

@Egge21M Egge21M marked this pull request as ready for review March 26, 2024 14:19
XX.md Outdated
All requests sent from apps to mints over Websocket MUST look like this

```json
["REQ", "<REQ ID>", "<COMMAND>", "<PARAMS>"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to use the JSON-RPC format here?

Copy link
Contributor Author

@Egge21M Egge21M Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have strong opinions about this. The format is already very close to the RPC spec so I wouldn't mind. What would be the benefit of adhering to it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the benefit of adhering to it?

I'd guess mainly existing client libraries for using JSON-RPC rather than having to write your own

@callebtc callebtc changed the title WebSocket protocol for state updates NUT-XX: WebSocket state updates May 11, 2024
@callebtc callebtc added needs implementation Needs a reference implementation new nut A new protocol NUT labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs implementation Needs a reference implementation new nut A new protocol NUT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants