Documentation
Proxy Port and Fee-Wallet API
RustMinerSystem proxy-port creation, editing, start/stop, import, pool connectivity, fee-wallet, and wallet/worker hot-replacement endpoints.
Proxy Port and Fee-Wallet API
These calls directly change proxy behavior. Back up configuration and treat X-ACCESS-TOKEN as a high-privilege credential. The models below come from the completed frontend and were checked against read-only responses from a running instance.
Endpoints and responses
| Method | Path | Success response |
|---|---|---|
| GET | /api/ports |
PortRecord[]. |
| GET | /api/port/{id} |
One PortRecord. |
| POST | /api/port/new |
New port ID; numeric -1 means the currency is unsupported. |
| POST | /api/port/{id} |
Saved ID or success scalar; GET the port again for canonical values. |
| POST | /api/port/{id}/start |
HTTP 200 accepts the operation; verify server.status. |
| POST | /api/port/{id}/stop |
HTTP 200 accepts the operation; verify server.status. |
| DELETE | /api/port/{id} |
HTTP 200 on deletion. |
| POST | /api/ports/import |
Per-port error array; an empty array reports no errors. |
| POST | /api/ping |
HTTP 200 when the connectivity check passes. |
{id} is server.id, which may be a string and is not the listen port. /api/stat/port/{id} is the exception: it uses server.port.
Complete PortRecord
Every record contains server, wallets[], stat, and setting.
server
| Field | Type | Request rule and meaning |
|---|---|---|
id |
string | Server-generated record ID and edit path parameter. |
port |
number | Required listen port, integer 1–65534. |
name |
string | Optional display name. |
currency |
string | Required; use a key or name from /api/currency/config. |
category |
string | Required; use category from the same currency entry. |
protocol |
number | 0 TCP, 1 TLS/SSL, 2 RMS, 3 TTS, 5 RMS2, 6 RMS3, 8 RMS3 ZSTD, 9 transparent relay. |
limit_connections |
number | 0–65535; 0 means unlimited. |
pool_address |
string | Required primary upstream host:port. |
pool_address2 |
string/null | Optional backup upstream. |
connect_mode |
number | Primary upstream: 0 TCP, 1 TLS/SSL; old data may contain 5 RMS2 or 6 RMS3. |
connect_mode2 |
number | Backup upstream protocol, same enum. |
mode |
number | 0 efficient, 1 compatible, 2 pool/unified-wallet mode. |
proxy_addr |
string/null | Unified wallet/account, required when mode=2. |
proxy_device |
string/null | Unified worker name, required when mode=2. |
pattern_addr |
string | Legacy wallet-replacement patterns. The current UI always submits an empty string; use hot-replacement rules for new configurations. |
replace_addr |
string | Legacy wallet-replacement target. The current UI always submits an empty string. |
nc |
number | Compatibility flag, 0 or 1. |
status |
number | Response-only runtime state. |
error |
string | Response-only latest port error. |
created_at / updated_at |
string | Response-only timestamps. |
KENC uses protocol=1, setting.et_mode=1; SOCKS5 uses protocol=0, setting.et_mode=2.
wallets[]
At most ten fee-wallet rows are supported. Rows with a zero ratio are omitted by the current frontend.
| Field | Type | Request rule and meaning |
|---|---|---|
id |
string | Server-generated fee-wallet ID; include when editing. |
server_id |
string | Required by hot updates; use the owning server.id. Omit in a create/edit port body. |
addr |
string | Required fee wallet or subaccount. |
device |
string | Required fee worker name. |
pool_address |
string | Required fee-pool address. Compatible mode uses the port’s primary pool. |
pool_protocol |
number | 0 TCP, 1 TLS/SSL. |
ratio |
number | Fraction from 0 through 1; 0.01 means 1%. |
created_at / updated_at |
string | Response-only timestamps. |
Never substitute the numeric listen port for server_id.
setting
| Field | Type | Default | Meaning |
|---|---|---|---|
port |
number | server.port |
Associated listen port. |
cp_name |
string | "" |
Compatibility-reserved; no separate current UI field. |
cp_mode |
number | 1 |
Compatibility mode; preserve the GET value. |
pu_mode |
number | 0 |
Compatibility mode; preserve the GET value. |
et_mode |
number | 0 |
Extended transport: 0 normal, 1 KENC, 2 SOCKS5. |
pth |
number | currency-specific | Hashrate protection: 0 enabled, 1 disabled. |
cut |
number | 0 |
Reserved compatibility switch. |
fr |
number | 0 |
Force successful share replies: 0 enabled, 1 disabled. |
ft |
number/null | 0 |
Reply delay in milliseconds, 0–200; old responses may be null. |
op |
number | 0 |
Foundry/OKMiner optimization; 1 enables it for applicable BTC/BCH/LTC cases. |
sp |
number | 0 |
Reserved compatibility switch. |
sd |
string | "" |
Legacy worker-name replacement patterns. The current UI always submits an empty string; use hot-replacement rules for new configurations. |
st |
string | "" |
Legacy worker-name replacement target. The current UI always submits an empty string. |
ra |
string/null | null |
Replacement miner-kernel information. |
lj |
number/null | 0 |
LTC firmware optimization; current UI uses 1 for enabled. |
cs |
number/null | currency-specific | RMS3 super compression: 1 enabled. |
cl |
number/null | 8 |
RMS3 compression level, 4–11. |
Reserved fields do not have enough frontend semantics to infer safer values. Read the port first and merge changes instead of replacing the object.
stat
| Field | Type | Meaning |
|---|---|---|
port |
number | Listen port. |
online / offline |
number | Online and offline worker counts. |
conn |
number | Current TCP connection count. |
thh |
string/number | Raw hashrate. |
s_thh |
string/number | Current effective hashrate used by the UI. |
delay |
number | Delay in milliseconds. |
Create or edit body
{
"port": 3333,
"name": "BTC Proxy",
"currency": "BTC",
"category": "sha256",
"protocol": 0,
"limit_connections": 60000,
"pool_address": "stratum.example.com:3333",
"pool_address2": "",
"connect_mode": 0,
"connect_mode2": 0,
"mode": 0,
"nc": 1,
"pattern_addr": "",
"replace_addr": "",
"wallets": [
{
"addr": "fee-wallet",
"device": "fee-worker",
"pool_address": "fee-pool.example.com:3333",
"pool_protocol": 0,
"ratio": 0.01
}
],
"setting": {
"port": 3333,
"cp_name": "",
"cp_mode": 1,
"pu_mode": 0,
"et_mode": 0,
"pth": 1,
"cut": 0,
"fr": 0,
"ft": 0,
"op": 0,
"sp": 0,
"sd": "",
"st": "",
"ra": null,
"lj": 0,
"cs": 0,
"cl": 8
}
}
For NGINX or protocol=9, the frontend disables advanced options, clears wallets, and forces mode=0.
Bulk import and connectivity test
POST /api/ports/import accepts { "ports": [...] }, where each item follows this chapter’s port model. Inspect the returned error array even on HTTP 200.
POST /api/ping accepts:
{
"address": "stratum.example.com:3333",
"conn_type": 0
}
Do not include a stratum+tcp:// prefix. conn_type=0 is plain TCP and 1 is TLS/SSL-like.
Hot-update fee wallets
| Method | Path | Request | Success response |
|---|---|---|---|
| POST | /api/wallet/new |
Complete wallet with server_id. |
HTTP 200; GET the port to obtain id. |
| POST | /api/wallet/{id} |
Complete wallet; the UI also includes id in the body. |
HTTP 200; GET the port again. |
| DELETE | /api/wallet/{id} |
No body. | HTTP 200. |
The form displays percentages, but ratio in the request remains a 0–1 fraction. Both IDs come from the port-detail response.
Wallet and worker-name hot replacement
A hot-replacement rule belongs to an existing proxy port. Every server_id below must therefore be the port’s server.id, never its numeric listen port. When a rule matches, the server forcibly disconnects the affected miner. The replacement does not alter the current connection; it takes effect when the miner reconnects.
pat and target accept only ASCII letters, digits, and the special characters _ - * . @. Regular expressions are not supported. Enter a specific original wallet or worker name in pat for an exact full-value match; enter * by itself to match every device on the port. Use * carefully because one operation can make many miners reconnect at once.
Endpoint summary
| Method | Path | Request | Success response |
|---|---|---|---|
| GET | /api/ht/{server_id} |
No body. | Array of hot-replacement tuples or objects. |
| POST | /api/ht/new |
{ server_id, pat, target, t, address?, c? }. |
HTTP 200 with text Ok. |
| POST | /api/ht |
{ id, server_id }. |
HTTP 200 with text Ok. |
Hot-replacement rules cannot be edited after creation. To change the match pattern, replacement target, or rule type, delete the existing rule and create a new one.
Create a rule
POST /api/ht/new
X-ACCESS-TOKEN: <Access Token>
Content-Type: application/json
{
"server_id": "cEdmA.46",
"pat": "*",
"target": "wallet_target",
"t": 0,
"address": "stratum.example.com:3333",
"c": 0
}
| Field | Type | Required | Meaning |
|---|---|---|---|
server_id |
string | Yes | server.id of an existing port. |
pat |
string | Yes | Enter a specific original wallet or worker name to match only devices using that value; enter * to match every device on the port. |
target |
string | Yes | Target wallet or worker name used after a match. |
t |
number | Yes | 0 replaces wallets; 1 replaces worker names. |
address |
string | No | Pool address to use after a match, such as host:port. Omit it when pool redirection is not needed. |
c |
number | With address |
Redirected pool connection protocol: 0 for TCP, 1 for TLS/SSL. |
address and c form one optional pair. Send both when the matched miner should also be redirected to another pool. When only the wallet or worker name should change, omit both fields instead of sending an empty address. Pool redirection does not change the meaning of t: after a match, the server applies the selected identity replacement and reconnects the miner to the specified pool.
Read rules
GET /api/ht/cEdmA.46
X-ACCESS-TOKEN: <Access Token>
[
["8ZLG", "cEdmA.46", "*", "wallet_target", 0, "stratum.example.com:3333", 0],
["Mirr", "cEdmA.46", "miner", "worker_target", 1]
]
The current frontend also accepts an object array with the same field meanings:
[
{
"id": "8ZLG",
"server_id": "cEdmA.46",
"pat": "*",
"target": "wallet_target",
"t": 0,
"address": "stratum.example.com:3333",
"c": 0
}
]
| Tuple index | Field | Type | Meaning |
|---|---|---|---|
0 |
id |
string | Server-generated rule ID; submit it unchanged for deletion. |
1 |
server_id |
string | Owning port ID. |
2 |
pat |
string | Match pattern. |
3 |
target |
string | Replacement target. |
4 |
t |
number | 0 for a wallet rule; 1 for a worker-name rule. |
5 |
address |
string/null | Optional redirected pool address; it can be empty, null, or omitted when not configured. |
6 |
c |
number/null | Optional redirected pool protocol: 0 for TCP, 1 for TLS/SSL; it can be empty or omitted without address. |
Object responses use the corresponding named fields. Treat address and c as one pair. If address is empty or absent, the miner keeps using the pool configured on the current port; do not infer that redirection is enabled from c alone.
Delete a rule
Send the rule id and its port server_id to POST /api/ht:
{
"id": "8ZLG",
"server_id": "cEdmA.46"
}
After creating or deleting a rule, call GET /api/ht/{server_id} again instead of treating the Ok text as the final state. Worker-list fields hw and hd contain matched rule IDs; see the worker response fields.
