Documentation
Proxy Port and Fee-Wallet API
RustMinerSystem proxy-port creation, editing, lossless pumping, 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. |
| GET | /api/port/{id}/lossless/ok |
{ "is_ok": boolean }, checking whether the current port configuration can use lossless mode. |
| 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. |
| GET | /api/lossless/pools |
Pool-platform list currently supplied for lossless mode. |
{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 traditional efficient, 1 compatible, 2 lossless pumping. |
proxy_addr |
string/null | Legacy unified wallet/account field. Lossless mode does not require it; preserve the GET value when editing. |
proxy_device |
string/null | Legacy unified worker field. Lossless mode does not require it; preserve the GET value when editing. |
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 and lossless modes use 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. |
li |
number/null | null |
Target pool-platform ID for lossless mode. With mode=2, submit the selected id from /api/lossless/pools; use null for other modes. |
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,
"li": null,
"cs": 0,
"cl": 8
}
}
For NGINX or protocol=9, the frontend disables advanced options, clears wallets, and forces mode=0.
Lossless-mode request rules
Lossless pumping currently supports BTC and LTC only. Before creating or editing a lossless port, call /api/lossless/pools, ask the user to select the platform that actually owns the primary-pool address, and submit mode: 2 with the selected pool id in setting.li.
Every wallets[].pool_address and pool_protocol must match server.pool_address and connect_mode. Wallet addr, device, and ratio remain independent. Use the ID returned by the endpoint; do not invent one.
The backend cannot determine the user’s pool platform from the address alone. If the selected platform does not match the primary-pool address, lossless operation can fail with serious, unpredictable results. If the target pool is absent from the returned list, submit mode: 0 instead.
Lossless pool list and eligibility
GET /api/lossless/pools returns entries shaped as follows:
[
{
"id": 1,
"name": "Pool name",
"state": 0
}
]
| Field | Type | Meaning |
|---|---|---|
id |
number | Submit as setting.li for the selected lossless pool platform. |
name |
string | Pool-platform name shown to the user. |
state |
number | Server policy state handled by the backend later. A client must not filter or disable an item solely because of this value. |
Treat this as a dynamic server list, not a hard-coded allowlist. Clear the old selection and ask the user again after the coin or primary pool changes.
GET /api/port/{id}/lossless/ok returns { "is_ok": true } or { "is_ok": false }. {id} is server.id. This read-only check reports eligibility for the current configuration and does not replace the required user selection of the actual pool platform.
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.
For a mode=2 port, hot update can still add, remove, or edit wallets and can change addr, device, and ratio. pool_address and pool_protocol must continue to follow the primary pool and cannot be switched independently. Edit the complete port to change the primary pool or lossless pool platform.
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.
See Wallet and worker-name hot replacement for the complete Web UI workflow.
The current endpoint accepts only the combined wallet-and-worker rule type t=2. Types t=0 and t=1 are deprecated and must no longer be submitted. Both pat and target use the wallet.device format with exactly one dot separating the wallet and worker-name sides.
Each side of pat accepts one value, a comma-separated list, or a whole-side *; the rule format does not cap the list length. Ordinary values accept ASCII letters, digits, _, @, and -. For example, a.* matches every worker using wallet a, *.b matches worker name b under any wallet, *.* matches every miner, and a,b,c.* or *.d,e,f match several wallets or worker names. Matching uses complete values; regular expressions and partial wildcards are not supported.
Each side of target is either a fixed value made from the ordinary characters above or its preserve-current-value placeholder. Use #{WALLET} on the wallet side and #{DEVICE} on the worker-name side. For example, a.#{DEVICE} changes only the wallet, #{WALLET}.b changes only the worker name, and c.d changes both. A placeholder cannot be used on the wrong side.
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 or replacement target, 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": "wallet_a,wallet_b.*",
"target": "#{WALLET}.worker-new",
"t": 2,
"address": "stratum.example.com:3333",
"c": 0
}
| Field | Type | Required | Meaning |
|---|---|---|---|
server_id |
string | Yes | server.id of an existing port. |
pat |
string | Yes | Combined wallet.device match; each side accepts one value, a comma-separated list, or a whole-side *. |
target |
string | Yes | Combined wallet.device target; each side uses a fixed value or its preserve-current-value placeholder. |
t |
number | Yes | Fixed at 2; 0 and 1 are deprecated. |
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 identity should change, omit both fields instead of sending an empty address. Pool redirection does not alter the combined replacement rule: after a match, the server applies the wallet and worker-name targets and reconnects the miner to the specified pool.
Read rules
GET /api/ht/cEdmA.46
X-ACCESS-TOKEN: <Access Token>
[
["8ZLG", "cEdmA.46", "wallet_a,wallet_b.*", "#{WALLET}.worker-new", 2, "stratum.example.com:3333", 0],
["Mirr", "cEdmA.46", "*.worker_a,worker_b", "wallet-new.#{DEVICE}", 2]
]
The current frontend also accepts an object array with the same field meanings:
[
{
"id": "8ZLG",
"server_id": "cEdmA.46",
"pat": "wallet_a,wallet_b.*",
"target": "#{WALLET}.worker-new",
"t": 2,
"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 | Combined wallet.device match pattern. |
3 |
target |
string | Combined wallet.device replacement target. |
4 |
t |
number | Currently fixed at 2. |
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 field wd contains the matched combined rule ID and corresponds to tuple index 0 (id) in the rule response. Fields hw and hd are deprecated. See the worker response fields.
