|
||
---|---|---|
App.py | ||
boot.html | ||
dockerfile | ||
error.html | ||
index.html | ||
LICENSE.md | ||
main.js | ||
minify.py | ||
README.md | ||
requirements.txt | ||
workers.html | ||
workers.js |
Ocean.xyz Bitcoin Mining Dashboard
A real-time dashboard application for monitoring Bitcoin mining operations using the Ocean.xyz Mining Pool.
Overview
This application provides miners with a comprehensive view of their mining operations, including:
- Real-time hashrate monitoring
- BTC price tracking
- Profitability metrics
- Payout status
- Network statistics
- Worker fleet management
- Historical data visualization
Built with Flask and modern web technologies, the dashboard features a responsive design that works on both desktop and mobile devices, real-time data updates via Server-Sent Events (SSE), and persistent storage with Redis.
Features
- Real-Time Monitoring: Live updates of mining metrics with minimal delay
- Hashrate Visualization: Interactive charts showing hashrate trends
- Profitability Calculations: Daily and monthly profit estimates in USD and BTC
- Network Stats: Current Bitcoin difficulty, network hashrate, and block count
- Payout Tracking: Monitor unpaid earnings and estimated time to next payout
- Workers Dashboard: View and manage your mining fleet with status, hashrate, and earnings for each device
- Worker Filtering: Filter and search your miners by status (online/offline) or type (ASIC/FPGA)
- High Performance: Optimized for low-resource environments with data compression
- Responsive Design: Works on desktop, tablet, and mobile devices
- Retro Boot Screen: Bitcoin-themed boot sequence with system initialization display
File Structure
ocean-mining-dashboard/
├── App.py # Main Flask application with backend logic
├── Dockerfile # Docker container configuration
├── minify.py # HTML minification utility
├── requirements.txt # Python dependencies
├── static/
│ └── js/
│ ├── main.js # Frontend JavaScript for main dashboard functionality
│ └── workers.js # Frontend JavaScript for workers dashboard
├── templates/
│ ├── boot.html # Bitcoin-themed boot sequence page
│ ├── error.html # Error page template
│ ├── index.html # Main dashboard template
│ └── workers.html # Workers dashboard template
└── config.json # Configuration file (created on first run)
Installation
Prerequisites
- Python 3.9 or higher
- Docker (optional, for containerized deployment)
- Redis (optional, for data persistence)
Option 1: Local Installation
-
Clone the repository:
git clone https://github.com/yourusername/ocean-mining-dashboard.git cd ocean-mining-dashboard
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python App.py
-
Access the dashboard at http://localhost:5000
Option 2: Docker Installation
-
Clone the repository:
git clone https://github.com/yourusername/ocean-mining-dashboard.git cd ocean-mining-dashboard
-
Build the Docker image:
docker build -t mining-dashboard .
-
Run the container:
docker run -d -p 5000:5000 --name mining-dashboard mining-dashboard
-
Optional: Run with Redis for data persistence:
# First start a Redis container docker run -d --name redis redis # Then start the dashboard with Redis connection docker run -d -p 5000:5000 --link redis --env REDIS_URL=redis://redis:6379 mining-dashboard
-
Access the dashboard at http://localhost:5000
Workers Dashboard
The Workers Dashboard provides detailed information about each mining device in your fleet:
- Fleet Summary: Quick view of total hashrate, worker count, and online/offline status
- Worker Cards: Individual cards for each mining device showing:
- Current status (online/offline)
- Device type (ASIC/FPGA)
- Current hashrate with visual bar indicator
- Last share time
- Earnings
- Acceptance rate
- Temperature (for online devices)
- Filtering Options: Filter workers by status or device type
- Search Functionality: Quickly find specific workers by name
- Real-time Updates: Synchronized with the main dashboard for consistent data
Access the Workers Dashboard through the navigation links at the top of the main dashboard or directly at /workers
.
Configuration
On first run, the application will create a config.json
file with default settings. Edit this file to customize:
{
"power_cost": 0.12, // Cost per kWh in USD
"power_usage": 3450, // Power consumption in watts
"wallet": "your-btc-wallet-address-here"
}
System Requirements
The dashboard is designed to be lightweight:
- Minimal CPU usage (single worker with threading)
- ~100-200MB RAM usage
- <50MB disk space
Troubleshooting
If you encounter connection issues with the dashboard:
- Check the "Health" endpoint at
/api/health
for system status - Use the "Force Refresh" button if data becomes stale
- Inspect browser console logs for error messages
- Check server logs with
docker logs mining-dashboard
if using Docker
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Ocean.xyz mining pool website
- Flask web framework for the backend
- Chart.js for interactive data visualization
- Bootstrap for responsive UI components
- Redis for data persistence and caching
- BeautifulSoup4 for HTML parsing
- Gunicorn for WSGI HTTP server
- APScheduler for background task scheduling
- jQuery for DOM manipulation and AJAX requests
- Font Awesome for icons
- chartjs-plugin-annotation for chart annotations
- Orbitron Font for dashboard typography
- Server-Sent Events (SSE) for real-time updates
- Docker for containerization and deployment
- The Bitcoin open source community for inspiration and resources
- Satoshi Nakamoto for creating Bitcoin
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.