Skip to main content

Configuration file

Precedence, highest first:

  1. command-line flags
  2. the file passed with -c/--config
  3. the miner's defaults

Only flags you actually type override the file. zmrig -c config.json --verbose does not lose "mode": "light" or "huge-pages": false. (Before 6.26.0-mo9 it did; see the changelog.)

A file the installer wrote​

{
"api": { "id": null, "worker-id": "vps-sg-02" },
"http": {
"enabled": true,
"host": "127.0.0.1",
"port": 18080,
"access-token": null,
"restricted": true
},
"autosave": true,
"background": false,
"colors": false,
"randomx": {
"mode": "auto",
"rdmsr": true,
"msr": "auto",
"numa": true,
"scratchpad_prefetch_mode": 1
},
"cpu": {
"huge-pages": true,
"huge-pages-jit": true,
"priority": 5,
"max-threads-hint": 100,
"asm": true
},
"donate-level": 0,
"pools": [
{
"algo": null,
"url": "gulf.moneroocean.stream:10001",
"user": "YOUR_WALLET",
"pass": "x",
"rig-id": "vps-sg-02",
"keepalive": true,
"enabled": true,
"tls": false,
"transport": "wss",
"ws-path": "/pool"
}
],
"print-time": 60,
"retries": 5,
"retry-pause": 5,
"idle-timeout": 300,
"keepalive-interval": 60,
"report": { "enabled": true, "file": "/var/lib/zmrig/report.txt", "interval": 60 },
"power": 45
}

transport, ws-path, ws-origin, proxy, connect-to, tls-ca, idle-timeout, keepalive-interval, report and power are understood by the Zig engine. The C++ engine ignores keys it does not know, so the same file works for both.

Keys​

KeyTypeDefaultNotes
algostringautomaticrx/0, rx/wow, panthera, … or auto
print-timenumber60seconds between hashrate lines, 0 disables
retriesnumber5attempts per pool before failover
retry-pausenumber5seconds between attempts, jittered ±20 %
idle-timeoutnumber300drop a silent connection, 0 disables
keepalive-intervalnumber60seconds between keepalives
colorsbooltruelog colour; log files are always plain text
backgroundboolfalsefork into the background
log-filestringnullalso write the log to a file
powernumber—wall watts, included in report codes
report.filestringnullwhere to write the report code
report.intervalnumber60seconds between writes
report.idstringrig-idmachine name in the report
http.enabledboolfalsemonitoring API
http.port / http.hostnumber / string18080 / 127.0.0.1
http.access-tokenstringnullrequire a Bearer token
randomx.modeauto/fast/lightautofast builds the 2 GiB dataset
randomx.msr"auto" / true / false"auto"the prefetcher-off preset: auto asks the machine first, worth 5-15 % on bare metal; wrmsr with a bool is the same key
cpu.threadsnumber or arraycache-awarean array is one entry per thread
cpu.huge-pagesbooltrue
cpu.huge-pages-jitbooltrue
cpu.asmbooltrueJIT; disabling is about six times slower
cpu.prioritynumber-1XMRig scale 1..5, or a raw nice value

Pool objects accept url, user, pass, rig-id, algo, keepalive, tls, transport, ws-path, ws-origin, host-header, connect-to, tls-ca, proxy, enabled.

Editing it safely​

sudo systemctl stop zmrig
sudo cp /etc/zmrig/config.json /etc/zmrig/config.json.bak
sudo -e /etc/zmrig/config.json
zmrig --check -c /etc/zmrig/config.json # parse and validate, do not mine
sudo systemctl start zmrig

--check exits non-zero and prints the offending key, which is faster than reading the journal after the service has already restarted four times.

Autosave

"autosave": true lets the miner rewrite the file when it changes something it owns (a tuned thread count, for example). If you want a file the miner never touches, set it to false and restart rather than editing a running config.