Cocoon GPU Pool allows GPU owners to pool computing resources to participate in the Cocoon network, receiving passive income in TON for processing confidential calculations using TEE/SGX technologies.
This repository contains a comprehensive monitoring and management system for pool participants, featuring:
- π Real-time Performance Monitoring - Track GPU utilization, inference requests, and profitability
- π° Payment History & Tax Reports - Complete payout tracking with export functionality
- π Intelligent Alerting - Get notified about worker issues, payments, and performance
- π― Pool Operator Dashboard - Manage all participants and workers from a central interface
- π€ Participant Accounts - Personal dashboards with detailed statistics
- π€ Telegram Bot - Manage workers and receive alerts via Telegram
- π Grafana Integration - Advanced visualization with Prometheus metrics
- π TON Wallet Authentication - Secure access using TON blockchain wallets
# Clone the repository
git clone https://github.com/xlabtg/cocoon-gpu-pool.git
cd cocoon-gpu-pool
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start all services
docker-compose up -d
# Access the dashboard
open http://localhost:3000See docs/SETUP.md for detailed installation instructions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React) β
β Dashboard | Workers | Payouts | Account | TON Connect β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
β Backend API (FastAPI) β
β Workers | Participants | Payouts | Metrics | Alerts β
βββββ¬βββββββββββββββββ¬ββββββββββββββββββ¬βββββββββββββββββββββββ
β β β
βββββ΄βββββ βββββββ΄βββββββ ββββββ΄βββββββ
βPostgreSQLβ βPrometheus β β Redis β
ββββββββββββ β Grafana β βββββββββββββ
ββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Telegram Bot (TypeScript/Node.js) β
β /start | /status | /withdrawals | /settings | /help β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Worker Monitoring: Automatic scraping of worker endpoints (
/stats,/jsonstats,/perf) - Metrics Collection: Time-series data storage with PostgreSQL
- Alert System: Configurable alerts for critical conditions
- Payout Tracking: Integration with TON blockchain for payment verification
- REST API: Comprehensive API with OpenAPI documentation
- Prometheus Exporter: Native metrics export for Prometheus
- Pool Overview: Real-time statistics and performance charts
- Worker Management: Add, configure, and monitor GPU workers
- Payout History: Complete transaction history with tax export
- Personal Account: User profile and notification settings
- TON Wallet Auth: Secure authentication via TON Connect
- Mobile Responsive: Optimized for all device sizes
- Account Management: Register and link TON wallet addresses
- Statistics: View real-time worker performance and earnings
- Payment History: Track all payouts with detailed transaction info
- Notifications: Configurable alerts for payments, equipment issues, and reports
- Multilingual: Full support for Russian and English languages
- Scheduled Reports: Daily and weekly performance summaries
- Prometheus Metrics: Complete observability stack
- Grafana Dashboards: Pre-configured visualization dashboards
- Alert Rules: Worker down, high temperature, performance degradation
- Multi-channel Notifications: Email and Telegram alerts
See docs/API.md for complete API documentation.
Key endpoints:
GET /api/v1/workers- List all workersGET /api/v1/workers/{id}/metrics- Get worker metricsGET /api/v1/payouts- List payoutsGET /api/v1/payouts/export/tax-report- Export tax reportGET /metrics- Prometheus metrics
# Backend
DATABASE_URL=postgresql://user:pass@localhost:5432/cocoon_pool
REDIS_URL=redis://localhost:6379/0
SECRET_KEY=your-secret-key
# TON Blockchain
TON_API_KEY=your-ton-api-key
# Telegram Bot
TELEGRAM_BOT_TOKEN=your-bot-token
# Monitoring
WORKER_SCRAPE_INTERVAL=15 # seconds
ALERT_CHECK_INTERVAL=60 # secondsWorkers should expose these endpoints:
http://localhost:12000/stats- Human-readable statshttp://localhost:12000/jsonstats- JSON metricshttp://localhost:12000/perf- Performance data
Multiple workers use incremental ports: 12000, 12010, 12020, etc.
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm testcd backend
alembic revision --autogenerate -m "Description"
alembic upgrade head- Setup Guide - Installation and configuration
- API Documentation - REST API reference
- Architecture - System architecture overview
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
- Telegram Community: t.me/xlab_tg
- Documentation: cocoon.org/gpu-owners
- Issues: GitHub Issues
MIT License - see LICENSE file for details.
- Built for the Cocoon Network
- Powered by TON Blockchain
- Monitoring with Prometheus & Grafana