Added command line option --daemon and --daemon-poll-interval

This commit is contained in:
XMRig 2019-04-12 18:30:08 +07:00
parent 5e369a5af8
commit 867478b983
4 changed files with 71 additions and 42 deletions

View file

@ -161,6 +161,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::PrintTimeKey: /* --print-time */ case IConfig::PrintTimeKey: /* --print-time */
case IConfig::HttpPort: /* --http-port */ case IConfig::HttpPort: /* --http-port */
case IConfig::DonateLevelKey: /* --donate-level */ case IConfig::DonateLevelKey: /* --donate-level */
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
# ifdef XMRIG_DEPRECATED # ifdef XMRIG_DEPRECATED
case IConfig::ApiPort: /* --api-port */ case IConfig::ApiPort: /* --api-port */
# endif # endif
@ -173,6 +174,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::TlsKey: /* --tls */ case IConfig::TlsKey: /* --tls */
case IConfig::DryRunKey: /* --dry-run */ case IConfig::DryRunKey: /* --dry-run */
case IConfig::HttpEnabledKey: /* --http-enabled */ case IConfig::HttpEnabledKey: /* --http-enabled */
case IConfig::DaemonKey: /* --daemon */
return transformBoolean(doc, key, true); return transformBoolean(doc, key, true);
case IConfig::ColorKey: /* --no-color */ case IConfig::ColorKey: /* --no-color */
@ -204,6 +206,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
case IConfig::TlsKey: /* --tls */ case IConfig::TlsKey: /* --tls */
return add(doc, kPools, "tls", enable); return add(doc, kPools, "tls", enable);
case IConfig::DaemonKey: /* --daemon */
return add(doc, kPools, "daemon", enable);
# ifndef XMRIG_PROXY_PROJECT # ifndef XMRIG_PROXY_PROJECT
case IConfig::NicehashKey: /* --nicehash */ case IConfig::NicehashKey: /* --nicehash */
return add<bool>(doc, kPools, "nicehash", enable); return add<bool>(doc, kPools, "nicehash", enable);
@ -265,6 +270,9 @@ void xmrig::BaseTransform::transformUint64(rapidjson::Document &doc, int key, ui
case IConfig::PrintTimeKey: /* --print-time */ case IConfig::PrintTimeKey: /* --print-time */
return set(doc, "print-time", arg); return set(doc, "print-time", arg);
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
return add(doc, kPools, "daemon-poll-interval", arg);
default: default:
break; break;
} }

View file

@ -70,6 +70,8 @@ public:
TlsKey = 1013, TlsKey = 1013,
FingerprintKey = 1014, FingerprintKey = 1014,
ProxyDonateKey = 1017, ProxyDonateKey = 1017,
DaemonKey = 1018,
DaemonPollKey = 1019,
# ifdef XMRIG_DEPRECATED # ifdef XMRIG_DEPRECATED
ApiPort = 4000, ApiPort = 4000,

View file

