Feature/peerx cli health checks#113
Merged
ameeribro4-sudo merged 3 commits intoJul 20, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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