noahandClaude Opus 4.8 43a09c158a os: re-seat the UI and API on a command/state bus (wardenOS-style)
Introduce a single command point - the bus - that the HTTP API, the web console,
and any future remote/flare client all go through, mirroring wardenOS's
architecture (flare-edge `sprint`). wardenOS runs this as an MQTT broker over a
Unix socket; per its own porting note the right first step is to implement the
Bus facade (publish_state / read_state / request / emit) over an in-process
broker with the registry as the contract, swappable for a socket broker later
without touching callers. alkane-os is std-only and headless, so that is what
this does - no tokio, no MQTT.

- bus.rs: the in-process hub. Retained `state` topics (reads), `req`/`reply`
  verbs dispatched to one owning handler (the single write path), and a bounded
  `evt` ring. BusError carries warden-style E_* codes.
- registry.rs: the contract - every topic and verb as typed constants plus a
  machine-readable description. A test asserts the live bus matches it, the
  property busgen gives warden, so the contract cannot drift from the code.
- service.rs: the miner service owns the control/settings/dashboard verbs and
  publishes the hardware/summary/control state. Like a warden service it
  republishes the affected state the instant a command applies, so a reader
  never sees a command lag the periodic telemetry publish (the bus is held Weak
  to avoid an Arc cycle).
- web.rs is now a thin HTTP->bus translator (WebContext{bus, csrf}): writes are
  bus.request, miner-state reads are bus.read_state, the legacy hand-rendered
  page arms are gone (the console renders every nav tab). console.rs reads the
  state docs and the csrf is passed in. app::start/main.rs build the bus, register
  the service, and publish each control period.

Verified on --serve-sim: stop -> switch to ambient:18000 -> start now each
reflect immediately in /api/control, live frequency tracks the target, and a
stale CSRF is rejected. 193 lib tests pass (incl. bus/registry/service), full
suite green, clippy -D warnings clean, no emojis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
2026-11-10 21:03:08 -06:00

Alkane OS

CI tests coverage bench bench coverage lines of code dependencies code quality license

Rust mining and tuning core for Alkane control boards. The SDK builds board images and provides the hardware backend. The on-board web console is the parameterised flare-ui: a sidebar shell with live telemetry (readings) and real controls (mode/target, start/stop) that drive the runtime, with /api/... as the interface of record behind every page.

Status

The host miner supports BM1362 and BM1366 through the SDK's simulator HAL and Stratum V1. Tests have replayed 33 captured BM1366 shares and one BM1362 share to a loopback pool with matching ACCEPT responses. Production board control is still under development.

The BM1370 module encodes a captured S21 Pro job and parses captured nonce frames. Work-ID mapping, chain control, and pool acceptance remain open.

The HAL client requests PSU shutdown on sensor faults and reserves work IDs until a confirmed reset or shutdown. A production backend still needs a power lease, watchdog, and validated temperature limits. SHA-256d and Litecoin Scrypt proof verification are implemented; Scrypt chip report handling and mining remain open.

Run alkane-os --list-targets for the target matrix. Set POOL_PASSWORD to the pool password, then mine with a simulator HAL socket and Stratum V1 pool:

ALKANE_POOL_PASSWORD="$POOL_PASSWORD" alkane-os --mine-simulator HAL_SOCKET POOL_ADDRESS WORKER BM1366

Use BM1362 for that chip. Set ALKANE_API_LISTEN=127.0.0.1:4028 for read-only summary and version commands; reach it remotely through SSH.

To bring up the full web console on a workstation with no hashboard, run alkane-os --serve-sim: a reference HAL runs in-process, the runtime boots against it, and the printed URL serves the live, controllable console (the frequency moves toward the target; start/stop and mode changes take effect). alkane-os --serve serves the same console with no backend, for a board whose HAL backend is not written yet. ALKANE_WEB_LISTEN=ADDR overrides the bind (default port 80, or 8080 without privilege).

Release gate

main runs tests, benchmarks, and conformance before release; next builds release candidates. The release gate is red. It requires all 64 same-vendor pairings (52 Bitmain, 12 WhatsMiner), unmodified stock firmware, captured silicon nonces, difficulty-1 pool acceptance, and bench-validated models. Stock firmware may faithfully reject a pairing; Alkane OS must mine it. See the evidence contract.

Badges cover host code, not board conformance. See the public benchmark history.

Local checks

CARGO_TARGET_DIR=/var/tmp/alkane-os-target cargo test --locked

Use an executable target directory if the source mount is noexec.

License

MIT. Vendored dependencies keep their own licenses.

S
Description
Portable mining and tuning OS built through alkane-sdk
Readme MIT
9.9 MiB
Languages
Rust 73.6%
Python 24.6%
Shell 1.8%