Skip to content

Implemented websocket /feed on HTTP (REST) API#237

Open
vtnerd wants to merge 1 commit intodevelopfrom
feature/push_squashed
Open

Implemented websocket /feed on HTTP (REST) API#237
vtnerd wants to merge 1 commit intodevelopfrom
feature/push_squashed

Conversation

@vtnerd
Copy link
Copy Markdown
Owner

@vtnerd vtnerd commented Feb 26, 2026

This is marked as a draft until the client implementation is done. I want to make sure the protocol works before even merging this code.

This design adds a /feed endpoint that is not REST, instead the endpoint is a web socket push/stream protocol. The user logs in via address + viewkey, then automatically gets the entire state of transactions from the server. The schema differs from the existing REST api in that the minimum amount of data to support the wallet_api.h is sent (the existing REST API had lots of data redundancy).

After that initial sync, the /feed interface sends "raw" scanner information to the frontend, via ZMQ internally, including mempool matches and all newly scanned blocks. Reorgs and monerod disconnects are also reported to the clients. If the /feed threads are overloaded and miss internal ZMQ messages, this is detected and the stream errors out.

The design supports both JSON and msgpack, the latter being ~10% faster in prior tests.

There are some basic tests, but more would be useful. At this stage I'd rather get a real client so that I can test viability of the design. There will also be a markdown explanation of the final protocol.

@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Feb 26, 2026

I'm going to "rebrand" this as /feed to avoid confusion with web push type stuff. The REST endpoint for establishing a web push will likely be /push instead.

*if ever implemented, as its more complex than /feed

@vtnerd vtnerd changed the title Implemented websocket /push on HTTP (REST) API Implemented websocket /feed on HTTP (REST) API Feb 26, 2026
@vtnerd vtnerd force-pushed the feature/push_squashed branch 2 times, most recently from d315e0d to 3f60388 Compare February 28, 2026 04:45
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Feb 28, 2026

Renamed just about everything from "/push" to "/feed". The former is basically reserved for w3c "push" messages to clients (which may or may not be implemented).

This also simplified pushing/writing such that a separate write "loop" is easier. This was made possible by leveraging builtin boost::beast::websocket::stream timeout functionality.

@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Feb 28, 2026

Forgot to mention that I added suppression of some block scan messages, primarily when the backend is actively scanning old blocks of an account.

@vtnerd vtnerd force-pushed the feature/push_squashed branch from 3f60388 to 8e79400 Compare March 10, 2026 00:32
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Mar 10, 2026

Force pushed some tweaks to the protocol after implementing the lwsf (frontend) portion. These changes reduce the fields to the bare minimum, and mostly appear working.

A separate issue for "null" tx-hashes was discovered and will be patched separately.

@vtnerd vtnerd force-pushed the feature/push_squashed branch from 8e79400 to b772b27 Compare March 31, 2026 22:38
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Mar 31, 2026

Mostly renames with a few bug fixes. This matches what the client is now doing.

@vtnerd vtnerd force-pushed the feature/push_squashed branch from b772b27 to fdd1e5c Compare April 24, 2026 23:48
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Apr 25, 2026

Rebased and added docs with schemas for /feed

@vtnerd vtnerd force-pushed the feature/push_squashed branch from fdd1e5c to 1fe9edd Compare April 30, 2026 16:35
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Apr 30, 2026

A critical fix for stability, caught with ASAN.

@vtnerd vtnerd marked this pull request as ready for review April 30, 2026 16:46
@vtnerd vtnerd force-pushed the feature/push_squashed branch from 1fe9edd to dfd4fd1 Compare April 30, 2026 16:54
@vtnerd
Copy link
Copy Markdown
Owner Author

vtnerd commented Apr 30, 2026

Tweaked the /feed schema. The id field of spends are no longer required. This is needed for FCMP++ legacy and carrot view-incoming accounts as the backend can only infer a spend through a CHANGE tx (the output being spent cannot be known).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant