Example #1
0
void xmrig::CommonConfig::printVersions()
{
    char buf[256] = { 0 };

#   if defined(__clang__)
    snprintf(buf, sizeof buf, "clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
#   elif defined(__GNUC__)
    snprintf(buf, sizeof buf, "gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#   elif defined(_MSC_VER)
    snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION);
#   endif

    Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s")
                              : " * %-13s%s/%s %s",
                   "ABOUT", APP_NAME, APP_VERSION, buf);

#   if defined(XMRIG_AMD_PROJECT)
#   if CL_VERSION_2_0
    const char *ocl = "2.0";
#   elif CL_VERSION_1_2
    const char *ocl = "1.2";
#   elif CL_VERSION_1_1
    const char *ocl = "1.1";
#   elif CL_VERSION_1_0
    const char *ocl = "1.0";
#   else
    const char *ocl = "0.0";
#   endif
    int length = snprintf(buf, sizeof buf, "OpenCL/%s ", ocl);
#   elif defined(XMRIG_NVIDIA_PROJECT)
    const int cudaVersion = cuda_get_runtime_version();
    int length = snprintf(buf, sizeof buf, "CUDA/%d.%d ", cudaVersion / 1000, cudaVersion % 100);
#   else
    memset(buf, 0, 16);

#   if !defined(XMRIG_NO_HTTPD) || !defined(XMRIG_NO_TLS)
    int length = 0;
#   endif
#   endif

#   if !defined(XMRIG_NO_TLS) && defined(OPENSSL_VERSION_TEXT)
    {
        constexpr const char *v = OPENSSL_VERSION_TEXT + 8;
        length += snprintf(buf + length, (sizeof buf) - length, "OpenSSL/%.*s ", static_cast<int>(strchr(v, ' ') - v), v);
    }
#   endif

#   ifndef XMRIG_NO_HTTPD
    length += snprintf(buf + length, (sizeof buf) - length, "microhttpd/%s ", MHD_get_version());
#   endif

    Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13slibuv/%s %s")
                              : " * %-13slibuv/%s %s",
                   "LIBS", uv_version_string(), buf);
}
Example #2
0
void xmrig::CommonConfig::printPools()
{
    for (size_t i = 0; i < m_activePools.size(); ++i) {
        if (!isColors()) {
            Log::i()->text(" * POOL #%-7zu%s variant=%s, TLS=%d",
                           i + 1,
                           m_activePools[i].url(),
                           m_activePools[i].algorithm().variantName(),
                           static_cast<int>(m_activePools[i].isTLS())
                           );
        }
        else {
            Log::i()->text(GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-7zu") "\x1B[1;%dm%s\x1B[0m variant " WHITE_BOLD("%s"),
                           i + 1,
                           m_activePools[i].isTLS() ? 32 : 36,
                           m_activePools[i].url(),
                           m_activePools[i].algorithm().variantName()
                           );
        }
    }

#   ifdef APP_DEBUG
    LOG_NOTICE("POOLS --------------------------------------------------------------------");
    for (const Pool &pool : m_activePools) {
        pool.print();
    }
    LOG_NOTICE("--------------------------------------------------------------------------");
#   endif
}
Example #3
0
static void print_api(xmrig::Controller *controller)
{
    const int port = controller->config()->apiPort();
    if (port == 0) {
        return;
    }

    Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") CYAN("%s:") CYAN_BOLD("%d")
                                                    : " * %-12s%s:%d",
                   "API BIND", controller->config()->isApiIPv6() ? "[::]" : "0.0.0.0", port);
}
Example #4
0
void xmrig::CommonConfig::printAPI()
{
#   ifndef XMRIG_NO_API
    if (apiPort() == 0) {
        return;
    }

    Log::i()->text(isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN("%s:") CYAN_BOLD("%d")
                              : " * %-13s%s:%d",
                   "API BIND", isApiIPv6() ? "[::]" : "0.0.0.0", apiPort());
#   endif
}
Example #5
0
static void print_commands(xmrig::Controller *controller)
{
    if (controller->config()->isColors()) {
        Log::i()->text(GREEN_BOLD(" * ") WHITE_BOLD("COMMANDS    ") MAGENTA_BOLD("h") WHITE_BOLD("ashrate, ")
                                                                    MAGENTA_BOLD("c") WHITE_BOLD("onnections, ")
                                                                    MAGENTA_BOLD("v") WHITE_BOLD("erbose, ")
                                                                    MAGENTA_BOLD("w") WHITE_BOLD("orkers"));
    }
    else {
        Log::i()->text(" * COMMANDS   'h' hashrate, 'c' connections, 'v' verbose, 'w' workers");
    }
}
Example #6
0
static void print_bind(xmrig::Controller *controller)
{
    const std::vector<Addr> &addrs = controller->config()->addrs();

    for (size_t i = 0; i < addrs.size(); ++i) {
        Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("BIND #%-6d") CYAN("%s%s%s:") CYAN_BOLD("%d")
                                                        : " * BIND #%-6d%s%s%s:%d",
                       i + 1,
                       addrs[i].isIPv6() ? "[" : "",
                       addrs[i].ip(),
                       addrs[i].isIPv6() ? "]" : "",
                       addrs[i].port());
    }
}
Example #7
0
static void print_versions(xmrig::Controller *controller)
{
    char buf[16] = { 0 };

#   if defined(__clang__)
    snprintf(buf, 16, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
#   elif defined(__GNUC__)
    snprintf(buf, 16, " gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#   elif defined(_MSC_VER)
    snprintf(buf, 16, " MSVC/%d", MSVC_VERSION);
#   else
    buf[0] = '\0';
#   endif

    Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") CYAN_BOLD("%s/%s") WHITE_BOLD(" libuv/%s%s")
                                                    : " * %-12s%s/%s libuv/%s%s",
                   "VERSIONS", APP_NAME, APP_VERSION, uv_version_string(), buf);
}
Example #8
0
void Summary::printPools(xmrig::Config *config)
{
    const std::vector<Pool> &pools = config->pools();

    for (size_t i = 0; i < pools.size(); ++i) {
        Log::i()->text(config->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("POOL #%-6zu") CYAN_BOLD("%s") " variant " WHITE_BOLD("%s")
                                          : " * POOL #%-6d%s variant %s",
                       i + 1,
                       pools[i].url(),
                       pools[i].algorithm().variantName()
                       );
    }

#   ifdef APP_DEBUG
    for (const Pool &pool : pools) {
        pool.print();
    }
#   endif
}
Example #9
0
static void print_algo(xmrig::Controller *controller)
{
    Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") MAGENTA_BOLD("%s")
                                                    : " * %-12s%s",
                   "ALGO", controller->config()->algorithm().name());
}
Example #10
0
static void print_mode(xmrig::Controller *controller)
{
    Log::i()->text(controller->config()->isColors() ? GREEN_BOLD(" * ") WHITE_BOLD("%-12s") MAGENTA_BOLD("%s")
                                                    : " * %-12s%s",
                   "MODE", controller->config()->modeName());
}