1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-28 06:38:16 -05:00

Merged v4.3.0-beta

This commit is contained in:
MoneroOcean
2019-10-10 14:52:12 -07:00
101 changed files with 10318 additions and 7615 deletions

View File

@@ -23,9 +23,9 @@
*/
#include <algorithm>
#include <string.h>
#include <cstring>
#include <uv.h>
#include <inttypes.h>
#include <cinttypes>
#include "backend/cpu/Cpu.h"
@@ -50,8 +50,7 @@
namespace xmrig {
static const char *kCPU = "cpu";
static constexpr const uint32_t kVersion = 1;
static const char *kCPU = "cpu";
#ifdef XMRIG_ALGO_RANDOMX
static const char *kRandomX = "randomx";
@@ -79,7 +78,7 @@ public:
}
xmrig::Config::Config() : BaseConfig(),
xmrig::Config::Config() :
d_ptr(new ConfigPrivate())
{
}
@@ -119,10 +118,6 @@ bool xmrig::Config::isShouldSave() const
return false;
}
if (version() < kVersion) {
return true;
}
# ifdef XMRIG_FEATURE_OPENCL
if (cl().isShouldSave()) {
return true;
@@ -139,7 +134,7 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
return false;
}
d_ptr->cpu.read(reader.getValue(kCPU), version());
d_ptr->cpu.read(reader.getValue(kCPU));
m_benchmark.read(reader.getValue("algo-perf"));
# ifdef XMRIG_ALGO_RANDOMX
@@ -171,7 +166,6 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
doc.AddMember("api", api, allocator);
doc.AddMember("http", m_http.toJSON(doc), allocator);
doc.AddMember("autosave", isAutoSave(), allocator);
doc.AddMember("version", kVersion, allocator);
doc.AddMember("background", isBackground(), allocator);
doc.AddMember("colors", Log::colors, allocator);

View File

@@ -26,11 +26,12 @@
#define XMRIG_CONFIG_H
#include <stdint.h>
#include <cstdint>
#include "backend/cpu/CpuConfig.h"
#include "base/kernel/config/BaseConfig.h"
#include "base/tools/Object.h"
#include "core/Benchmark.h"
#include "rapidjson/fwd.h"
@@ -47,6 +48,8 @@ class OclConfig;
class Config : public BaseConfig
{
public:
XMRIG_DISABLE_COPY_MOVE(Config);
Config();
~Config() override;

View File

@@ -141,6 +141,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
case IConfig::CPUMaxThreadsKey: /* --cpu-max-threads-hint */
return set(doc, kCpu, "max-threads-hint", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::MemoryPoolKey: /* --cpu-memory-pool */
return set(doc, kCpu, "memory-pool", static_cast<int64_t>(strtol(arg, nullptr, 10)));
break;
# ifdef XMRIG_FEATURE_ASM
case IConfig::AssemblyKey: /* --asm */
return set(doc, kCpu, "asm", arg);

View File

@@ -57,6 +57,7 @@ R"===(
"huge-pages": true,
"hw-aes": null,
"priority": null,
"memory-pool": false,
"max-threads-hint": 100,
"asm": true,
"argon2-impl": null,

View File

@@ -86,6 +86,7 @@ static const option options[] = {
{ "no-cpu", 0, nullptr, IConfig::CPUKey },
{ "max-cpu-usage", 1, nullptr, IConfig::CPUMaxThreadsKey },
{ "cpu-max-threads-hint", 1, nullptr, IConfig::CPUMaxThreadsKey },
{ "cpu-memory-pool", 1, nullptr, IConfig::MemoryPoolKey },
# ifdef XMRIG_FEATURE_TLS
{ "tls", 0, nullptr, IConfig::TlsKey },
{ "tls-fingerprint", 1, nullptr, IConfig::FingerprintKey },

View File

@@ -46,6 +46,7 @@ static inline const std::string &usage()
u += "Usage: " APP_ID " [OPTIONS]\n\nNetwork:\n";
u += " -o, --url=URL URL of mining server\n";
u += " -a, --algo=ALGO mining algorithm https://xmrig.com/docs/algorithms\n";
u += " --coin=COIN specify coin instead of algorithm\n";
u += " -u, --user=USERNAME username for mining server\n";
u += " -p, --pass=PASSWORD password for mining server\n";
u += " -O, --userpass=U:P username:password pair for mining server\n";
@@ -77,6 +78,7 @@ static inline const std::string &usage()
u += " --cpu-affinity set process affinity to CPU core(s), mask 0x3 for cores 0 and 1\n";
u += " --cpu-priority set process priority (0 idle, 2 normal to 5 highest)\n";
u += " --cpu-max-threads-hint=N maximum CPU threads count (in percentage) hint for autoconfig\n";
u += " --cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)\n";
u += " --no-huge-pages disable huge pages support\n";
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";