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

@AmosOO7
Copy link

AmosOO7 commented Apr 1, 2025

Hello @SharanRP,
All the tests I’ve performed are working so far. The only issue I encountered was a formatting error when I ran the fmt check.

@SharanRP
Copy link
Author

SharanRP commented Apr 2, 2025

@AmosOO7 Alright, I’ll make the necessary fixes and push the patch.

@SharanRP
Copy link
Author

@luisschwab I will make the changes and push the PR

@SharanRP SharanRP closed this Apr 24, 2025
@github-project-automation github-project-automation bot moved this from Discussion to Done in BDK Chain Apr 24, 2025
@SharanRP
Copy link
Author

This PR has been moved to the new bdk_wallet repo as requested: bdk_wallet PR #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants