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

Entity envelope in rest api #252

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

zajko
Copy link
Contributor

@zajko zajko commented Mar 4, 2024

Changed REST API endpoint so that they don't return simply the stored event. Instead we wrap the sse events in an envelope which looks like:
{ "header": { "api_version": "2.0.0", "network_name": "casper" }, "payload": {(...)} }

Events in endpoints that return lists (like signatures for block) will also have each individual element of the list wrapped in such envelope.
In the above the header fields:
  • "api_version" is the api version which was reported in the ApiVersion message for the node that we fetched the event from.
  • "network_name" is the "chainspec_name" field that was returned in the "/status" endpoint for the node that we fetched the event from.

@zajko zajko changed the base branch from dev to feat-2.0 March 4, 2024 17:00
@zajko zajko force-pushed the entity_envelope_in_rest_api branch 4 times, most recently from e500033 to bedeb9e Compare March 4, 2024 18:04
@zacshowa
Copy link
Contributor

zacshowa commented Mar 4, 2024

LGTM

… event. Instead we wrap the sse events in an envelope which looks like:

    ```
    {
        "header": {
            "api_version": "2.0.0",
            "network_name": "casper"
        },
        "payload": {(...)}
    }
    ```

Events in endpoints that return lists (like signatures for block) will also have each individual element of the list wrapped in such envelope.
In the above the header fields:
* "api_version" is the api version which was reported in the ApiVersion message for the node that we fetched the event from.
* "network_name" is the "chainspec_name" field that was returned in the "/status" endpoint for the node that we fetched the event from.
@zajko zajko force-pushed the entity_envelope_in_rest_api branch from bedeb9e to e544f78 Compare March 5, 2024 09:22
@zajko zajko merged commit ff4f272 into casper-network:feat-2.0 Mar 5, 2024
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.

3 participants