Skip to content

Feature/peerx cli health checks#113

Merged
ameeribro4-sudo merged 3 commits into
OpenPeerX:mainfrom
coderolisa:feature/peerx-cli-health-checks
Jul 20, 2026
Merged

Feature/peerx cli health checks#113
ameeribro4-sudo merged 3 commits into
OpenPeerX:mainfrom
coderolisa:feature/peerx-cli-health-checks

Conversation

@coderolisa

Copy link
Copy Markdown
Contributor

CLOSES #94

Complete PeerX CLI Implementation

Fully functional peerx health command
All 5 health checks implemented
Exit codes: 0 (healthy), 1 (warning), 2 (critical)
JSON, YAML, and human-readable output
Comprehensive Documentation

Detailed README with examples
CHANGELOG for v0.1.0
PR description ready
Example scripts for CI/CD and monitoring
Code Quality

✅ Compiles successfully
✅ Tests included
✅ Follows Rust best practices

coderolisa and others added 3 commits July 20, 2026 13:09
Implements comprehensive pre-flight health checks for PeerX Contracts:

Features:
- Health check subcommand with 6 critical checks:
  * RPC endpoint reachability (critical)
  * Horizon API reachability (warning)
  * Admin account verification (variable severity)
  * Contract existence validation (critical)
  * Contract pause state check (critical)
  * Oracle data freshness check (warning)

- Exit codes following Unix conventions:
  * 0 = healthy (all checks passed)
  * 1 = degraded (warnings present)
  * 2 = unhealthy (critical failures)

- Multiple output formats:
  * Human-readable (default, colored terminal output)
  * JSON (for automation and parsing)
  * YAML (for structured logging)

- Flexible configuration:
  * Environment variables
  * Config files (./peerx-cli.json or ~/.config/peerx/config.json)
  * Command-line arguments
  * Configuration precedence hierarchy

- Comprehensive documentation:
  * README.md with installation and quick start
  * USAGE.md with detailed usage patterns and examples
  * Example configuration file
  * CI/CD integration examples (GitHub Actions, GitLab, Docker)
  * Monitoring integration patterns

- Test coverage:
  * Unit tests for health report logic
  * Tests for status determination
  * Tests for summary calculations
  * All tests passing

Technical details:
- Built with Rust using Tokio async runtime
- Uses reqwest with rustls for HTTP requests
- Structured error handling with thiserror
- Colored terminal output with colored crate
- Clap for CLI argument parsing
- Full async/await support

Resolves observability and DX requirements for pre-flight checks.

Co-authored-by: Kiro <kiro@example.com>
…ve documentation

- Consolidate health check logic into single health.rs module
- Add comprehensive README with usage examples and troubleshooting
- Add CHANGELOG documenting v0.1.0 release
- Create example scripts for CI/CD integration and monitoring
- Implement all 5 health checks:
  * RPC endpoint reachability
  * Contract existence verification
  * Contract pause status
  * Admin address validation
  * Oracle data freshness
- Add exit codes: 0 (healthy), 1 (warning), 2 (critical)
- Support JSON, YAML, and human-readable output formats
- Add flexible configuration via CLI args, env vars, and config files
- Include unit tests and integration test stubs
- Compile successfully with cargo build --release

Resolves observability and DX requirements for pre-flight health checks.

@ameeribro4-sudo ameeribro4-sudo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ameeribro4-sudo
ameeribro4-sudo merged commit 506e891 into OpenPeerX:main Jul 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PeerX Backlog # 94] Surface healthcheck endpoint in CLI

2 participants