Skip to content

Node SDK: wire up snapshot #4331

Description

@justinmclean

The Rust client has SystemClient::snapshot (core/common/src/traits/system_client.rs), which returns a compressed snapshot of server state for debugging. It is the only client call the Node SDK does not have. The command code is already in foreign/node/src/wire/command.code.ts (GetSnapshot: 11, marked @TODO), but nothing uses it.

What to do

  • Add foreign/node/src/wire/system/snapshot.command.ts, following get-stats.command.ts in the same folder. The request and response formats are in core/binary_protocol/src/requests/system/get_snapshot.rs and core/binary_protocol/src/responses/system/get_snapshot.rs.
  • Export it from system/index.ts and register it in foreign/node/src/wire/command-set.ts next to getStats.
  • Remove the @TODO on the GetSnapshot entry.
  • Add a unit test for the serialisation, and an e2e test in foreign/node/src/e2e/tcp.raw.e2e.ts next to the getStats one.

Done when

snapshot returns a non-empty result against a running server, and the new tests pass.

Activity

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

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersjavascriptPull requests that update javascript code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions