HTTP API – Docs & Tester
Endpoints esposti dal backend (/api/*) con esempi ed esecuzione live.
Note generali
- Tutte le API rispondono in JSON (eccetto
/api/live_statsche usa Server-Sent Events). - Gli endpoint che accettano parametri usano querystring (es.
?limit=50,?wid=worker1). - I valori numerici sono in secondi, H/s, o conteggi (valid/invalid). Hashrate formattato anche in “display”.
/api/sharesCurrentRound
Stato “live” del round corrente: per-worker e totali di pool.
Output include: round, workers{}, pool_hashrate_hs, _pool_span_s, ecc.
—
Verifica hashrate: metodo vecchio vs nuovo
Confronta:
- sum_hs_new = Σ per-worker
hashrate_hs(se presente) altrimentidiff_valid_window · 2^32 / _pool_span_s - api_pool = pool_hashrate_hs restituito da
/api/sharesCurrentRound
Usa gli stessi parametri del backend (span reale); niente più finestre discordanti.
—
Pool Health — Live per-worker (NEW vs OLD + efficienza)
Legge
/api/sharesCurrentRound e calcola GH/s ed efficienza per ciascun worker.Worker Snapshot (ultimi N round)
Legge
/api/workerRounds e aggrega GH/s ed efficienza.
|
GH/s = Σ(diff_valid_round)·2^32 / Σ(duration). Eff = Σvalid / (Σvalid+Σinvalid).
—
/api/roundMarkers
Marcatori round: current e last_closed.
—
/api/poolSummary
Media tempo-pesata su ultimi N round (default 200). Filtra round corti/zero.
Esempio:
/api/poolSummary?limit=100—
/api/workersKnown
Elenco workers visti negli ultimi N round.
Esempio:
/api/workersKnown?limit=200—
/api/workerRounds
Storico per worker (per-round): hashrate, efficiency, diff_valid, durata.
|
Esempio:
/api/workerRounds?wid=bitaxe1&limit=50—
/api/workerExplain
Spiegazione calcolo live per un worker nel round corrente (inputs + metodo usato).
Esempio:
/api/workerExplain?wid=bitaxe1—
/api/roundHistory
Snapshot ultimi N round (height, ts, pool_hashes, duration).
Esempio:
/api/roundHistory?limit=200—
/api/roundSummary
Riepilogo per un round: per-worker valid/invalid, dv/ds, efficiency, hashrate per durata round.
Esempio:
/api/roundSummary?height=917388—
/api/liveDiff
Mappa diagnostica diff init/live per worker (se abilitata in backend).
—
/api/refresh_stats
Forza refresh del blocco statistiche globali lato server.
—
/api/live_stats (SSE)
Server-Sent Events: stream continuo di aggiornamenti live.
disconnected
—
Nota: questo endpoint è diverso dagli altri (non è JSON “one-shot”, ma un flusso di eventi).