Overview
TGMmine is a comprehensive remote management and optimization platform engineered for a fleet of Windows-based cryptocurrency mining clients. Developed between 2018 and 2019, the system was designed to solve the critical challenges of maintaining uptime, deploying updates, and maximizing profitability across distributed machines without manual intervention.
The core of the platform is a robust Node.js API that provides a central control plane for all client operations. It enables remote start/pause functionality, delivers push notifications, and serves as the brain for a sophisticated Over-the-Air (OTA) update system. By pairing the API with resilient, standalone Python services for crash handling and updates, TGMmine created a reliable ecosystem that ensured mining clients were always online and operating at peak efficiency.
Key Features
-
Remote Management API: A secure Node.js and MySQL backend allowed administrators to remotely monitor, start, and pause mining operations on any registered client machine, providing complete control from a central point.
-
Automated Over-the-Air (OTA) Updates: Clients periodically polled the API for new versions. Upon detecting an update, a dedicated Python utility would fetch the latest compiled application from an Apache server, ensuring the entire fleet could be updated seamlessly and without user interaction.
-
Resilient Crash Handling: A standalone Python watchdog service continuously monitored the main mining application's Process ID (PID). If the process crashed or became unresponsive, the service would automatically restart it, drastically minimizing downtime and lost revenue.
-
Hardware-Aware Profit Switching: The API included logic to analyze the hardware profile of each client and optimize which cryptocurrency was mined, automatically switching to the most profitable option based on real-time market data and hardware capabilities.
Technologies & Implementation
The system was architected as a distributed client-server model with a focus on decoupling and resilience. The backend API was built with Node.js, chosen for its excellent performance in handling a large number of concurrent, I/O-heavy polling requests from clients. MySQL served as the relational database, storing user credentials, client configurations, version history, and analytics data.
The client was a Windows Forms (.NET) application. Critical auxiliary functions were intentionally decoupled from both the client and the API for maximum stability. These functions were implemented as compiled Python services: one dedicated to the update process and another acting as a watchdog for crash recovery. This separation of concerns ensured that a failure in the main mining application would not affect the system's ability to recover or update itself.
graph TD
A["Admin/User"] --> B["Node.js Management API"]
B --> C["MySQL Database"]
D["Windows Mining Client (.NET)"] -- "Poll for status/updates" --> B
B -- "Send commands (start/stop)" --> D
D -- "PID" --> E["Appdata Directory"]
F["Python Crash Handler"] -- "Monitors PID" --> E
F -- "Restart command" --> D
B -- "Version URL" --> G["Python Update Tool"]
G -- "Downloads update" --> H["Apache Server"]
H -- "Serves latest build" --> G
G -- "Installs update" --> D
Challenges & Solutions
A primary challenge was ensuring the reliability and continuous operation of a distributed network of desktop applications that were, by nature, prone to crashing or requiring frequent updates. Any downtime directly translated to a loss of revenue, and manual intervention across many machines was not scalable.
To solve this, I engineered a two-pronged, automated recovery and update system:
-
Decoupled Watchdog Service: Instead of building process monitoring into the main application, I created a lightweight, independent Python service. This "crash handler" had a single responsibility: monitor the mining client's PID. Its independence meant that even if the main application suffered a catastrophic failure, the watchdog would remain active to restart it. This simple but highly effective solution maximized uptime.
-
Robust, Multi-Stage OTA Updates: The update process was designed to be resilient. The client's only job was to ask the API if an update existed. The heavy lifting—downloading from the Apache server and replacing the files—was offloaded to another dedicated Python tool. This prevented a failed or interrupted download from corrupting the main mining application and ensured the update mechanism was independent and reliable.
Results & Impact
The TGMmine platform successfully transformed a collection of standalone mining programs into a centrally managed, self-healing fleet. The system provided a robust framework for remote operations, significantly reducing the need for manual maintenance and troubleshooting.
-
Increased Uptime: The automated crash handler ensured near-continuous operation, directly increasing mining output and profitability.
-
Simplified Fleet Management: The OTA update system allowed for rapid and reliable deployment of new features and performance optimizations across all clients simultaneously.
-
Demonstrated Architectural Strength: This project showcases my ability to design and implement complex, distributed systems with a focus on resilience, security, and automation using a diverse technology stack (Node.js, Python, .NET).
{TODO: Add screenshot of main interface/dashboard}
