mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-10 21:04:37 +00:00
Added command line options --dns-ipv6 and --dns-ttl.
This commit is contained in:
parent
2c8f7f692c
commit
0d45600b0e
4 changed files with 17 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "base/kernel/config/BaseConfig.h"
|
||||
#include "base/kernel/interfaces/IConfig.h"
|
||||
#include "base/kernel/Process.h"
|
||||
#include "base/net/dns/DnsConfig.h"
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "base/net/stratum/Pools.h"
|
||||
#include "core/config/Config_platform.h"
|
||||
|
@ -244,6 +245,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||
case IConfig::HttpPort: /* --http-port */
|
||||
case IConfig::DonateLevelKey: /* --donate-level */
|
||||
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
|
||||
case IConfig::DnsTtlKey: /* --dns-ttl */
|
||||
return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||
|
||||
case IConfig::BackgroundKey: /* --background */
|
||||
|
@ -256,6 +258,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
|||
case IConfig::DaemonKey: /* --daemon */
|
||||
case IConfig::SubmitToOriginKey: /* --submit-to-origin */
|
||||
case IConfig::VerboseKey: /* --verbose */
|
||||
case IConfig::DnsIPv6Key: /* --dns-ipv6 */
|
||||
return transformBoolean(doc, key, true);
|
||||
|
||||
case IConfig::ColorKey: /* --no-color */
|
||||
|
@ -316,6 +319,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
|
|||
case IConfig::NoTitleKey: /* --no-title */
|
||||
return set(doc, BaseConfig::kTitle, enable);
|
||||
|
||||
case IConfig::DnsIPv6Key: /* --dns-ipv6 */
|
||||
return set(doc, DnsConfig::kField, DnsConfig::kIPv6, enable);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -344,6 +350,9 @@ void xmrig::BaseTransform::transformUint64(rapidjson::Document &doc, int key, ui
|
|||
case IConfig::PrintTimeKey: /* --print-time */
|
||||
return set(doc, BaseConfig::kPrintTime, arg);
|
||||
|
||||
case IConfig::DnsTtlKey: /* --dns-ttl */
|
||||
return set(doc, DnsConfig::kField, DnsConfig::kTTL, arg);
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
|
||||
return add(doc, Pools::kPools, Pool::kDaemonPollInterval, arg);
|
||||
|
|
|
@ -82,6 +82,8 @@ public:
|
|||
HugePageSizeKey = 1050,
|
||||
PauseOnActiveKey = 1051,
|
||||
SubmitToOriginKey = 1052,
|
||||
DnsIPv6Key = 1053,
|
||||
DnsTtlKey = 1054,
|
||||
|
||||
// xmrig common
|
||||
CPUPriorityKey = 1021,
|
||||
|
|
|
@ -93,7 +93,9 @@ static const option options[] = {
|
|||
{ "title", 1, nullptr, IConfig::TitleKey },
|
||||
{ "no-title", 0, nullptr, IConfig::NoTitleKey },
|
||||
{ "pause-on-battery", 0, nullptr, IConfig::PauseOnBatteryKey },
|
||||
{ "pause-on-active", 1, nullptr, IConfig::PauseOnActiveKey },
|
||||
{ "pause-on-active", 1, nullptr, IConfig::PauseOnActiveKey },
|
||||
{ "dns-ipv6", 0, nullptr, IConfig::DnsIPv6Key },
|
||||
{ "dns-ttl", 1, nullptr, IConfig::DnsTtlKey },
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
{ "stress", 0, nullptr, IConfig::StressKey },
|
||||
{ "bench", 1, nullptr, IConfig::BenchKey },
|
||||
|
|
|
@ -59,6 +59,9 @@ static inline const std::string &usage()
|
|||
u += " --tls-fingerprint=HEX pool TLS certificate fingerprint for strict certificate pinning\n";
|
||||
# endif
|
||||
|
||||
u += " --dns-ipv6 prefer IPv6 records from DNS responses\n";
|
||||
u += " --dns-ttl=N N seconds (default: 30) TTL for internal DNS cache\n";
|
||||
|
||||
# ifdef XMRIG_FEATURE_HTTP
|
||||
u += " --daemon use daemon RPC instead of pool for solo mining\n";
|
||||
u += " --daemon-poll-interval=N daemon poll interval in milliseconds (default: 1000)\n";
|
||||
|
|
Loading…
Reference in a new issue