Add ePIC firmware support for Antminers #101
ankitgoswami
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This plan adds
VARIANT_EPICas a first-class firmware variant alongside vnish/braiins/luxos/marathon, and unifies native ePIC hardware under the same variant (since ePIC's stock firmware is ePIC firmware).Changes
1.
plugin/asicrs/src/capabilities.rs— variant registrationfirmware_to_variant: add anepicarm that returnsVARIANT_EPICwhen the firmware string contains"epic"(case-insensitive). Place it before the marafw/marathon branch.detect_variant: add a corresponding make-fallback branch for"epic"so a make of"ePIC"resolves toVARIANT_EPICeven when the firmware string is empty.firmware_manufacturer: addVARIANT_EPIC => Some(DISPLAY_EPIC).default_credentials: add(FAMILY_ANTMINER, VARIANT_EPIC) => admin/letmeinarm before the catch-all(FAMILY_ANTMINER, _) => root/root. The existing(FAMILY_EPIC, _) => admin/letmeinarm already covers native ePIC hardware regardless of variant.#[cfg(test)] mod testsblock):firmware_to_variant("ePIC") == VARIANT_EPICfirmware_to_variant("epic 1.2.3") == VARIANT_EPICdetect_variant("AntMiner", "ePIC") == VARIANT_EPICdetect_variant("ePIC", "") == VARIANT_EPIC(make fallback)firmware_manufacturer(VARIANT_EPIC) == Some("ePIC")default_credentials(FAMILY_ANTMINER, VARIANT_EPIC)returns admin/letmein~/CLAUDE.md)Do NOT add
VARIANT_EPICto the antminer group insidemake_to_family. That table is keyed by the make string, and asic-rs returnsmake="AntMiner"for ePIC-on-Antminer; the existing"epic" → FAMILY_EPICmapping must stay so native ePIC hardware still resolves toFAMILY_EPIC.2.
plugin/asicrs/config.yaml— enable the variantsminers.antminer, add:miners.epic.stockblock (L35-37) with:family=epic, variant=epic— internally consistent with the firmware string asic-rs returns.)3.
plugin/antminer/internal/driver/driver.go— defensive skipePIC firmware speaks HTTP (not CGMiner) on port 4028, so the Go plugin's
GetVersion()call should fail to even parse a response. But for symmetry with the existing vnish/braiins/luxos/marafw markers, and to handle any future ePIC firmware that might expose CGMiner-compatible version output:firmwareMarkerEpictononStockFirmwareMarkers(L47-52).No change needed to the
LUXminer-style explicit field check (L249-252) — the substring marker is sufficient.4. Contract test fixture —
tests/plugin-contract/testdata/antminer-epic/Create a fixture mirroring antminer-vnish/ but adapted for ePIC's HTTP-only API on port 4028:
manifest.json:{ "model": "S19jPro", "manufacturer": "ePIC", "firmware": "epic", "firmware_version": "<recorded>", "plugin": "asicrs", "recorded_from": "<ip>", "recorded_at": "<timestamp>", "ports": { "rpc": 4028, "web": 80 } }EPicFirmwareprobes (asic-rs-firmwares/epic/src/firmware.rs:81,136):GET http://<ip>:4028/capabilities→ returns{"Model": "Antminer S19j Pro", "Model Subtype": "..."}GET http://<ip>:4028/summary→ returns{"Software": "ePIC v...", ...}PowerPlaybackend calls for telemetry/poolsAll reactions