Architecture
This document provides a comprehensive overview of MiningOS architecture, covering the system design, components, communication model, and data flow.
1. Overview
MiningOS follows a distributed, worker-based architecture where specialized components handle specific responsibilities and communicate via peer-to-peer RPC.
High-Level Architecture Diagram
For installation of these components, see the Installation Guide. For supported hardware, see Supported Devices.
Object Model Diagram
The diagram below represents the UML class hierarchy showing inheritance relationships. Each node represents a single repository in the ecosystem. For detailed repository conventions, see Repository Structure.
Diagram Legend:
Stadium-shaped nodes with italic labels are abstract classes that are automatically acquired as dependencies
Square nodes are concrete implementations that must be explicitly downloaded, installed, and configured
Square nodes highlighted in green are workers for miners or containers (at least one required for any mining setup)
Square nodes highlighted in brown are required dependencies that must be manually installed
Disconnected nodes are not part of the inheritance chain
For creating new workers in this hierarchy, see Adding New Worker Type.
2. Core Architecture
Key Architectural Principles
2.1 Hierarchical Abstraction
MiningOS uses a multi-level class hierarchy where abstract templates provide common functionality and concrete implementations handle vendor-specific details. For detailed documentation of this hierarchy, see Repository Structure.
For naming conventions, see Repository Structure — Naming Conventions.
2.2 Separation of Concerns
2.3 Distributed State
No central database—each worker maintains its own state
Data aggregated on-demand by the Orchestrator
Hyperbee provides persistent, replicated storage
3. System Components
MiningOS consists of four main component types:
3.1 Workers
Specialized processes that communicate with physical devices or external APIs. Each worker:
Manages a subset of devices (called a "rack")
Collects data at configurable intervals
Exposes RPC methods for control and monitoring (see RPC Method Implementation)
Persists data locally using Hyperbee
For worker implementation details, see Worker Implementation Files.
3.2 Orchestrator (Ork)
The coordination layer that:
Aggregates data from all workers
Manages action queues for device operations (see Requests & Approvals)
Maintains distributed state across the infrastructure
Provides a unified interface for the App Node
For Ork installation, see Installation — Ork.
3.3 App Node
The HTTP API gateway that:
Authenticates and authorizes users (OAuth2 + RBAC) — see User Management
Translates HTTP requests to RPC calls
Caches frequently accessed data
Exposes REST endpoints for the frontend
For App Node setup, see Installation — App Node.
3.4 App UI
The React-based web dashboard that:
Provides real-time monitoring visualizations — see Dashboard
Enables device configuration and control — see Explorer
Displays alerts and notifications — see Alerts Manual
Supports multiple user roles — see Settings
For UI installation, see Installation — React Web App UI.
Component Diagram
Notes:
Brown highlights indicate required dependencies
Nodes previously highlighted in green are contained in the "Device Specific Workers" stack
DHCP Worker is recommended only for very large operations
4. Communication Model
4.1 Hyperswarm P2P Network
MiningOS uses Hyperswarm for worker-to-worker communication, providing:
NAT Traversal: Workers can communicate across networks without port forwarding
Encryption: All communication is encrypted end-to-end
Decentralization: No central server required for coordination
Resilience: Network automatically heals when nodes join/leave
4.2 RPC Protocol
Workers communicate using a simple RPC protocol. For implementing RPC methods, see RPC Method Implementation Pattern.
For power mode options per miner model, see Power Mode Support Table.
4.3 Network Topology
4.4 Rack System (Scalability)
To ensure the highest level of scalability, core workers that interact with the mining infrastructure use the concept of rack. It would be impossible to have a single Node.js worker that connects to 10,000 miners, so the allocation (address space of miners) is split across multiple workers.
This is achieved through the thingMap, which specifies ranges of IPv4 addresses and their relative shard.
Each rack worker manages a collection of "things" (devices or services) and exposes them through a unified RPC interface. The orchestrator aggregates data across all racks, coordinates write operations through a voting system (see Requests & Approvals), and provides historical query capabilities.
5. Data Flow
5.1 Collection Flow
Data is displayed in the Dashboard and Explorer.
5.2 Action Flow
For the action authorization workflow, see Requests & Approvals.
5.3 Data Persistence
Each component stores data using Hyperbee:
6. Components Deep Dive
6.1 Workers
Workers are the fundamental building blocks of MiningOS. Each worker is responsible for communicating with a specific type of device.
Worker Types
For detailed device specifications, see Supported Devices.
Rack Configuration Example
This architecture enables:
Scalability: Add workers as your operation grows
Fault Isolation: Issues in one rack don't affect others
Parallel Processing: Each worker operates independently
6.2 Orchestrator (Ork)
The Ork (Orchestrator) is the central coordination layer of MiningOS.
Responsibilities
6.3 App Node
The App Node serves as the HTTP API gateway between the web frontend and the distributed worker network.
Features
Caching
Reduces load on workers
—
6.4 App UI
The App UI is a React-based web dashboard providing the primary user interface.
Features
7. Repository Structure
MiningOS is organized across multiple GitHub repositories, structured by abstraction level. For complete repository documentation, see Repository Structure.
Level 1: Foundation
bfx-wrk-base
Dependency
Core worker class from Bitfinex
miningos-lib-stats
Dependency
Statistics calculation library
miningos-app-ui
User Install
React web dashboard
miningos-cli
User Install
Command-line administration tool
Level 2: Infrastructure
tether-wrk-base
Dependency
Tether-specific worker extensions
miningos-wrk-dhcp
Optional
DHCP server integration (large operations)
Level 3: Core
miningos-wrk-ork
Required
Central orchestrator
miningos-app-node
Required
HTTP API backend
miningos-wrk-ext-mempool
Optional
Bitcoin mempool data
miningos-wrk-ext-openweather
Optional
Weather data (outdoor containers)
miningos-wrk-inventory
Optional
Inventory management
miningos-tpl-wrk-thing
Dependency
Base template for device workers
Level 4: Templates
Level 5: Device Implementations
Miners
miningos-wrk-miner-antminer, miningos-wrk-miner-whatsminer, miningos-wrk-miner-avalon
Containers
miningos-wrk-container-antspace, miningos-wrk-container-bitdeer, miningos-wrk-container-microbt
Power Meters
miningos-wrk-powermeter-abb, miningos-wrk-powermeter-schneider, miningos-wrk-powermeter-satec
For creating new Level 5 implementations, see Adding New Worker — Level 5.
8. Class Hierarchy
8.1 Physical Device Workers
8.2 External API Workers
8.3 Infrastructure Workers
MiningOS is developed by Tether and released under the Apache 2.0 license.
Last updated