Skip to content

Conversation

SharanRP
Copy link

Description

Enhanced the example_wallet_rpc to output information in JSON format instead of plain text. This change makes it easier to extract and process information using tools like jq, improving integration with shell scripts and external CLI tools.

Key changes:

  • Added JSON structured output for all logging/status messages
  • Added event types to distinguish different output messages
  • Maintained all existing functionality while only changing the output format
  • Added serde_json dependency for JSON serialization

Notes to the reviewers

The change is minimal and non-breaking - all the same information is being output, just in a structured JSON format. Each message includes an "event" field to easily identify the type of output, making it simpler to filter and process specific information.

The JSON format was chosen over other structured formats (like YAML) because:

  1. It's widely supported across all platforms
  2. Has excellent tooling support (jq, python json, etc.)
  3. Is easily parseable by most programming languages
  4. Maintains human readability with pretty printing

Changelog notice

Added:

  • JSON structured output format for example_wallet_rpc, enabling better integration with external tools and scripts

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant