This document provides a comprehensive overview of the MiningOS repositories. It explains the organizational patterns, inheritance hierarchy, and standard conventions used across all worker repositories.
For the system architecture and component relationships, see Architecture . For contribution workflow, see Contribution Workflow .
MiningOS follows a modular, inheritance-based architecture. Functionality is distributed across multiple Git repositories. Each repository serves a specific purpose in the hierarchy, from foundational worker utilities to concrete device implementations.
Design Philosophy
The repository structure embodies several key principles:
Principle
Description
Related Documentation
Inheritance over composition
Base classes provide core functionality that specialized workers extend
Convention over configuration
Standard directory layouts and naming patterns reduce cognitive overhead
Each repository focuses on a single abstraction level or device category
Common patterns are extracted into template repositories for maximum code sharing
Repository Hierarchy
Regarding the workers for physical devices, the MiningOS ecosystem consists of repositories organized into five distinct levels. For the complete architecture diagram, see Architecture — Object Model .
Copy Level 1: Foundation
└── bfx-wrk-base # Core worker primitives
Level 2: Platform Base
└── tether-wrk-base # Tether/MiningOS worker foundation
Level 3: Thing Management
└── miningos-tpl-wrk-thing # Abstract "thing" device management
Level 4: Device Category Templates
├── miningos-tpl-wrk-miner # Mining hardware template
├── miningos-tpl-wrk-container # Container infrastructure template
├── miningos-tpl-wrk-sensor # Environmental sensor template
├── miningos-tpl-wrk-powermeter # Power monitoring template
└── miningos-tpl-wrk-electricity # Electricity usage
Level 5: Concrete Implementations
├── miningos-wrk-miner-whatsminer # WhatsMiner devices (like m53s)
├── miningos-wrk-miner-antminer # Antminer devices (like s19xp)
├── miningos-wrk-miner-avalon # Avalon devices (like a1346)
├── miningos-wrk-container-antspace # Antspace miner containers (like hk3)
├── miningos-wrk-container-microbt # MicroBT miner containers (like kehua)
├── miningos-wrk-sensor-temp-seneca # Seneca temperature sensors
├── miningos-wrk-powermeter-satec # Satec power meters (like PM180)
└── miningos-wrk-powermeter-schneider # Schneider power meters (like PM5340) For creating new workers at each level, see Adding New Worker Type . For supported device specifications, see Supported Devices .
Standard Directory Structure
All MiningOS worker repositories follow a consistent directory layout. Below is the canonical structure:
For testing guidelines, see Testing & Linting Guidelines . For documentation standards, see Code Documentation Standards .
Directory Purpose Reference
Directory/File
Purpose
Related Documentation
All configuration files with .example templates
Facility-specific configuration (network, storage)
Test doubles for device simulation
Brittle test framework test suite
Core worker implementation
Shared utilities and base classes
CLI entry point for worker startup
Copies .example files to active configs
Merges changes from parent template
Naming Conventions
Repository names
Pattern
Example
Description
Documentation
Bitfinex foundation worker
miningos-wrk-<type>-<brand>
miningos-wrk-miner-whatsminer
miningos-wrk-ext-<service>
External service integration
Component
Convention
Example
Documentation
Model-specific worker class
Key files explained
File
Purpose
Related Documentation
The entry point for all workers. This file is minimal and delegates to the bfx-svc-boot-js framework
Standard Node.js package manifest with MiningOS-specific conventions
Utility script that creates active configuration files from '.example' files
Merges changes from parent template
Configures thing management behavior
config/facs/net.config.json
Configures RPC server and network access. Structure varies by repository
config/facs/store.config.json
Configures Hyperbee persistent storage. This facility typically requires no additional configuration
Worker implementation files
File
Purpose
Related Documentation
workers/[model].rack.[device].wrk.js
The main worker class implementing device-specific logic
Base class for device interactions
Alert definitions for the device type
Worker constants and configuration values
Statistics collection and aggregation logic
Utility functions shared across the worker
Contributor Guide
General Documentation
Operator Manual