Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5b07d22ae | ||
|
|
3d17326460 | ||
|
|
56339a5eca |
@@ -11,6 +11,7 @@ jobs:
|
|||||||
candidate:
|
candidate:
|
||||||
runs-on: alkane-ci
|
runs-on: alkane-ci
|
||||||
env:
|
env:
|
||||||
|
CARGO_TARGET_DIR: target
|
||||||
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
||||||
WX_RS_WXCONFIG: /root/.cache/wx-3.3.3-linux/bin/wx-config
|
WX_RS_WXCONFIG: /root/.cache/wx-3.3.3-linux/bin/wx-config
|
||||||
steps:
|
steps:
|
||||||
@@ -46,3 +47,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: python3 ci/release-rc.py "${{ steps.version.outputs.tag }}" true "dist/alkane-toolkit-${{ steps.version.outputs.version }}-linux-x86_64.tar.gz"
|
run: python3 ci/release-rc.py "${{ steps.version.outputs.tag }}" true "dist/alkane-toolkit-${{ steps.version.outputs.version }}-linux-x86_64.tar.gz"
|
||||||
|
- name: Clean generated Toolkit build
|
||||||
|
if: always()
|
||||||
|
run: python3 ci/cleanup-generated.py
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ jobs:
|
|||||||
python3 ci/gen-badges.py --tests "$PASS" \
|
python3 ci/gen-badges.py --tests "$PASS" \
|
||||||
--coverage "${{ steps.cov.outputs.pct }}" \
|
--coverage "${{ steps.cov.outputs.pct }}" \
|
||||||
--bench-coverage "${{ steps.benchcov.outputs.pct }}" \
|
--bench-coverage "${{ steps.benchcov.outputs.pct }}" \
|
||||||
--bench-delta "$BENCH_DELTA"
|
--bench-delta "$BENCH_DELTA" --clippy clean
|
||||||
|
|
||||||
- name: Publish measured badges
|
- name: Publish measured badges
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# alkane-toolkit
|
# Alkane Toolkit
|
||||||
|
|
||||||
[](https://gitea.bluefla.re/blueflare/alkane-toolkit/actions)
|
[](https://gitea.bluefla.re/blueflare/alkane-toolkit/actions)
|
||||||

|

|
||||||
@@ -10,118 +10,61 @@
|
|||||||

|

|
||||||

|

|
||||||
|
|
||||||
The CI badge shows the last completed attempt for this branch while newer
|
Desktop fleet discovery and monitoring for ASIC miners. The Rust GUI uses
|
||||||
runs are queued. Badge SVGs are stored in a private, machine-maintained branch.
|
wxWidgets through a patched [wx-rs bridge](thirdparty/wx-rs). Firmware
|
||||||
The code-quality letter requires warnings-denied Clippy and measured test plus
|
installation is under development.
|
||||||
UI self-test line coverage: A at 90%, B at 80%, C at 70%, D at 60%, and F
|
|
||||||
below 60%. A missing coverage measurement displays pending.
|
|
||||||
The benchmark delta compares an earlier commit only when its CPU class
|
|
||||||
matches the current dedicated runner; otherwise it establishes a new
|
|
||||||
baseline. Main CI runs microbenchmarks serially to avoid test contention.
|
|
||||||
|
|
||||||
A cross-platform desktop toolkit for discovering, monitoring, and re-flashing
|
## Run locally
|
||||||
ASIC miners. It scans a fleet over the network, shows live health and hashrate
|
|
||||||
in a sortable table. The install path is under development for **stock** and
|
|
||||||
**alkaneOS** firmware on boards running stock, VNish/AnthillOS, Braiins OS+,
|
|
||||||
LuxOS, ePIC, HiveOn, BixBit, WardenOS).
|
|
||||||
|
|
||||||
The core and UI are pure Rust; the native window is wxWidgets driven through a
|
|
||||||
vendored, patched [wx-rs](thirdparty/wx-rs) bridge, so there is no Electron,
|
|
||||||
no web view, and a single self-contained binary per platform.
|
|
||||||
|
|
||||||
## What it does
|
|
||||||
|
|
||||||
- **Discover** a fleet by CIDR or IP range and identify each miner's make,
|
|
||||||
model, control board, and firmware (via a vendored [asic-rs](vendor/asic-rs)).
|
|
||||||
- **Monitor** hashrate vs. expected, per-board health, chip temperatures, fans,
|
|
||||||
PSU state, and pool workers, with an Excel-style filter and drag-reorderable
|
|
||||||
columns.
|
|
||||||
- **Operate** miners from a right-click menu: flash the locate light, pause /
|
|
||||||
resume, restart, set a power or hashrate target, select a firmware profile
|
|
||||||
(LuxOS/VNish presets), configure pools, set the timezone, and change the
|
|
||||||
password -- each action offered only when every selected miner supports it.
|
|
||||||
- **Install firmware**: push stock or aftermarket images, or revert an
|
|
||||||
aftermarket miner to stock, behind a typed confirmation.
|
|
||||||
|
|
||||||
Discovery and telemetry are read-only and safe to run against any fleet; every
|
|
||||||
mutating action is capability-gated and, where destructive, confirmed.
|
|
||||||
|
|
||||||
## Build and run (Debian/Ubuntu)
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
scripts/build-wx-linux.sh # once: builds the vendored wxWidgets 3.3.3 into ~/.cache
|
scripts/build-wx-linux.sh
|
||||||
scripts/build-gui-linux.sh # cargo build --release -p alkane-gui
|
scripts/build-gui-linux.sh
|
||||||
~/.cache/alkane-tk-target/release/alkane-toolkit
|
ALKANE_FAKE_SCAN=1 ~/.cache/alkane-tk-target/release/alkane-toolkit
|
||||||
```
|
```
|
||||||
|
|
||||||
Runtime needs GTK 3: `sudo apt install libgtk-3-0`. To explore the UI with no
|
The first command builds wxWidgets 3.3.3 once. Linux runtime needs GTK 3
|
||||||
hardware, run the offline demo fleet:
|
(`libgtk-3-0` on Debian/Ubuntu). The fake scan uses offline fixtures and
|
||||||
|
does not contact hardware. Windows and macOS use their respective
|
||||||
|
`scripts/build-gui-*.sh` scripts and platform toolchains.
|
||||||
|
|
||||||
```sh
|
## Current scope
|
||||||
ALKANE_FAKE_SCAN=1 alkane-toolkit
|
|
||||||
```
|
|
||||||
|
|
||||||
Windows and macOS share all GUI code; only the C++ bridge and wx build differ
|
- Discover miners by CIDR or IP range with vendored
|
||||||
(`scripts/build-gui-windows.sh` needs an msys2 toolchain, `-macos.sh` needs a
|
[asic-rs](vendor/asic-rs), and show model, firmware, health, hashrate,
|
||||||
Mac).
|
temperatures, fans, PSU, and pool workers.
|
||||||
|
- Filter, sort, and reorder columns in the desktop table.
|
||||||
|
- Probe discovery, telemetry, presets, and write actions with the
|
||||||
|
`miner_probe` CLI. Run it without arguments for the verb list.
|
||||||
|
|
||||||
## Command-line probe
|
The installer and some operator actions remain roadmap items; see the
|
||||||
|
[implementation plan](docs/IMPLEMENTATION-PLAN.md) and
|
||||||
`miner_probe` is a headless companion for hardware checks that should not go
|
[firmware parity matrix](docs/aftermarket-parity-roadmap.md). A listed
|
||||||
through the window event loop -- discovery, telemetry, and each write action:
|
firmware or board is not an install claim. Discovery is read-only.
|
||||||
|
|
||||||
```sh
|
|
||||||
miner_probe scan 10.0.0.0/24 # discover + telemetry (TSV)
|
|
||||||
miner_probe presets 10.0.0.5 # list a firmware's selectable profiles
|
|
||||||
miner_probe setpreset 10.0.0.5 540MHz
|
|
||||||
```
|
|
||||||
|
|
||||||
Run `miner_probe` with no arguments for the full verb list.
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export WX_RS_WXCONFIG="$HOME/.cache/wx-3.3.3-linux/bin/wx-config"
|
export WX_RS_WXCONFIG="$HOME/.cache/wx-3.3.3-linux/bin/wx-config"
|
||||||
export CARGO_TARGET_DIR="$HOME/.cache/alkane-tk-target" # keep the target tree off the source share
|
export CARGO_TARGET_DIR="$HOME/.cache/alkane-tk-target"
|
||||||
|
cargo test -p alkane-gui --offline
|
||||||
cargo test -p alkane-gui # unit tests
|
cargo clippy -p alkane-gui --no-deps --bins -- -D warnings
|
||||||
cargo test -p alkane-gui --release -- --ignored bench_ # microbenchmarks
|
scripts/ui-selftest.sh
|
||||||
cargo clippy -p alkane-gui --no-deps --bins -- -D warnings # lint gate
|
ci/coverage.sh --summary-only
|
||||||
xvfb-run -a env ALKANE_SELFTEST=1 \
|
|
||||||
"$CARGO_TARGET_DIR/release/alkane-toolkit" # headless UI self-test
|
|
||||||
ci/coverage.sh --summary-only # coverage (tests + self-test)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
CI mirrors these: `verify.yml` runs lint, tests, benchmarks, the self-test, and
|
Keep build output off the source share. `main` runs the full CI gate and
|
||||||
a dependency audit on development branches. `release.yml` runs the full gate
|
publishes qualifying releases; `next` builds `-rc` candidates. Badges
|
||||||
on every `main` push and cuts an `X.Y.Z` release when the change warrants it.
|
report host tests and benchmarks, not installation support. Benchmark
|
||||||
`next.yml` builds release candidates with little testing and publishes `-rc`
|
comparisons require the same CPU class. The code quality letter reports the
|
||||||
releases. Dependencies are vendored under `vendor/`, so builds never touch the
|
Clippy gate; the separate coverage badge reports exercised lines.
|
||||||
network.
|
|
||||||
|
|
||||||
## Architecture
|
## Firmware safety
|
||||||
|
|
||||||
- `crates/alkane-gui` -- the application: scan engine, data model, wxWidgets UI,
|
The [SDK install rules](https://gitea.bluefla.re/blueflare/alkane-sdk/src/branch/main/docs/install-methods.md) require
|
||||||
and the `miner_probe` CLI (the other `crates/alkane-*` are early scaffolding).
|
serial and recovery checks for risky writes. Installation must never write
|
||||||
- `vendor/asic-rs` -- the miner-discovery and control library, vendored and
|
the bootloader or secure region, must verify over an independent channel,
|
||||||
extended through numbered patches under `thirdparty/asic-rs/patches`.
|
and must use the packer and boot-switch procedure for the exact board.
|
||||||
- `thirdparty/wx-rs` -- the patched wxWidgets bridge (see `docs/adr/0002`,
|
|
||||||
`0003`).
|
|
||||||
|
|
||||||
See [`docs/IMPLEMENTATION-PLAN.md`](docs/IMPLEMENTATION-PLAN.md) for the roadmap
|
|
||||||
and [`docs/aftermarket-parity-roadmap.md`](docs/aftermarket-parity-roadmap.md)
|
|
||||||
for the firmware config/scan parity work.
|
|
||||||
|
|
||||||
## Firmware safety rules
|
|
||||||
|
|
||||||
Encoded in code, from alkane-sdk `docs/install-methods.md`:
|
|
||||||
|
|
||||||
1. Never write the bootloader or secure region.
|
|
||||||
2. Verify on a channel the installer does not control.
|
|
||||||
3. Reboot is root-only; a dropped SSH connection can still be success.
|
|
||||||
4. A packer is per board; never reuse one across boards.
|
|
||||||
5. Boot-switch handling is an explicit, verified step.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Licensed under the [MIT license](LICENSE).
|
[MIT](LICENSE). Vendored dependencies keep their own terms.
|
||||||
|
|||||||
+5
-10
@@ -131,15 +131,10 @@ def cov_color(pct: float) -> str:
|
|||||||
return "red"
|
return "red"
|
||||||
|
|
||||||
|
|
||||||
def quality_grade(clippy: str, coverage: float | None) -> str:
|
def quality_grade(clippy: str | None) -> str:
|
||||||
if clippy != "clean":
|
if clippy is None:
|
||||||
return "F"
|
|
||||||
if coverage is None:
|
|
||||||
return "pending"
|
return "pending"
|
||||||
for minimum, grade in ((90, "A"), (80, "B"), (70, "C"), (60, "D")):
|
return "A" if clippy == "clean" else "F"
|
||||||
if coverage >= minimum:
|
|
||||||
return grade
|
|
||||||
return "F"
|
|
||||||
|
|
||||||
|
|
||||||
def human(n: int) -> str:
|
def human(n: int) -> str:
|
||||||
@@ -170,7 +165,7 @@ def main() -> int:
|
|||||||
# percentage string (e.g. "-3.2"), or "NEW"/"" when there is no baseline yet
|
# percentage string (e.g. "-3.2"), or "NEW"/"" when there is no baseline yet
|
||||||
# (round 19 #1). Takes precedence over --bench for the bench badge.
|
# (round 19 #1). Takes precedence over --bench for the bench badge.
|
||||||
ap.add_argument("--bench-delta", default=None)
|
ap.add_argument("--bench-delta", default=None)
|
||||||
ap.add_argument("--clippy", default="clean")
|
ap.add_argument("--clippy", choices=("clean", "failed"))
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
for value in (args.coverage, args.bench_coverage):
|
for value in (args.coverage, args.bench_coverage):
|
||||||
if value is not None and (not math.isfinite(value) or not 0 <= value <= 100):
|
if value is not None and (not math.isfinite(value) or not 0 <= value <= 100):
|
||||||
@@ -191,7 +186,7 @@ def main() -> int:
|
|||||||
write("loc", "lines of code", human(loc), loc_color(loc))
|
write("loc", "lines of code", human(loc), loc_color(loc))
|
||||||
write("license", "license", lic, "blue")
|
write("license", "license", lic, "blue")
|
||||||
write("dependencies", "dependencies", str(deps), "blue")
|
write("dependencies", "dependencies", str(deps), "blue")
|
||||||
grade = quality_grade(args.clippy, args.coverage)
|
grade = quality_grade(args.clippy)
|
||||||
write("quality", "code quality", grade,
|
write("quality", "code quality", grade,
|
||||||
{"A": "brightgreen", "B": "yellowgreen", "C": "yellow",
|
{"A": "brightgreen", "B": "yellowgreen", "C": "yellow",
|
||||||
"D": "orange", "F": "red", "pending": "lightgrey"}[grade])
|
"D": "orange", "F": "red", "pending": "lightgrey"}[grade])
|
||||||
|
|||||||
+6
-6
@@ -1,10 +1,10 @@
|
|||||||
# UI Spec — primary view
|
# Primary view
|
||||||
|
|
||||||
Source: operator description, 2026-09-15. Status: ACCEPTED (v1 scope).
|
Source: operator description, 2026-09-15. Status: ACCEPTED (v1 scope).
|
||||||
|
|
||||||
## Header (above the table)
|
## Header
|
||||||
|
|
||||||
- **KPI block, top left — 6 KPIs:**
|
- **KPI block, top left: 6 KPIs:**
|
||||||
1. Total miners
|
1. Total miners
|
||||||
2. Hashing
|
2. Hashing
|
||||||
3. Slow
|
3. Slow
|
||||||
@@ -31,7 +31,7 @@ Source: operator description, 2026-09-15. Status: ACCEPTED (v1 scope).
|
|||||||
4. Cooling (fan)
|
4. Cooling (fan)
|
||||||
5. Firmware
|
5. Firmware
|
||||||
6. Pool worker account name
|
6. Pool worker account name
|
||||||
7. …then the remaining statistics in registry order.
|
7. Remaining statistics in registry order.
|
||||||
|
|
||||||
## Data sources
|
## Data sources
|
||||||
|
|
||||||
@@ -45,10 +45,10 @@ Source: operator description, 2026-09-15. Status: ACCEPTED (v1 scope).
|
|||||||
ships with the board registry; missing band = excluded from Slow, counted
|
ships with the board registry; missing band = excluded from Slow, counted
|
||||||
in Hashing).
|
in Hashing).
|
||||||
|
|
||||||
## Implementation notes
|
## Implementation
|
||||||
|
|
||||||
- wxWidgets: the view is a `wxDataViewListCtrl`/`wxDataViewCtrl` (virtual
|
- wxWidgets: the view is a `wxDataViewListCtrl`/`wxDataViewCtrl` (virtual
|
||||||
list — thousands of rows without materializing cells), checkbox column +
|
list for thousands of rows without materializing cells), checkbox column +
|
||||||
IP column fixed via attribute/serializer, drag reorder via `wxReorderable`
|
IP column fixed via attribute/serializer, drag reorder via `wxReorderable`
|
||||||
column events, sort via column header click events mapped to the model.
|
column events, sort via column header click events mapped to the model.
|
||||||
- Filter panel: per-column distinct-value checklist with text search,
|
- Filter panel: per-column distinct-value checklist with text search,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# ADR 0001: Recipes as data, interpreted by one engine
|
# ADR 0001: Recipe engine
|
||||||
|
|
||||||
Status: ACCEPTED
|
Status: ACCEPTED
|
||||||
Date: 2026-09-14
|
Date: 2026-09-14
|
||||||
|
|||||||
@@ -1,41 +1,27 @@
|
|||||||
# ADR 0002: GUI bindings — wxWidgets shell in C++ + Rust core, spike to revisit
|
# ADR 0002: GUI bindings
|
||||||
|
|
||||||
Status: RESOLVED 2026-09-15 - the operator chose Option B (pure Rust via
|
|
||||||
wx-rs) with vendoring (ADR-0003). wx-rs 0.2.0 was extended via the patch
|
|
||||||
queue: Linux/GTK3 wx-config build path plus the widget bridge (panel,
|
|
||||||
sizers, static text, button, text ctrl, checkbox, checklistbox, dialog,
|
|
||||||
data view list ctrl, timer). The app ships this way; no C++ shell.
|
|
||||||
Date: 2026-09-14
|
Date: 2026-09-14
|
||||||
|
Resolved: 2026-09-15
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
||||||
The toolkit must present a native cross-platform GUI (wxWidgets chosen).
|
The toolkit needs a native wxWidgets GUI. At the time of evaluation,
|
||||||
Rust bindings to wxWidgets checked on crates.io 2026-09-14:
|
`wxRust` 0.0.1-alpha had seen no maintenance since 2022, and `wx-rs`
|
||||||
|
0.2.0 lacked widgets needed for the Toolkit.
|
||||||
- `wxRust` 0.0.1-alpha — unmaintained since 2022.
|
|
||||||
- `wx-rs` 0.2.0 (2023, self-contained) — ~6k downloads, no 1.0.
|
|
||||||
|
|
||||||
Betting the GUI on alpha bindings risks weeks of binding-gap debugging
|
|
||||||
(paste-heavy widgets, worker threads + event loops, GTK/WinCocoa quirks).
|
|
||||||
|
|
||||||
## Decision
|
## Decision
|
||||||
|
|
||||||
Default: **thin C++17 wxWidgets shell (`gui/`) + Rust core exposed over a
|
The operator chose a Rust GUI through a vendored, patched `wx-rs` 0.2.0.
|
||||||
small stable C ABI** (cdylib from `alkane-core`, header generated with
|
The patch queue adds the Linux/GTK3 build path and bindings for panels,
|
||||||
cbindgen). The shell holds frames, lists, the install wizard, and event
|
sizers, controls, dialogs, data views, timers, and event dispatch. The
|
||||||
glue only — no business logic, no safety logic. All invariants, engines,
|
application uses this bridge; it has no separate C++ shell.
|
||||||
and tests live in Rust where they are testable headlessly.
|
|
||||||
|
|
||||||
Gate: M0 runs a time-boxed `wx-rs` spike (window + list/tree + wizard flow
|
The original proposal was a small C++17 wxWidgets shell calling a Rust
|
||||||
+ worker-thread progress + cancel on Linux and Windows). If the spike is
|
core through a C ABI. The `wx-rs` spike met the GUI need, so that proposal
|
||||||
solid, flip to pure Rust; either way the decision is recorded before M3.
|
was not adopted.
|
||||||
|
|
||||||
## Consequences
|
## Consequences
|
||||||
|
|
||||||
- The repo builds two things: a Rust workspace and a small C++ app linked
|
- Keep business logic and safety checks in testable Rust code.
|
||||||
against the core cdylib. CMake in `gui/`.
|
- Carry wx-rs changes as numbered patches under `thirdparty/wx-rs/patches`.
|
||||||
- Core API surface stays small and event-oriented (discover, identify,
|
- Recheck the bridge on Linux, Windows, and macOS packaging changes.
|
||||||
plan, execute, cancel, progress events, log tail) — good FFI hygiene and
|
|
||||||
a natural match for the CLI too (D4).
|
|
||||||
- If wx-rs wins the spike, the C ABI is kept as an integration boundary for
|
|
||||||
scripted/HIL use anyway.
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# ADR 0003: Vendoring policy — pristine upstream archives + patch queue
|
# ADR 0003: Vendoring
|
||||||
|
|
||||||
Status: ACCEPTED
|
Status: ACCEPTED
|
||||||
Date: 2026-09-15
|
Date: 2026-09-15
|
||||||
@@ -42,7 +42,7 @@ thirdparty/
|
|||||||
|
|
||||||
Rules:
|
Rules:
|
||||||
|
|
||||||
1. Never edit a vendored pristine tree in place — every local change is a
|
1. Never edit a vendored pristine tree in place. Every local change is a
|
||||||
patch in `patches/`, applied by the build in numeric order. This makes
|
patch in `patches/`, applied by the build in numeric order. This makes
|
||||||
an upstream update: replace pristine archive, `git apply` surviving
|
an upstream update: replace pristine archive, `git apply` surviving
|
||||||
patches, rebase the rest.
|
patches, rebase the rest.
|
||||||
|
|||||||
Reference in New Issue
Block a user