Documentation
Worker, Wallet Statistics, and Chart API
RustMinerSystem port charts, worker lists, wallet statistics, independent fee ratios, logs, and TCP connection endpoints.
Worker, Wallet Statistics, and Chart API
These endpoints power the port-detail page and dashboard. GET calls are suitable for read-only monitoring; ratio mutations affect actual fee behavior.
Charts and system statistics
| Method | Path | Purpose |
|---|---|---|
| GET | /api/stat/currency/{currency} |
Total hashrate history for a currency. |
| GET | /api/stat/port/{id} |
Hashrate history for a listen port. |
| GET | /api/stat/worker/{id} |
Hashrate history for a worker. |
| GET | /api/device/stats |
Total device-count history. |
| GET | /api/currency/online/stat/{coin} |
Online-device history for one coin. |
| GET | /api/sys/stat |
CPU, memory, receive, and transmit history. |
| GET | /api/sys/base/info |
Current system-resource snapshot. |
History endpoints usually return arrays. Timestamp and unit conventions can vary by backend version.
Worker list
GET /api/port/{id}/g/workers?device=0&size=50&page=1&col=s_thh&desc=1&wallet=...
| Query | Meaning |
|---|---|
device |
Worker-state filter; the frontend defaults to 0. |
size |
Page size. |
page |
Page number. |
col |
Sort field, such as s_thh. |
desc |
1 for descending, 0 for ascending. |
wallet |
Optional comma-separated wallet filter. |
Fields consumed by the frontend include:
{
"workers": [],
"total": 0,
"stat": {
"online": 0,
"offline": 0,
"s_thh": 0
}
}
Wallet summaries and favorites
| Method | Path | Purpose |
|---|---|---|
| GET | /api/port/{id}/g/wallet/list |
Read wallets available for filtering. |
| GET | /api/port/{id}/g/wallets/{collect} |
Read wallet summaries; collect controls favorites filtering. |
| POST | /api/port/{id}/wallet/collect |
Add or remove a wallet favorite. |
{
"wallet": "<wallet or subaccount>",
"f": 1
}
f=1 adds the favorite; f=0 removes it.
Per-wallet fee ratio
| Method | Path | Purpose |
|---|---|---|
| GET | /api/port/{id}/wallet/ratio |
Read independent wallet ratios. |
| POST | /api/port/{id}/wallet/ratio |
Set the ratio for one miner wallet and fee wallet. |
| DELETE | /api/port/{id}/wallet/{wallet_name}/ratio |
Restore the wallet’s default ratio. |
{
"wallet": "<miner's wallet>",
"wid": 10,
"r": 0.01
}
wid is the fee-wallet ID, and r is a 0–1 fraction.
Per-worker fee ratio
Read the current ratio:
GET /api/wallet/{wallet_id}/worker/{sid}/ratio
Set or restore it:
POST /api/port/{id}/worker/ratio
X-ACCESS-TOKEN: <Access Token>
{
"sid": "<worker session ID>",
"wid": 10,
"r": 0.01,
"f": 1
}
f=1 saves an independent ratio; f=0 restores the default.
Logs and connections
| Method | Path | Purpose |
|---|---|---|
| GET | /api/port/{id}/log |
Read port logs. |
| GET | /api/group/{gid}/log |
Read worker-group connect/disconnect logs. |
| GET | /api/worker/{id}/error/log |
Read a worker’s failure data stream. |
| GET | /api/port/{id}/ips?page=1&size=20 |
Read active TCP connections for a port. |
The TCP response normally contains data, size, page, pages, and total.
Complete response models
Charts
Currency, port, and worker chart endpoints return ChartPoint[]. The port chart path uses server.port; the worker chart uses workers[].sid || workers[].id.
Worker-list envelope
{
"workers": [],
"stat": {
"id": "...",
"online": 0,
"conn": 0,
"offline": 0,
"thh": 0,
"s_thh": 0,
"delay": 0,
"ct": 0
},
"pages": 0,
"total": 0,
"page": 1,
"size": 50
}
Current frontend-consumed workers[] fields:
| Field | Type | Meaning |
|---|---|---|
id |
string | Worker record ID; preferred by the failure-stream endpoint. |
sid |
string | Session ID; preferred by charts and independent-ratio calls. |
gid |
string | Connection-group ID for group logs and WebSocket subscriptions. |
name |
string | Worker name. |
wallet |
string | Wallet/subaccount and wallet-filter value. |
status |
number | 0, 1, and 3 render as online; other values render as offline. |
s_thh / s_phh |
number/string | Effective and fee hashrate. |
ca |
string | Algorithm category; falls back to the port category. |
succ / fail |
number | Successful and failed shares. |
wn |
number/string | Online-since timestamp. |
n |
number/null | Current concurrency. |
dc |
number | Disconnect count. |
delay |
number | Delay in milliseconds. |
mode |
number | Port mode; mode 1 suppresses disconnect statistics in the UI. |
r |
number | Current fee ratio as a 0–1 fraction. |
md |
boolean/number | Legacy worker-name replacement-match flag. |
hw |
string/null | Matched wallet hot-replacement rule ID; null when unmatched. |
hd |
string/null | Matched worker-name hot-replacement rule ID; null when unmatched. |
Preserve additional response fields and use sid || id where a session identifier is needed. When hw or hd is not null, look up the same rule ID through GET /api/ht/{server_id}. Combine wallet or name with that rule’s target to show the original value and its identity-replacement target. If the rule also contains address and c, show the redirected pool and its TCP or TLS/SSL protocol as well.
Wallet lists and statistics
/g/wallet/listreturnsstring[]; each value can be sent in the worker query’swalletparameter./g/wallets/{collect}returns rows withid(submitted wallet/subaccount text),online,offline,s_thh, andct;ct=1means favorited./wallet/ratioreturns tuples:[[targetWallet, feeWalletId, ratio], ...].
The statistics-row id is not a fee-wallet record ID. feeWalletId, wid, and wallet_id must come from the port’s wallets[].id.
GET /api/wallet/{wallet_id}/worker/{sid}/ratio returns null or { "r": 0.01 }. If it is null, use the selected fee wallet’s default ratio. Collect, ratio-save, and ratio-reset calls return a success scalar or HTTP 200; refetch afterward.
Logs and connections
| Endpoint | Success response |
|---|---|
/api/port/{id}/log |
{ t, f, d? }[]; t is a timestamp and f is a pipe-delimited event. |
/api/group/{gid}/log |
{ t, f, d? }[]; the UI parses `connectionId |
/api/worker/{id}/error/log |
Raw failure stream; the frontend does not impose one fixed object schema. |
/api/port/{id}/ips |
{ data, total, pages, page, size }. |
Port-log f is parsed as reserved|worker|wallet|IP|category|status. Categories include GROUP, IP_FORBIDDEN, and WALLET_FORBIDDEN. Connection data[] contains ip, t, and nullable gid.
Field dependency map
| Input | Source |
|---|---|
Most port {id} values |
GET /api/ports → server.id. |
Port-chart {id} |
The same record’s server.port. |
wallet filter |
/g/wallet/list string or /g/wallets/{collect} → id. |
wid / wallet_id |
Port detail → wallets[].id. |
sid |
Worker list → `sid |
gid |
Worker list → gid. |
