Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Sim2h space data remote debugging #2128

Merged
merged 16 commits into from
Mar 2, 2020
Merged

Sim2h space data remote debugging #2128

merged 16 commits into from
Mar 2, 2020

Conversation

lucksus
Copy link
Collaborator

@lucksus lucksus commented Feb 24, 2020

PR summary

Adds a WireMessge::Debug and WireMessage::DebugResponse(BTreeMap<SpaceHash, String>) to retrieve all space data as JSON serialized string.

hc can request this debug state dump and write it to file(s) (each space data into a separate one):

[nix-shell:~/hc]$ hc sim2h-client --message debug --url ws://localhost:9000
url: ws://localhost:9000
message: debug
connecting to: ws://127.0.0.1:9000/
Generated agent id: HcSCiDdSTjGaajts3zqY9WqC4zfJhnuhs8m4R6rC35RwObu8Uc6seVaYWe9eija
Await successfull
Sending wire message to sim2h: Debug
Ack(3079098903191232539)
Got DebugResponse for 1 spaces.
Writing Sim2h state dump for space QmXghcjdFQ7vEvihuBVQdiQBATGnRo6qX5wNxrq6HdNH9i to file: QmXghcjdFQ7vEvihuBVQdiQBATGnRo6qX5wNxrq6HdNH9i.json

testing/benchmarking notes

( if any manual testing or benchmarking was/should be done, add notes and/or screenshots here )

followups

Make this optional (per command line parameter / configuration) such that public sim2h servers don't offer potential sensitive information to everybody

changelog

  • if this is a code change that effects some consumer (e.g. zome developers) of holochain core, then it has been added to our between-release changelog with the format
- summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)

documentation

@zippy
Copy link
Member

zippy commented Feb 24, 2020

I think this is going to need dumping just the response to a file maybe JSON encoded to be usefull?

@lucksus
Copy link
Collaborator Author

lucksus commented Feb 24, 2020

I think this is going to need dumping just the response to a file maybe JSON encoded to be usefull?

Yep, mainly why I left this as WIP. The current plain debug output is hard to read..

@lucksus lucksus changed the title WIP: Sim2h debug message Sim2h space data remote debugging Feb 24, 2020
@lucksus lucksus marked this pull request as ready for review February 24, 2020 20:29
@zippy
Copy link
Member

zippy commented Feb 25, 2020

Fails if message debug data is bigger than max tungstenite message size!

Copy link
Member

@zippy zippy left a comment

Choose a reason for hiding this comment

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

WOOT!

@zippy zippy merged commit 69b02c3 into develop Mar 2, 2020
@neonphog neonphog deleted the sim2h-debug-message branch March 6, 2020 00:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants