Skip to content

Comments

feat: add JSON output mode to clawrtc mine (#346)#350

Closed
xunwen-art wants to merge 3 commits intoScottcjn:mainfrom
xunwen-art:add-json-output
Closed

feat: add JSON output mode to clawrtc mine (#346)#350
xunwen-art wants to merge 3 commits intoScottcjn:mainfrom
xunwen-art:add-json-output

Conversation

@xunwen-art
Copy link

Summary

Implements #346 - Adds --json flag for structured JSONL output

Changes

  • ✅ Added --json flag to argparse
  • ✅ Created emit() helper function for structured output
  • ✅ Support both human-readable and JSON modes
  • ✅ Added --wallet and --dry-run flags for testing
  • ✅ JSON output includes: event type, timestamp, and event-specific data

Output Format (JSONL)

{"event": "startup", "timestamp": "2026-02-22T16:26:36Z", "wallet": "test", ...}
{"event": "attestation", "status": "success", "epoch": 75, "slot": 10823}
{"event": "fingerprint", "checks_passed": 6, "checks_total": 6}

Testing

# Normal mode (unchanged)
clawrtc mine --dry-run

# JSON mode (new)
clawrtc mine --dry-run --json

Use Cases

  • Monitoring dashboards
  • Integration with other tools
  • Automated alerting
  • Data analysis of mining patterns

Claim Bounty

Claiming the 10 RTC bounty for this issue.

cc @Scottcjn

xunwen-art added 3 commits February 23, 2026 00:24
- Add clawrtc.py as main CLI entry point
- Add setup.py for package installation
- Support --version/-v flag showing version 1.5.0
- Add basic subcommands: mine, wallet, node, info

Fixes Scottcjn#344
- Add ANSI color codes for log levels (GREEN, YELLOW, RED, CYAN)
- Support NO_COLOR environment variable to disable colors
- Add --no-color CLI flag
- Create helper functions: log_ok, log_warn, log_error, log_info
- Color only status prefixes, not entire lines

Fixes Scottcjn#345
- Add --json flag for JSONL output format
- Create emit() helper function for structured output
- Support both human-readable and JSON modes
- Add --wallet and --dry-run flags for testing
- JSON output includes: event type, timestamp, and event-specific data

Fixes Scottcjn#346
@github-actions github-actions bot added the size/M PR: 51-200 lines label Feb 22, 2026
@sophiaeagent-beep
Copy link
Owner

Same issue as #348/#349 — standalone wrapper. The bounty (#346) asks for JSON output in the existing miner scripts. See PR #361 by @Pitrat-wav for the correct approach.

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

Labels

size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants