Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minager

GitHub go.mod Go version Go Reference License GitHub downloads GitHub stars

Minager is a high-performance software suite for the remote monitoring, management, and automation of ASIC hardware via the Telegram Bot API.

Rather than acting as a simple frontend, the system operates as a middleware gateway. It translates undocumented hardware interfaces into a structured format, providing a reliable and secure channel for hardware control and critical automated alerts.

Table of Contents

System Capabilities

  • Bilingual Interface (I18n): The system fully supports English and Russian languages. Localization settings are resolved dynamically per user session.
  • Native UI Integration: Utilizes Telegram Inline Keyboards to construct multi-level configuration menus. Operators can switch mining pools, adjust power modes, and control fan algorithms directly within the native chat interface.
  • Asynchronous Alerting: Background workers actively monitor chip conditions, hash rates, and temperatures. The software can automatically transition faulty hardware into sleep mode and immediately notify the operator.
  • WebSocket Multiplexing: Includes a custom WebSocket implementation utilizing binary serialization (gob + json) to establish secure communication channels between local hardware agents and the central server.

Architecture & Performance

The software architecture is engineered for high-load environments, prioritizing a minimal memory footprint and high execution speed.

  • Memory Optimization: String formatting, log generation, and text payload rendering are handled via custom wrappers around strings.Builder with pre-allocated buffer capacities. This drastically minimizes memory allocation overhead and garbage collector pressure.
  • Concurrency: Hardware polling is strictly managed using Go concurrency primitives (sync.WaitGroup, sync.RWMutex, and channels). This eliminates race conditions during simultaneous asynchronous queries across multiple network devices.
  • Network Efficiency: Network operations are handled via the fasthttp library for high-throughput request and response processing.
  • Database Integration: A PostgreSQL connection pool is utilized to store and rapidly retrieve cached alert thresholds and user profiles.

Reverse Engineering & Hardware Integration

Integrating with specific ASIC hardware architectures (such as the Antminer series) required the following engineering efforts:

  1. Documentation Analysis: Translation and technical analysis of original manufacturer specifications.
  2. Firmware Reverse Engineering: Analysis of the hardware boot pipeline, internal network packet structures, and proprietary .bmu firmware files.
  3. API Schema Reconstruction: Extensive mapping of undocumented, historically unstable CGI interfaces. A strongly typed API client (pkg/antminer/cgi) was developed to convert raw, disparate device output into predictable JSON structures for programmatic evaluation.

Hardware Disclaimer: The author of this project and affiliated individuals have never owned, operated, or possessed physical ASIC mining equipment. Development, reverse engineering, and testing were conducted entirely using public data, firmware dumps, open-source network logs, and software simulators.

User Interface

The UI is structured to present dense analytical data clearly and compactly within the native Telegram environment.

Monitoring Dashboard Configuration Menu Alert System

Displays aggregate hash rate, PCB temperatures, voltage, and uptime. Sensitive data is securely blurred.

Interactive Inline Keyboard for switching mining pools, modifying chip frequency levels, and configuring fan PWM.

Menu for setting specific temperature limits and permissible hash rate deviation thresholds.

Automated Notifications

Background workers trigger immediate alerts for isolated hash rate drops, overheating events, or combined system faults.

View Detailed Diagnostics Dashboard (Click to expand)

Extended statistics output showing granular chip-level diagnostics, hardware errors, and performance metrics for individual hash boards.


Security & Privacy

Minager handles sensitive infrastructure data, including private IP addresses, network topologies, and mining pool credentials. Security controls include:

  • Data Protection: The Telegram bot strictly applies the ProtectContent flag to its messages. This disables message forwarding, text copying, and OS-level screenshots on the client side for chats containing hardware configurations.
  • Authentication: Access to the internal web server and WebSocket endpoints is restricted. Passwords are stored in the database exclusively as secure bcrypt hashes.
  • Encrypted Transport: TLS/SSL support is provided natively for secure Webhook tunneling and agent-to-server communication.

Getting Started

The backend infrastructure consists of the PostgreSQL database, the Telegram bot process, and the WebSocket subsystem.

Prerequisites

  • Go 1.25.0+
  • PostgreSQL 12+
  • OpenSSL (for local certificate generation)
  • An ngrok account (optional, for Webhook tunneling during local development)

Environment Setup

  1. Clone the repository:

    git clone https://github.com/ndenissov/minager.git
    cd minager
  2. Generate a self-signed SSL certificate (required for the internal server and/or Telegram Webhooks):

    openssl req -newkey rsa:2048 -nodes -keyout cert.key -x509 -days 365 -out cert.crt
  3. Create a .env configuration file in the project root directory:

    TOKEN=your_telegram_bot_token
    NGROK_AUTHTOKEN=your_ngrok_token
    DB_HOST=localhost
    DB_PORT=5432
    DB_USER=postgres
    DB_PASSWORD=secret
    DB_NAME=minager
    DB_SSLMODE=disable
  4. Configure the database by creating the target database and applying the necessary schema migrations for the user, cgi, and alert tables.

Launch

The project can run via long polling (not recommended for production environments), standard Webhooks, or via ngrok.

Example using ngrok (suitable for development environments lacking a static IP):

go build -o minager_bot ./cmd/minager_bot/...
./minager_bot -wh-ngrok -wh-address ":8080"

Legal Disclaimer & Compliance

This software is distributed "AS IS", without any warranties, express or implied. The developer assumes no liability for hardware damage, operational downtime, or financial losses resulting from the use of this software.

End users hold sole responsibility for ensuring their operation of this software complies with all applicable local and international laws. This includes, but is not limited to, legislation governing cryptocurrency mining, digital asset circulation, taxation, customs, and export control within their jurisdiction.

This repository represents the transition of a massive, commercially usable code base. into the public sphere. Given the legally complex, heavily regulated, and sensitive nature of the hardware operations it facilitates, strict adherence to the applied license is an absolute legal requirement.

Any unauthorized commercial exploitation, misappropriation of intellectual property, removal of copyright notices, or violation of the applied license terms will not be tolerated. The author actively monitors for unauthorized usage and will pursue all available legal remedies to the fullest extent of the law. This includes, but is not limited to, immediate cease-and-desist orders, seeking injunctive relief, and aggressive claims for financial damages against infringing individuals or corporate entities. If you are a simple developer or other user and use this project in good faith, I can assure you that you have absolutely nothing to fear.

Licensing & Collaboration

Software usage and distribution are governed by the specific license terms applied to the repository. The license terms are subject to change. The version published in the LICENSE file at the root of this repository at the time of your use dictates the applied legal terms.

For B2B integration, obtaining an exclusive commercial license, or confirming whether your intended use case complies with the current constraints, contact the author via:

  • Email: n.denissov@proton.me
  • Alternatively, and in any other cases, you can create an Issue corresponding to your request in this repository.

Contribution

Feel free to make suggestions, pull requests, bug fixes and bug reports. Any contribution to the project will be duly mentioned in the project documentation, in the appropriate section.

About

High-performance software suite for the remote monitoring, management, and automation of ASIC hardware via the Telegram Bot API.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages