Happy Mining firmware on the miner
Every miner running the Happy Mining firmware (v1.0.2 and later) serves its own dashboard and HTTP API on port 80: open http://<miner-ip>/ from a computer or a phone on the miner's network. Mole Hash uses the same API through the Mole agent — firmware updates from the Firmware panel go through it.
Signing in
The miner asks for its web password. The factory password is admin; until it is changed every page shows a yellow banner and Security opens first. Change it in Security → Web password (8 characters or more). The same password is used by scripts and by Mole Hash (HTTP Digest, user root), so set it in the miner's credentials in Mole Hash too (Machines → Edit miner → Web password), or the agent cannot drive the miner any more.
Pages
| Page | What you do there |
|---|---|
| Overview | Hashrate (average and 5 s) with a 10-minute chart, hottest chip and PCB temperature, every fan, shares and reject rate, HW errors, uptime; one line per hashboard with chips found, hashrate, chip/PCB °C, frequency and HW errors; the live pools. Refreshes every 5 s. |
| Pools | The three saved pools (1 is used first, 2 and 3 take over); Save and restart mining writes them to cgminer.conf and restarts cgminer. The live table shows each pool's state and Mine on it now to switch until the next restart. |
| Mining | Start, Restart or Stop mining (Stop asks for confirmation; the fans and control board stay on). An Expert section sends a parameter to cgminer ascset. |
| Network & settings | Hostname, DHCP or static IP (IP, netmask, gateway in the same subnet, DNS — all checked, and you type STATIC to confirm), timezone, SSH on/off. Expert: cgminer.conf edits the raw file; it is refused if it is not valid JSON or has no pool. Only the fields you change are written, every other line of the files is kept. Download backup saves the configuration. |
| Firmware | What is installed, Upload and install a signed package (progress bar, then the installer log; the miner reboots by itself), Remove Happy Mining to boot the stock Bitmain firmware again (type REMOVE). |
| Logs | Every log file, followed live, with download and clear. |
| Notes | Free key/value labels kept on the miner (rack, owner, repair history…). |
| System | Locate: blink the red/green LEDs for 2 min to 2 h (stops by itself), identity of the miner (serial, model, IP, MAC, firmware, cgminer), Rescan hashboards, Reboot, Factory reset (type RESET). |
| Security | Web password, Lock (refuses every change, also through the API, until unlocked), API keys for scripts (shown once, at creation), SSH public keys for root. |
| API | This API, searchable, with copy-ready curl examples — served by the miner itself at /api/docs. |
On a phone the menu folds behind the ☰ button.
HTTP API
Base URL http://<miner-ip>. Answers are JSON; errors are {"error":"…"} with an HTTP status (400 invalid input, 401 not signed in, 409 already running, 423 locked, 502 cgminer not answering).
Authentication — one of:
- HTTP Digest, user
root, the web password, realmhappymining(scripts, Mole agent):curl --digest -u root:PASSWORD http://<ip>/api/overview - an API key in the
X-Api-Keyheader (create it in Security → API keys) - the browser session cookie set by
POST /api/login.
/api/version, /api/health, /api/auth-check, /api/login and /api/docs answer without credentials. While the dashboard is locked, every change answers 423; reads still work.
# hashboards, fans, temperatures in one call
curl --digest -u root:PASSWORD http://10.11.101.30/api/overview
# replace the saved pools (mining restarts)
curl --digest -u root:PASSWORD -X PUT -H 'Content-Type: application/json' \
-d '{"pools":[{"url":"stratum+tcp://pool.example.com:3333","user":"account.worker","pass":"x"}]}' \
http://10.11.101.30/api/pools/config
# install a firmware package (the miner reboots when done)
curl --digest -u root:PASSWORD -F file=@happymining-s19kpro-aml-nand-v1.0.2.tar.gz http://10.11.101.30/api/firmware/update
curl --digest -u root:PASSWORD http://10.11.101.30/api/firmware/statusStatus
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/version | public | Firmware and cgminer version (also used to detect Happy Mining). | |
| GET | /api/health | public | Liveness of the dashboard and of cgminer. | |
| GET | /api/overview | signed in | Everything the Overview page shows in one call: hashrate (TH/s), shares, boards (chips, chip/PCB temp, frequency), fans, pools, locate LED. | |
| GET | /api/summary | signed in | cgminer summary (raw). | |
| GET | /api/status | signed in | Alias of /api/summary. | |
| GET | /api/perf-summary | signed in | Alias of /api/summary. | |
| GET | /api/pools | signed in | cgminer pools (raw, live state). | |
| GET | /api/devs | signed in | cgminer devs (raw, one per board). | |
| GET | /api/boards | signed in | Alias of /api/devs. | |
| GET | /api/stats | signed in | cgminer stats (raw: fans, chips, chip temperatures, frequencies). | |
| GET | /api/metrics | signed in | Alias of /api/stats. | |
| GET | /api/coin | signed in | cgminer coin (raw). | |
| GET | /api/config | signed in | cgminer config (raw). | |
| GET | /api/info | signed in | Identity of the miner: serial, firmware, network, uptime, cgminer version. | |
| GET | /api/serial | signed in | Serial number. | |
| GET | /api/model | signed in | Miner model as cgminer reports it. |
Pools
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/pools/config | signed in | The pools saved in cgminer.conf (what the miner uses after a restart). | |
| PUT | /api/pools/config | signed in · not when locked | Replace the 1–3 pools in cgminer.conf (other settings kept) and restart cgminer. | {"pools":[{"url":"stratum+tcp://host:3333","user":"wallet.worker","pass":"x"}]} |
| POST | /api/mining/switch-pool | signed in · not when locked | Mine on this pool now (live, until restart). | {"pool":0} |
| POST | /api/pools/enable | signed in · not when locked | Enable a pool (live). | {"pool":0} |
| POST | /api/pools/disable | signed in · not when locked | Disable a pool (live). | {"pool":0} |
| POST | /api/pools/remove | signed in · not when locked | Remove a pool (live; use PUT /api/pools/config to change the saved pools). | {"pool":0} |
| POST | /api/pools/add | signed in · not when locked | Add a pool (live; use PUT /api/pools/config to save it). | {"url":"stratum+tcp://host:3333","user":"wallet.worker","pass":"x"} |
Mining
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/mining/state | signed in | Is cgminer running. | |
| POST | /api/mining/start | signed in · not when locked | Start mining (cgminer). | |
| POST | /api/mining/stop | signed in · not when locked | Stop mining: hashboards off, fans and control board stay on. | |
| POST | /api/mining/restart | signed in · not when locked | Restart cgminer (applies cgminer.conf). | |
| POST | /api/mining/throttle | signed in · not when locked | Expert: forward a parameter to cgminer ascset (frequency/voltage; format depends on the model). | {"parameter":"0,freq,600"} |
Settings
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/settings | signed in | Network (hostname, DHCP or static IP), timezone, SSH and the raw cgminer.conf. | |
| POST | /api/settings | signed in · not when locked | Save settings. Only the sections sent are changed; the other keys of each file are kept. A static IP needs ip/netmask/gateway/DNS in the same subnet. cgminer.conf must be valid JSON with at least one pool. | {"network":{"hostname":"rack1-03","dhcp":false,"ipaddress":"10.11.101.30","netmask":"255.255.255.0","gateway":"10.11.101.1","dnsservers":"1.1.1.1,8.8.8.8"},"system":{"timezone":"Europe/Paris"},"ssh":{"enable":true}} |
| GET | /api/settings/backup | signed in | Download the configuration files (JSON). | |
| POST | /api/settings/restore | signed in · not when locked | Restore a backup made with /api/settings/backup (validated like a save). | {"cgminer.conf":"…","network.conf":"…"} |
| POST | /api/settings/factory-reset | signed in · not when locked | Erase the configuration and reboot. | {"confirm":"RESET"} |
Firmware
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| POST | /api/firmware/update | signed in · not when locked | Install a signed Happy Mining package. multipart/form-data with the .tar.gz in field "file" (or JSON {"path":"/tmp/x.tar.gz"} for a file already on the miner). Runs in the background; the miner reboots when done. | multipart: file=@happymining-…-v1.0.2.tar.gz |
| GET | /api/firmware/status | signed in | Progress of the last firmware update / removal. | |
| POST | /api/firmware/remove | signed in · not when locked | Remove Happy Mining and boot the stock Bitmain firmware again (reboots). | {"confirm":"REMOVE"} |
Logs and notes
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/logs | signed in | List of log files. | |
| GET | /api/logs/{name...} | signed in | Last 256 KB of a log (name as listed; ?download=1 to save it). | |
| POST | /api/logs/{name...} | signed in · not when locked | Clear a log: POST /api/logs/<name>/clear. | |
| GET | /api/notes | signed in | Notes kept on the miner (rack, owner, repairs…). | |
| POST | /api/notes | signed in · not when locked | Add a note. | {"key":"rack","value":"B1-R8 (0,3)"} |
| PUT | /api/notes/{id} | signed in · not when locked | Edit a note. | {"key":"rack","value":"B1-R9"} |
| DELETE | /api/notes/{id} | signed in · not when locked | Delete a note. |
System
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| POST | /api/system/reboot | signed in · not when locked | Reboot the miner. | |
| POST | /api/locate-miner | signed in · not when locked | Blink the red/green LEDs for N seconds (default 600, max 7200). | {"seconds":600} |
| POST | /api/locate-off | signed in · not when locked | Stop blinking the LEDs. | |
| GET | /api/locate | signed in | Is the locate LED blinking, until when. | |
| POST | /api/rescan-hardware | signed in · not when locked | Rescan the hashboards (restarts hwscan then cgminer). |
Access
| Method | Path | Access | What it does | Body |
|---|---|---|---|---|
| GET | /api/auth-check | public | Is this browser logged in, is the dashboard locked, is the factory password still set. | |
| POST | /api/login | public | Log the browser in (sets an HttpOnly session cookie, 12 h). | {"password":"…"} |
| POST | /api/logout | public | Log the browser out. | |
| POST | /api/password | signed in | Change the web password (also the HTTP Digest password for user root). At least 8 characters. | {"current":"…","new":"…"} |
| POST | /api/lock | signed in | Lock: every write is refused until unlocked. | |
| POST | /api/unlock | signed in | Unlock writes. | |
| GET | /api/apikeys | signed in | API keys (the token itself is only shown once, at creation). | |
| POST | /api/apikeys | signed in · not when locked | Create an API key for scripts (send it as X-Api-Key). | {"name":"molehash"} |
| POST | /api/apikeys/delete | signed in · not when locked | Delete an API key. | {"id":"…"} |
| GET | /api/ssh/keys | signed in | Public keys allowed to SSH in as root. | |
| POST | /api/ssh/keys | signed in · not when locked | Add a public key. | {"key":"ssh-ed25519 AAAA… me@laptop"} |
| DELETE | /api/ssh/keys | signed in · not when locked | Remove a public key by index. | {"index":0} |
| GET | /api/docs | public | This list of endpoints. |
Good to know
- Network and SSH changes apply at the next reboot; the page offers to reboot right away.
- A static address that is wrong makes the miner unreachable: it then needs a factory reset on site (reset button), which brings it back on DHCP.
cgminer.confand the pools are the only settings that apply at once (cgminer restarts, about 30 s without hashing).- The firmware update checks the package signature on the miner before anything is written; a package for another control board is refused.