@ -82,6 +82,8 @@ static const option options[] = {
{ "tls", 0, nullptr, IConfig::TlsKey }, { "tls", 0, nullptr, IConfig::TlsKey },
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey }, { "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },
{ "asm", 1, nullptr, IConfig::AssemblyKey }, { "asm", 1, nullptr, IConfig::AssemblyKey },
{ "daemon", 0, nullptr, IConfig::DaemonKey },
{ "daemon-poll-interval", 1, nullptr, IConfig::DaemonPollKey },
# ifdef XMRIG_DEPRECATED # ifdef XMRIG_DEPRECATED
{ "api-port", 1, nullptr, IConfig::ApiPort }, { "api-port", 1, nullptr, IConfig::ApiPort },

View file

@ -35,59 +35,76 @@ namespace xmrig {
static char const usage[] = "\ static char const usage[] = "\
Usage: " APP_ID " [OPTIONS]\n\ Usage: " APP_ID " [OPTIONS]\n\
Options:\n\ Options:\n\
-a, --algo=ALGO specify the algorithm to use\n\ -a, --algo=ALGO specify the algorithm to use\n\
cryptonight\n" cryptonight\n"
#ifndef XMRIG_NO_AEON #ifndef XMRIG_NO_AEON
"\ "\
cryptonight-lite\n" cryptonight-lite\n"
#endif #endif
#ifndef XMRIG_NO_SUMO #ifndef XMRIG_NO_SUMO
"\ "\
cryptonight-heavy\n" cryptonight-heavy\n"
#endif
#ifndef XMRIG_NO_CN_PICO
"\
cryptonight-pico\n"
#endif #endif
"\ "\
-o, --url=URL URL of mining server\n\ -o, --url=URL URL of mining server\n\
-O, --userpass=U:P username:password pair for mining server\n\ -O, --userpass=U:P username:password pair for mining server\n\
-u, --user=USERNAME username for mining server\n\ -u, --user=USERNAME username for mining server\n\
-p, --pass=PASSWORD password for mining server\n\ -p, --pass=PASSWORD password for mining server\n\
--rig-id=ID rig identifier for pool-side statistics (needs pool support)\n\ --rig-id=ID rig identifier for pool-side statistics (needs pool support)\n\
-t, --threads=N number of miner threads\n\ -t, --threads=N number of miner threads\n\
-v, --av=N algorithm variation, 0 auto select\n\ -v, --av=N algorithm variation, 0 auto select\n\
-k, --keepalive send keepalived packet for prevent timeout (needs pool support)\n\ -k, --keepalive send keepalived packet for prevent timeout (needs pool support)\n\
--nicehash enable nicehash.com support\n\ --nicehash enable nicehash.com support\n"
--tls enable SSL/TLS support (needs pool support)\n\ #ifdef XMRIG_FEATURE_TLS
--tls-fingerprint=F pool TLS certificate fingerprint, if set enable strict certificate pinning\n\ "\
-r, --retries=N number of times to retry before switch to backup server (default: 5)\n\ --tls enable SSL/TLS support (needs pool support)\n\
-R, --retry-pause=N time to pause between retries (default: 5)\n\ --tls-fingerprint=F pool TLS certificate fingerprint, if set enable strict certificate pinning\n"
--cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n\ #endif
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n\ #ifdef XMRIG_FEATURE_HTTP
--no-huge-pages disable huge pages support\n\ "\
--no-color disable colored output\n\ --daemon use daemon RPC instead of pool for solo mining\n\
--variant algorithm PoW variant\n\ --daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)\n"
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n\ #endif
--user-agent set custom user-agent string for pool\n\ "\
-B, --background run the miner in the background\n\ -r, --retries=N number of times to retry before switch to backup server (default: 5)\n\
-c, --config=FILE load a JSON-format configuration file\n\ -R, --retry-pause=N time to pause between retries (default: 5)\n\
-l, --log-file=FILE log all output to a file\n" --cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n\
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n\
--no-huge-pages disable huge pages support\n\
--no-color disable colored output\n\
--variant algorithm PoW variant\n\
--donate-level=N donate level, default 5%% (5 minutes in 100 minutes)\n\
--user-agent set custom user-agent string for pool\n\
-B, --background run the miner in the background\n\
-c, --config=FILE load a JSON-format configuration file\n\
-l, --log-file=FILE log all output to a file\n"
# ifdef HAVE_SYSLOG_H # ifdef HAVE_SYSLOG_H
"\ "\
-S, --syslog use system log for output messages\n" -S, --syslog use system log for output messages\n"
# endif # endif
"\ "\
--max-cpu-usage=N maximum CPU usage for automatic threads mode (default 75)\n\ --max-cpu-usage=N maximum CPU usage for automatic threads mode (default: 100)\n\
--safe safe adjust threads and av settings for current CPU\n\ --safe safe adjust threads and av settings for current CPU\n\
--asm=ASM ASM code for cn/2, possible values: auto, none, intel, ryzen, bulldozer.\n\ --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer.\n\
--print-time=N print hashrate report every N seconds\n\ --print-time=N print hashrate report every N seconds\n"
--api-worker-id=ID custom worker-id for API\n\ #ifdef XMRIG_FEATURE_HTTP
--api-id=ID custom instance ID for API\n\ "\
--http-enabled enable HTTP API\n\ --api-worker-id=ID custom worker-id for API\n\
--http-host=HOST bind host for HTTP API (by default 127.0.0.1)\n\ --api-id=ID custom instance ID for API\n\
--http-port=N bind port for HTTP API\n\ --http-enabled enable HTTP API\n\
--http-access-token=T access token for HTTP API\n\ --http-host=HOST bind host for HTTP API (default: 127.0.0.1)\n\
--http-no-restricted enable full remote access to HTTP API (only if access token set)\n\ --http-port=N bind port for HTTP API\n\
--dry-run test configuration and exit\n\ --http-access-token=T access token for HTTP API\n\
-h, --help display this help and exit\n\ --http-no-restricted enable full remote access to HTTP API (only if access token set)\n"
-V, --version output version information and exit\n\ #endif
"\
--dry-run test configuration and exit\n\
-h, --help display this help and exit\n\
-V, --version output version information and exit\n\
"; ";