# 256foundation/asic-rs architecture

> Architecture diagram of the GitHub repository 256foundation/asic-rs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/256foundation/asic-rs
- Repository: https://github.com/256foundation/asic-rs

## Overview

asic-rs is an asynchronous ASIC-miner discovery, telemetry, and control library with Rust, Python, and Go APIs. Its principal workflow is to scan or query an address, identify a miner implementation, then gather a telemetry snapshot or perform supported controls using shared data and configuration concepts. Firmware-specific adapters cover vendor protocols and version differences; language bindings expose the shared API. The workflow and binding relationships are documented in the README; unsampled adapter internals and runtime wiring are represented only at subsystem level.

Main entry points: [`src/factory.rs`](https://github.com/256foundation/asic-rs/blob/master/src/factory.rs) (Miner factory), [`asic-rs-core/src/traits/miner.rs`](https://github.com/256foundation/asic-rs/blob/master/asic-rs-core/src/traits/miner.rs) (Miner interface), [`c/asic-rs-ffi/src`](https://github.com/256foundation/asic-rs/tree/master/c/asic-rs-ffi/src) (C ABI), [`python/pyasic-rs/src`](https://github.com/256foundation/asic-rs/tree/master/python/pyasic-rs/src) (Python API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and API"]
  node_factory["Miner factory<br/>[factory.rs]"]
  node_listener["Miner listener<br/>[listener.rs]"]
end

subgraph group_shared["Shared Models"]
  node_discovery_core["Network discovery<br/>[discovery.rs]"]
  node_miner_traits["Miner interface<br/>[miner.rs]"]
  node_telemetry["Telemetry models"]
  node_configs["Control configs"]
end

subgraph group_firmware["Firmware Adapters"]
  node_antminer["Antminer adapters"]
  node_auradine["Auradine adapter"]
  node_braiins["Braiins adapters"]
  node_epic["Epic adapters"]
  node_elphapex["Elphapex adapter<br/>[firmware.rs]"]
  node_vnish["Vnish adapters"]
  node_whatsminer["Whatsminer adapters"]
  node_other_firmware["Other vendor adapters"]
end

subgraph group_bindings["Language Bindings"]
  node_python_api["Python API"]
  node_go_api["Go API"]
  node_ffi["C ABI"]
end

node_caller(("Library caller"))

node_caller -->|"requests miner"| node_factory
node_factory -->|"scans network"| node_discovery_core
node_factory -->|"constructs handle"| node_miner_traits
node_factory -->|"selects implementation"| node_antminer
node_factory -->|"selects implementation"| node_auradine
node_factory -->|"selects implementation"| node_braiins
node_factory -->|"selects implementation"| node_epic
node_factory -->|"selects implementation"| node_elphapex
node_factory -->|"selects implementation"| node_vnish
node_factory -->|"selects implementation"| node_whatsminer
node_factory -->|"selects implementation"| node_other_firmware
node_miner_traits -->|"returns snapshot"| node_telemetry
node_miner_traits -->|"accepts controls"| node_configs
node_caller -->|"streams results"| node_listener
node_python_api -->|"exposes API"| node_factory
node_go_api -->|"wraps ABI"| node_ffi
node_ffi -.->|"exposes Rust API"| node_factory

click node_factory "https://github.com/256foundation/asic-rs/blob/master/src/factory.rs"
click node_listener "https://github.com/256foundation/asic-rs/blob/master/src/listener.rs"
click node_discovery_core "https://github.com/256foundation/asic-rs/blob/master/asic-rs-core/src/discovery.rs"
click node_miner_traits "https://github.com/256foundation/asic-rs/blob/master/asic-rs-core/src/traits/miner.rs"
click node_telemetry "https://github.com/256foundation/asic-rs/tree/master/asic-rs-core/src/data"
click node_configs "https://github.com/256foundation/asic-rs/tree/master/asic-rs-core/src/config"
click node_antminer "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/antminer/src/backends/v2023_07"
click node_auradine "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/auradine/src/backends/v1"
click node_braiins "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/braiins/src/backends/v26_04"
click node_epic "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/epic/src/backends"
click node_elphapex "https://github.com/256foundation/asic-rs/blob/master/asic-rs-firmwares/elphapex/src/firmware.rs"
click node_vnish "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/vnish/src/backends/v1_3_0"
click node_whatsminer "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/whatsminer/src/backends/v2"
click node_other_firmware "https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares"
click node_python_api "https://github.com/256foundation/asic-rs/tree/master/python/pyasic-rs/src"
click node_go_api "https://github.com/256foundation/asic-rs/tree/master/go/asic_go"
click node_ffi "https://github.com/256foundation/asic-rs/tree/master/c/asic-rs-ffi/src"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_factory,node_listener toneBlue
class node_discovery_core,node_miner_traits,node_telemetry,node_configs toneAmber
class node_antminer,node_auradine,node_braiins,node_epic,node_elphapex,node_vnish,node_whatsminer,node_other_firmware toneMint
class node_python_api,node_go_api,node_ffi toneRose
class node_caller toneIndigo
```

## Components

### Discovery and API

- [Miner factory](https://github.com/256foundation/asic-rs/blob/master/src/factory.rs): `src/factory.rs`
- [Miner listener](https://github.com/256foundation/asic-rs/blob/master/src/listener.rs): `src/listener.rs`

### Shared Models

- [Network discovery](https://github.com/256foundation/asic-rs/blob/master/asic-rs-core/src/discovery.rs): `asic-rs-core/src/discovery.rs`
- [Miner interface](https://github.com/256foundation/asic-rs/blob/master/asic-rs-core/src/traits/miner.rs): `asic-rs-core/src/traits/miner.rs`
- [Telemetry models](https://github.com/256foundation/asic-rs/tree/master/asic-rs-core/src/data): `asic-rs-core/src/data`
- [Control configs](https://github.com/256foundation/asic-rs/tree/master/asic-rs-core/src/config): `asic-rs-core/src/config`

### Firmware Adapters

- [Antminer adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/antminer/src/backends/v2023_07): `asic-rs-firmwares/antminer/src/backends/v2023_07`
- [Auradine adapter](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/auradine/src/backends/v1): `asic-rs-firmwares/auradine/src/backends/v1`
- [Braiins adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/braiins/src/backends/v26_04): `asic-rs-firmwares/braiins/src/backends/v26_04`
- [Epic adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/epic/src/backends): `asic-rs-firmwares/epic/src/backends`
- [Elphapex adapter](https://github.com/256foundation/asic-rs/blob/master/asic-rs-firmwares/elphapex/src/firmware.rs): `asic-rs-firmwares/elphapex/src/firmware.rs`
- [Vnish adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/vnish/src/backends/v1_3_0): `asic-rs-firmwares/vnish/src/backends/v1_3_0`
- [Whatsminer adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares/whatsminer/src/backends/v2): `asic-rs-firmwares/whatsminer/src/backends/v2`
- [Other vendor adapters](https://github.com/256foundation/asic-rs/tree/master/asic-rs-firmwares): `asic-rs-firmwares`

### Language Bindings

- [Python API](https://github.com/256foundation/asic-rs/tree/master/python/pyasic-rs/src): `python/pyasic-rs/src`
- [Go API](https://github.com/256foundation/asic-rs/tree/master/go/asic_go): `go/asic_go`
- [C ABI](https://github.com/256foundation/asic-rs/tree/master/c/asic-rs-ffi/src): `c/asic-rs-ffi/src`

### Other components

- **Library caller**

## Connections

- Library caller → Miner factory: requests miner
- Miner factory → Network discovery: scans network
- Miner factory → Miner interface: constructs handle
- Miner factory → Antminer adapters: selects implementation
- Miner factory → Auradine adapter: selects implementation
- Miner factory → Braiins adapters: selects implementation
- Miner factory → Epic adapters: selects implementation
- Miner factory → Elphapex adapter: selects implementation
- Miner factory → Vnish adapters: selects implementation
- Miner factory → Whatsminer adapters: selects implementation
- Miner factory → Other vendor adapters: selects implementation
- Miner interface → Telemetry models: returns snapshot
- Miner interface → Control configs: accepts controls
- Library caller → Miner listener: streams results
- Python API → Miner factory: exposes API
- Go API → C ABI: wraps ABI
- C ABI → Miner factory: exposes Rust API
