{"id":29009749,"url":"https://github.com/hasip-timurtas/solana-watchtower","last_synced_at":"2026-05-16T12:31:03.295Z","repository":{"id":301003385,"uuid":"1007172918","full_name":"hasip-timurtas/solana-watchtower","owner":"hasip-timurtas","description":"🛡️ Watch and analyze Solana programs in real time. Alerts, metrics, logs, rules, and dashboards for on-chain activity.","archived":false,"fork":false,"pushed_at":"2025-06-25T15:03:52.000Z","size":503,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-06T18:06:35.196Z","etag":null,"topics":["alerts","auditing","blockchain","cli-tool","monitoring","rust","security","smart-contracts","solana","solana-program","watchtower"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hasip-timurtas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T15:14:53.000Z","updated_at":"2025-06-28T07:51:43.000Z","dependencies_parsed_at":"2025-06-24T17:55:35.327Z","dependency_job_id":null,"html_url":"https://github.com/hasip-timurtas/solana-watchtower","commit_stats":null,"previous_names":["hasip-timurtas/solana-watchtower"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hasip-timurtas/solana-watchtower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasip-timurtas%2Fsolana-watchtower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasip-timurtas%2Fsolana-watchtower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasip-timurtas%2Fsolana-watchtower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasip-timurtas%2Fsolana-watchtower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasip-timurtas","download_url":"https://codeload.github.com/hasip-timurtas/solana-watchtower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasip-timurtas%2Fsolana-watchtower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33102715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alerts","auditing","blockchain","cli-tool","monitoring","rust","security","smart-contracts","solana","solana-program","watchtower"],"created_at":"2025-06-25T15:14:18.641Z","updated_at":"2026-05-16T12:31:03.276Z","avatar_url":"https://github.com/hasip-timurtas.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛡️ Solana Watchtower\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Rust](https://img.shields.io/badge/rust-1.80+-orange.svg)](https://www.rust-lang.org)\n[![Security](https://img.shields.io/badge/Security-Audited-green.svg)](./SECURITY.md)\n[![Docker](https://img.shields.io/badge/Docker-Ready-blue.svg)](./docker/)\n\n**Real-time Solana program monitoring and alerting system with advanced security rules and multi-channel notifications.**\n\nSolana Watchtower is an open-source, production-ready monitoring system for Solana programs. It provides real-time WebSocket monitoring, custom alerting rules, performance metrics, and comprehensive notification channels.\n\n## ✨ Features\n\n### 🔍 **Real-time Monitoring**\n- WebSocket and Geyser plugin integration for live program event tracking\n- Account and instruction monitoring with configurable filters\n- Transaction pattern analysis and anomaly detection\n- Program state change tracking\n\n### 🚨 **Advanced Alert System**\n- Built-in security rules (liquidity drops, large transactions, oracle deviations)\n- Custom rule engine with Rust-based rule development\n- Alert batching and rate limiting to prevent spam\n- Severity-based alert routing and escalation\n\n### 📢 **Multi-channel Notifications**\n- **Email**: SMTP with HTML/text templates\n- **Telegram**: Bot integration with rich formatting\n- **Slack**: Webhook and app integrations\n- **Discord**: Webhook notifications with embeds\n\n### 📊 **Performance Metrics**\n- Prometheus integration with custom metrics\n- Real-time performance tracking and analytics\n- Historical data analysis with configurable retention\n- Grafana-ready dashboards and visualizations\n\n### 🌐 **Web Dashboard**\n- Real-time monitoring dashboard with WebSocket updates\n- Alert management and configuration interface\n- Historical metrics and trend analysis\n- Responsive design for mobile and desktop\n\n### 🏗️ **Production Ready**\n- Modular Rust crate architecture\n- Comprehensive error handling and logging\n- Configuration validation and testing tools\n- Docker containers with orchestration support\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **Rust**: 1.80+ (for local builds)\n- **Docker**: 20.10+ (recommended for deployment)\n- **Solana RPC**: Access to Solana RPC and WebSocket endpoints\n\n### 🐳 Docker Deployment (Recommended)\n\n```bash\n# Clone the repository\ngit clone https://github.com/hasip-timurtas/solana-watchtower.git\ncd solana-watchtower\n\n# Copy and configure environment\ncp docker/env.example .env\nnano .env  # Configure RPC URLs and notification settings\n\n# Start with Docker Compose\ndocker-compose -f docker/docker-compose.yml up -d\n\n# Access the dashboard\nopen http://localhost:8080\n```\n\n### 🛠️ Local Development\n\n```bash\n# Build from source\ngit clone https://github.com/hasip-timurtas/solana-watchtower.git\ncd solana-watchtower\ncargo build --release\n\n# Copy example configuration\ncp configs/watchtower.toml ./my-config.toml\nnano my-config.toml  # Edit with your settings\n\n# Start monitoring\n./target/release/watchtower start --config ./my-config.toml\n```\n\n## 📖 Usage\n\n### Basic Commands\n\n```bash\n# Start monitoring with default configuration\nwatchtower start\n\n# Start with custom configuration and verbose logging\nwatchtower start --config ./custom.toml --verbose\n\n# Test notification channels\nwatchtower test-notifications --config ./config.toml\n\n# Validate configuration file\nwatchtower validate-config --config ./config.toml\n\n# List available monitoring rules\nwatchtower rules list\n\n# Get detailed help\nwatchtower --help\n```\n\n### Web Dashboard\n\nAccess the dashboard at `http://localhost:8080` to:\n- Monitor real-time alerts and program activity\n- Configure monitoring rules and thresholds\n- Manage notification channels and settings\n- View historical metrics and performance data\n\n## 🔧 Configuration\n\n### Basic Configuration\n\nCreate a `watchtower.toml` configuration file:\n\n```toml\n# Solana connection settings\n[solana]\nrpc_url = \"https://api.mainnet-beta.solana.com\"\nws_url = \"wss://api.mainnet-beta.solana.com\"\n\n# Programs to monitor\n[[programs]]\nname = \"my-defi-protocol\"\naddress = \"YourProgramPublicKey...\"\nmonitor_accounts = true\nmonitor_instructions = true\n\n# Monitoring rules\n[[rules]]\nname = \"large-transaction\"\ntype = \"transaction_size\"\nthreshold = 1000000  # 1M lamports\nseverity = \"high\"\n\n# Notification settings\n[notifications]\n[[notifications.channels]]\nname = \"telegram-alerts\"\ntype = \"telegram\"\nenabled = true\nbot_token = \"your-bot-token\"\nchat_id = \"your-chat-id\"\n```\n\n### Advanced Configuration\n\nSee [`examples/configs/`](./examples/configs/) for comprehensive configuration examples:\n- `basic-mainnet.toml` - Simple mainnet monitoring\n- `defi-focused.toml` - DeFi protocol monitoring\n- `production-multi-program.toml` - Enterprise setup\n\n## 🛡️ Security\n\n### Security Posture\n\nSolana Watchtower maintains a **strong security posture**:\n\n- ✅ **60% reduction** in security vulnerabilities through recent updates\n- ✅ **Updated dependencies**: Solana SDK 1.16→1.18, Prometheus, Validator\n- ✅ **Documented risks**: All remaining issues documented in [`SECURITY.md`](./SECURITY.md)\n- ✅ **Low risk profile**: Read-only monitoring, no private key handling\n\n### Recent Security Improvements\n\n| Component | Improvement | Impact |\n|-----------|-------------|--------|\n| **Solana SDK** | 1.16 → 1.18 | Fixed multiple cryptographic vulnerabilities |\n| **Prometheus** | 0.13 → 0.14 | Updated to secure version |\n| **Validator** | 0.16 → 0.20 | Resolved IDNA vulnerability |\n| **Docker** | Rust nightly | Support for latest security features |\n\n### Known Issues\n\n3 remaining low-risk vulnerabilities from Solana ecosystem dependencies. See [`SECURITY.md`](./SECURITY.md) for complete details and mitigation strategies.\n\n## 🏗️ Architecture\n\n### Crate Structure\n\n```\nsolana-watchtower/\n├── crates/\n│   ├── cli/           # Command-line interface\n│   ├── engine/        # Core monitoring engine and rules\n│   ├── subscriber/    # Solana WebSocket client and event processing\n│   ├── notifier/      # Multi-channel notification system\n│   └── dashboard/     # Web dashboard and API\n├── configs/           # Configuration examples\n├── docker/           # Docker deployment files\n└── examples/         # Usage examples and templates\n```\n\n### Service Components\n\n1. **Subscriber**: Connects to Solana RPC/WebSocket, processes events\n2. **Engine**: Applies monitoring rules, generates alerts\n3. **Notifier**: Manages notification channels and rate limiting\n4. **Dashboard**: Web interface and metrics API\n\n## 🔌 Custom Rules\n\nCreate custom monitoring rules by implementing the `Rule` trait:\n\n```rust\nuse watchtower_engine::{Rule, RuleContext, AlertSeverity};\n\npub struct CustomLiquidationRule {\n    threshold: u64,\n}\n\nimpl Rule for CustomLiquidationRule {\n    fn name(\u0026self) -\u003e \u0026str {\n        \"custom_liquidation\"\n    }\n\n    fn check(\u0026self, ctx: \u0026RuleContext) -\u003e Option\u003cAlert\u003e {\n        // Your custom logic here\n        if liquidation_detected(\u0026ctx.event) {\n            Some(Alert {\n                severity: AlertSeverity::High,\n                message: \"Large liquidation detected\".to_string(),\n                program: ctx.program.clone(),\n                // ... more fields\n            })\n        } else {\n            None\n        }\n    }\n}\n```\n\n## 🐳 Docker Deployment\n\n### Quick Start\n\n```bash\n# Development environment\ndocker-compose -f docker/docker-compose.yml up -d\n\n# Production with nginx and monitoring\ndocker-compose -f docker/docker-compose.yml --profile production up -d\n```\n\n### Service Stack\n\n- **Watchtower**: Main monitoring application\n- **Redis**: Alert deduplication and rate limiting  \n- **Prometheus**: Metrics storage and analysis\n- **Grafana**: Visualization dashboards\n- **Nginx**: Reverse proxy (production profile)\n\nSee [`docker/README.md`](./docker/README.md) for detailed deployment instructions.\n\n## 📊 Monitoring \u0026 Metrics\n\n### Built-in Metrics\n\n- Program activity rates and transaction volumes\n- Alert generation rates and severity distribution\n- WebSocket connection health and latency\n- Notification delivery success rates\n\n### Prometheus Integration\n\n```yaml\n# Scrape configuration for Prometheus\nscrape_configs:\n  - job_name: 'watchtower'\n    static_configs:\n      - targets: ['watchtower:9090']\n```\n\n### Grafana Dashboards\n\nPre-configured dashboards available in [`docker/grafana/dashboards/`](./docker/grafana/dashboards/).\n\n## 🤖 CI/CD Integration\n\n### GitHub Actions\n\n```yaml\nname: Watchtower Security Check\n\non: [push, pull_request]\n\njobs:\n  security:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    \n    - name: Build Watchtower\n      run: |\n        docker build -f docker/Dockerfile .\n    \n    - name: Security Audit\n      run: |\n        cargo audit\n      continue-on-error: true  # Documented acceptable risks\n```\n\n## 📚 Examples\n\nThe [`examples/`](./examples/) directory contains:\n\n- **Configuration Examples**: Ready-to-use configs for different scenarios\n- **Custom Rules**: Example rule implementations for specific use cases\n- **Notification Templates**: Channel-specific message formatting\n- **Deployment Scripts**: Infrastructure as Code examples\n- **Integration Examples**: Webhook receivers and API clients\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [contributing guidelines](./CONTRIBUTING.md).\n\n### Development Setup\n\n```bash\n# Clone and setup\ngit clone https://github.com/hasip-timurtas/solana-watchtower.git\ncd solana-watchtower\n\n# Install dependencies\ncargo build\n\n# Run tests\ncargo test\n\n# Check formatting and lints\ncargo fmt --check\ncargo clippy -- -D warnings\n```\n\n### Adding Features\n\n1. Create a feature branch\n2. Implement your changes\n3. Add tests and documentation\n4. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Resources\n\n- **Documentation**: [Project Wiki](https://github.com/hasip-timurtas/solana-watchtower/wiki)\n- **Security**: [Security Policy](./SECURITY.md)\n- **Docker**: [Deployment Guide](./docker/README.md)\n- **Examples**: [Configuration Examples](./examples/README.md)\n- **Issues**: [GitHub Issues](https://github.com/hasip-timurtas/solana-watchtower/issues)\n\n## 🙏 Acknowledgments\n\n- The Solana Foundation for supporting monitoring infrastructure\n- The Rust community for excellent tooling and libraries\n- Contributors and early adopters who help improve the project\n\n---\n\n**⚠️ Important**: Solana Watchtower is a monitoring tool that helps detect potential issues but does not guarantee complete security. Always conduct thorough testing and consider professional security audits for production applications.\n\n**Built with ❤️ by Hasip Timurtas for the Solana ecosystem***","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasip-timurtas%2Fsolana-watchtower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasip-timurtas%2Fsolana-watchtower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasip-timurtas%2Fsolana-watchtower/lists"}