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.
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 inforeign/node/src/wire/command.code.ts(GetSnapshot: 11, marked@TODO), but nothing uses it.What to do
foreign/node/src/wire/system/snapshot.command.ts, followingget-stats.command.tsin the same folder. The request and response formats are incore/binary_protocol/src/requests/system/get_snapshot.rsandcore/binary_protocol/src/responses/system/get_snapshot.rs.system/index.tsand register it inforeign/node/src/wire/command-set.tsnext togetStats.@TODOon theGetSnapshotentry.foreign/node/src/e2e/tcp.raw.e2e.tsnext to thegetStatsone.Done when
snapshotreturns a non-empty result against a running server, and the new tests pass.