### Install Docker Source: https://github.com/bendr0id/xmrigcc/wiki/Docker-image Installs the Docker engine on Debian/Ubuntu-based systems. Ensure Docker is running before proceeding. ```bash sudo apt install docker.io ``` -------------------------------- ### Enable and Start XMRigCC Server Service Source: https://github.com/bendr0id/xmrigcc/wiki/Useful-scripts Commands to enable and start the xmrigCCServer.service using systemctl. ```bash systemctl enable xmrigCCServer.service systemctl start xmrigCCServer ``` -------------------------------- ### Start XMRigCC Server Source: https://github.com/bendr0id/xmrigcc/blob/master/README.md Basic command to start the XMRigCC server with specified port, user, password, and an access token for the CC server. ```bash xmrigServer --port=3344 --user=admin --pass=pass --token=SECRET_TOKEN_TO_ACCESS_CC_SERVER ``` -------------------------------- ### Enable and Start XMRig Daemon Service Source: https://github.com/bendr0id/xmrigcc/wiki/Useful-scripts Commands to enable and start the xmrigcc.service using systemctl. ```bash systemctl enable xmrigcc.service systemctl start xmrigcc.service ``` -------------------------------- ### Start XMRigCC Server Source: https://context7.com/bendr0id/xmrigcc/llms.txt Use these commands to start the XMRigCCServer with basic authentication, TLS encryption, or Telegram notifications. ```bash xmrigServer --port=3344 --user=admin --pass=pass --token=SECRET_TOKEN_TO_ACCESS_CC_SERVER ``` ```bash xmrigServer --port=3344 --user=admin --pass=secretpass --token=myAccessToken \ --tls --key-file=server.key --cert-file=server.pem ``` ```bash xmrigServer --port=3344 --user=admin --pass=pass --token=SECRET_TOKEN \ --telegram-bot-token=123456:ABC-TOKEN --telegram-chat-id=987654321 \ --push-miner-offline-info --push-miner-zero-hash-info ``` -------------------------------- ### Install RapidJSON with vcpkg Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/rapidjson/readme.md Use the vcpkg package manager to download and install RapidJSON with CMake integration. ```bash vcpkg install rapidjson ``` -------------------------------- ### Start XMRigDaemon with Remote Push Configuration Source: https://github.com/bendr0id/xmrigcc/blob/master/CHANGELOG.md This command allows starting xmrigDaemon with minimal parameters to remotely push the configuration. Requires CC-Server URL and token. ```bash ./xmrigDaemon --cc-url=ip:port --cc-token=yourSecretToken -c config.json ``` -------------------------------- ### Start XMRigCC Server with TLS Source: https://context7.com/bendr0id/xmrigcc/llms.txt Start the XMRigCC server with TLS encryption enabled. Ensure the key and certificate files are correctly specified. ```bash # Start server with TLS xmrigServer --port=3344 --user=admin --pass=pass --token=SECRET \ --tls --key-file=server.key --cert-file=server.pem ``` -------------------------------- ### Install RapidJSON System-Wide Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/rapidjson/readme.md Install the RapidJSON library to the system path using administrative privileges. This allows it to be found by other CMake projects. ```bash make install ``` -------------------------------- ### Create an HTTP Server with cpp-httplib Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/cpp-httplib/README.md Sets up a basic HTTP server that responds to GET requests. Include httplib.h and define your routes. ```cpp #include int main(void) { using namespace httplib; Server svr; svr.get("/hi", [](const Request& req, const Response& res) { res.set_content("Hello World!", "text/plain"); }); svr.get(R"(/numbers/(\d+))", [&](const Request& req, const Response& res) { auto numbers = req.matches[1]; res.set_content(numbers, "text/plain"); }); svr.listen("localhost", 1234); } ``` -------------------------------- ### XMRigCC Pool Configuration Example Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/ALGORITHMS.md Example of a pool configuration in JSON format for XMRigCC v3, specifying the mining algorithm. ```json { "pools": [ { "url": "...", "algo": "cn/r", "coin": null, ... } ], ... } ``` -------------------------------- ### Start XMRigDaemon Miner Source: https://context7.com/bendr0id/xmrigcc/llms.txt Commands to start the XMRigDaemon, connecting to mining pools and the CC server. Supports TLS, remote logging, CPU throttling, and huge pages. ```bash xmrigDaemon -o pool.hashvault.pro:5555 -u YOUR_WALLET -p x -k \ --cc-url=192.168.1.100:3344 --cc-access-token=SECRET_TOKEN_TO_ACCESS_CC_SERVER \ --cc-worker-id=rig01 ``` ```bash xmrigDaemon -o pool.supportxmr.com:443 --tls -u YOUR_WALLET -p worker1 \ --algo=rx/0 --cc-url=ccserver.example.com:3344 --cc-access-token=myToken \ --cc-worker-id=mainrig --cc-use-tls --cc-use-remote-logging ``` ```bash xmrigDaemon -o pool.example.com:3333 -u WALLET -p x \ --cpu-max-cpu-usage=75 --cpu-priority=2 --huge-pages \ --cc-url=localhost:3344 --cc-access-token=token123 ``` -------------------------------- ### Basic xmrigDaemon Example Source: https://github.com/bendr0id/xmrigcc/blob/master/README.md Demonstrates how to run xmrigDaemon with CC Server integration. Ensure you replace placeholders with your actual pool details, wallet address, CC Server IP, port, and secret token. ```bash xmrigDaemon -o pool.hashvault.pro:5555 -u YOUR_WALLET -p x -k --cc-url=IP_OF_CC_SERVER:PORT --cc-access-token=SECRET_TOKEN_TO_ACCESS_CC_SERVER --cc-worker-id=OPTIONAL_WORKER_NAME ``` -------------------------------- ### XMRig CPU Backend Configuration Example Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/CPU.md Demonstrates flexible CPU profile configuration, including exact algorithm matches, default failbacks, and custom profiles. Use this to define how XMRig should utilize CPU resources for different mining algorithms. ```json { "cpu": { "enabled": true, "huge-pages": true, "hw-aes": null, "priority": null, "asm": true, "rx/wow": [-1, -1, -1, -1], "cn": [ [1, 0], [1, 2] ], "cn-lite": [ [2, 0], [2, 2] ], "cn-pico": { "intensity": 2, "threads": 8, "affinity": -1 }, "custom-profile": [0, 2], "*": [-1], "cn/r": "custom-profile", "cn/0": false } } ``` -------------------------------- ### CPU Thread Configuration Example Source: https://context7.com/bendr0id/xmrigcc/llms.txt Configure CPU mining threads, including affinity, intensity, and algorithm-specific profiles. Set 'enabled' to true to activate CPU mining. ```json { "cpu": { "enabled": true, "huge-pages": true, "hw-aes": null, "priority": 2, "asm": "ryzen", "max-cpu-usage": 80, "argon2-impl": null, "rx/0": [0, 2, 4, 6], "rx/wow": [-1, -1, -1, -1], "cn": [ [1, 0], [1, 2], [1, 4], [1, 6] ], "cn-lite": [ [2, 0], [2, 2] ], "cn-pico": { "intensity": 2, "threads": 8, "affinity": -1 }, "*": [-1], "cn/0": false }, "randomx": { "init": -1, "init-avx2": -1, "mode": "fast", "1gb-pages": true, "wrmsr": true, "rdmsr": true, "cache_qos": true, "numa": true } } ``` -------------------------------- ### Print to stdout with fmt Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/fmt/README.rst Use fmt::print to output formatted strings directly to the console. This is a basic example demonstrating the core printing functionality. ```c++ #include int main() { fmt::print("Hello, world!\n"); } ``` -------------------------------- ### Algorithm Configuration for Monero (rx/0) Source: https://context7.com/bendr0id/xmrigcc/llms.txt Configure mining for Monero using the rx/0 algorithm. This example includes TLS enabled for the pool connection. ```json { "pools": [ { "url": "pool.supportxmr.com:443", "user": "WALLET", "pass": "x", "algo": "rx/0", "coin": "monero", "tls": true, "keepalive": true } ``` -------------------------------- ### XMRigCCServer Configuration Source: https://context7.com/bendr0id/xmrigcc/llms.txt This JSON configuration file allows for detailed setup of the XMRigCCServer, including notifications and TLS settings. ```json { "background": false, "colors": true, "log-file": "/var/log/xmrigcc-server.log", "syslog": false, "bind-ip": "0.0.0.0", "port": 3344, "user": "admin", "pass": "securepassword", "access-token": "mySecretToken", "use-tls": true, "cert-file": "server.pem", "key-file": "server.key", "client-config-folder": "/etc/xmrigcc/configs", "client-log-lines-history": 1000, "custom-dashboard": "index.html", "pushover-user-key": "your_pushover_user_key", "pushover-api-token": "your_pushover_api_token", "telegram-bot-token": "123456789:ABCDEF-your-bot-token", "telegram-chat-id": "987654321", "push-miner-offline-info": true, "push-miner-zero-hash-info": true, "push-periodic-mining-status": true } ``` -------------------------------- ### Configure XMRigCC Docker Container Source: https://github.com/bendr0id/xmrigcc/wiki/Docker-image Example command to run the XMRigCC Docker container with specific mining parameters, including algorithm, pool, TLS, wallet ID, and connection details for the CC server. ```bash docker run bendr0id/xmrigcc -a cryptonight -o donate2.graef.in:443 --tls -u YOUR_WALLET_ID -p x -k --cc-url=IP_OF_CC_SERVER:PORT --cc-access-token=SECRET_TOKEN_TO_ACCESS_CC_SERVER ``` -------------------------------- ### Configure XMRig HTTP API Settings Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/API.md Example JSON configuration for enabling and setting up the HTTP API. Ensure the miner is built with HTTP support. ```json "api": { "id": null, "worker-id": null, }, "http": { "enabled": false, "host": "127.0.0.1", "port": 0, "access-token": null, "restricted": true } ``` -------------------------------- ### Format string with fmt Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/fmt/README.rst Use fmt::format to create a std::string with formatted content. This example shows basic integer formatting. ```c++ std::string s = fmt::format("The answer is {}.", 42); // s == "The answer is 42." ``` -------------------------------- ### Enable SSL Support in cpp-httplib Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/cpp-httplib/README.md To enable SSL support, define CPPHTTPLIB_OPENSSL_SUPPORT and link against libssl and libcrypto. This example shows the definitions for SSL server and client. ```cpp #define CPPHTTPLIB_OPENSSL_SUPPORT SSLServer svr("./cert.pem", "./key.pem"); SSLClient cli("localhost", 8080); ``` -------------------------------- ### Configure Huge Pages (Linux) Source: https://github.com/bendr0id/xmrigcc/wiki/Common-issues Before starting XMRigDaemon on Linux, set the number of huge pages. This involves modifying the sysctl configuration and applying the changes. ```bash sudo echo 'vm.nr_hugepages=128' >> /etc/sysctl.conf sudo sysctl -p ``` -------------------------------- ### Get Client Configuration Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the current configuration for a specific client. Falls back to default config if none is set. ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientConfig?clientId=TestClient ``` ```text { "a client config in json format" } ``` -------------------------------- ### XMRigDaemon Configuration Example Source: https://github.com/bendr0id/xmrigcc/wiki/Config-XMRigDaemon This JSON configuration is for the XMRigDaemon miner. It includes settings for API, HTTP access, CPU optimization, and pool connections. Ensure 'cc-client.enabled' is true to connect to XMRigCCServer. ```json { "api": { "id": null, "worker-id": null }, "http": { "enabled": false, "host": "127.0.0.1", "port": 0, "access-token": null, "restricted": true }, "autosave": true, "version": 1, "background": false, "colors": true, "randomx": { "init": -1, "numa": true }, "cpu": { "enabled": true, "huge-pages": true, "hw-aes": null, "priority": null, "asm": true, "argon2-impl": null, "cn/0": false, "cn-lite/0": false }, "donate-level": 5, "log-file": null, "pools": [ { "algo": null, "coin": null, "url": "donate.graef.in:80", "user": "YOUR_WALLET_ADDRESS", "pass": "x", "rig-id": null, "nicehash": false, "keepalive": false, "enabled": true, "tls": false, "tls-fingerprint": null, "daemon": false } ], "cc-client": { "enabled" : true, "url": "localhost:3344", "use-tls" : false, "access-token": "mySecret", "worker-id": null, "update-interval-s": 10, "use-remote-logging" : true, "upload-config-on-start" : true }, "print-time": 60, "retries": 5, "retry-pause": 5, "syslog": false, "user-agent": null, "watch": true } ``` -------------------------------- ### C printf Formatting Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/fmt/README.rst Shows equivalent formatting to the C++ iostreams example using the C standard library's printf function. This is a common alternative for formatted output. ```c++ printf("%.2f\n", 1.23456); ``` -------------------------------- ### Troubleshoot Out of Memory During Benchmark Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/RISCV_PERF_TUNING.md Address out-of-memory errors during benchmarking by using light mode, reducing mining threads, or freeing up system memory. Always check available memory before starting. ```bash --randomx-mode=light ``` ```bash --threads=1 ``` ```bash free -h ``` -------------------------------- ### Configure Build with QMake Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/argon2/README.md Prepare the build environment using QMake. Navigate to the 'qmake' directory and specify architecture and configuration options. ```bash cd qmake qmake ARCH=... CONFIG+=... make ``` -------------------------------- ### Create Options Instance Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/cxxopts/README.md Instantiate the cxxopts::Options object with the program name and a one-line description. ```cpp cxxopts::Options options("MyProgram", "One line description of MyProgram"); ``` -------------------------------- ### Create an HTTP Client with cpp-httplib Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/cpp-httplib/README.md Demonstrates how to create an HTTP client to send requests to a server. Ensure the server is running and accessible. ```cpp #include #include int main(void) { httplib::Client cli("localhost", 1234); auto res = cli.get("/hi"); if (res && res->status == 200) { std::cout << res->body << std::endl; } } ``` -------------------------------- ### Configure Build with Autotools Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/argon2/README.md Prepare the build environment using GNU autotools. Run these commands in the project root. ```bash autoreconf -i ./configure ``` -------------------------------- ### GET / Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the defined Dashboard. ```APIDOC ## GET / ### Description Retrieves the defined Dashboard. ### Method GET ### Endpoint / ### Response #### Success Response (200) - The response body contains the dashboard definition. ``` -------------------------------- ### GET /1/threads Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/API.md Retrieves detailed information about each mining thread. ```APIDOC ## GET /1/threads ### Description Get detailed information about miner threads. ### Method GET ### Endpoint /1/threads ### Response #### Success Response (200) - **data** (array) - An array of objects, where each object represents a mining thread. - **id** (integer) - The ID of the thread. - **numa** (integer) - The NUMA node the thread is associated with. - **midstate** (boolean) - Indicates if midstate is used. - **speed** (array) - Hashrate information for the thread. - **[0]** (number) - Current hashrate. - **[1]** (number) - Highest hashrate. - **hashrate** (number) - Average hashrate for the thread. - **sm_mult** (number) - Multiplier for shared memory. - **active** (boolean) - Indicates if the thread is active. - **cpu_threads** (integer) - Number of CPU threads utilized by this thread. ### Response Example ```json { "id": null, "data": [ { "id": 0, "numa": 0, "midstate": true, "speed": [ 61728394, 65000000 ], "hashrate": 62000000, "sm_mult": 1.0, "active": true, "cpu_threads": 4 }, { "id": 1, "numa": 1, "midstate": true, "speed": [ 61728395, 65000001 ], "hashrate": 62000001, "sm_mult": 1.0, "active": true, "cpu_threads": 4 } ] } ``` ``` -------------------------------- ### GET /admin/getClientCommand Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the current command set for a specific client. ```APIDOC ## GET /admin/getClientCommand ### Description Retrieves the current command set for a specific client. ### Method GET ### Endpoint /admin/getClientCommand ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientCommand?clientId=TestClient ``` ### Response #### Success Response (200) - **control_command** (object) - **command** (string) - The command to be executed by the client (e.g., START, STOP, RESTART, UPDATE_CONFIG, SHUTDOWN). #### Response Example ```json { "control_command": { "command": "START" } } ``` ``` -------------------------------- ### Clone and Build Format Benchmarks Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/fmt/README.rst Clone the format-benchmark repository and generate Makefiles using CMake to prepare for running benchmarks. ```bash git clone --recursive https://github.com/fmtlib/format-benchmark.git cd format-benchmark cmake . ``` -------------------------------- ### GET /admin/getClientStatusList Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves a list of the current status for all connected clients. ```APIDOC ## GET /admin/getClientStatusList ### Description Retrieves a list of the current status for all connected clients. ### Method GET ### Endpoint /admin/getClientStatusList ### Request Example ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientStatusList ``` ### Response #### Success Response (200) - **client_status_list** (array) - A list of client status objects. - **client_status** (object) - Contains the status details for a single client. - **client_id** (string) - The unique identifier for the client. - **current_pool** (string) - The current mining pool the client is connected to. - **current_status** (string) - The current operational status of the client (e.g., RUNNING, STOPPED). - **hashrate_short** (number) - Short-term average hashrate. - **hashrate_medium** (number) - Medium-term average hashrate. - **hashrate_long** (number) - Long-term average hashrate. - **hashrate_highest** (number) - The highest recorded hashrate. - **avg_time** (number) - Average time in seconds. - **shares_good** (number) - Number of valid shares submitted. - **shares_total** (number) - Total number of shares submitted. - **hashes_total** (number) - Total number of hashes performed. - **last_status_update** (number) - Timestamp of the last status update. #### Response Example ```json { "client_status_list": [ { "client_status": { "client_id": "TestClient", "current_pool": "", "current_status": "RUNNING", "hashrate_short": 0, "hashrate_medium": 0, "hashrate_long": 0, "hashrate_highest": 0, "avg_time": 0, "shares_good": 0, "shares_total": 0, "hashes_total": 0, "last_status_update": 1508526287 } } ] } ``` ``` -------------------------------- ### GET /1/summary Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/API.md Retrieves a summary of the miner's current status and statistics. ```APIDOC ## GET /1/summary ### Description Get miner summary information. ### Method GET ### Endpoint /1/summary ### Response #### Success Response (200) - **data** (object) - Contains summary statistics. - **version** (string) - Miner version. - **hashrate** (object) - Current hashrate information. - **total** (array) - Array of hashrates for all threads. - **[0]** (number) - Hashrate value. - **highest** (array) - Highest recorded hashrates. - **[0]** (number) - Highest hashrate value. - **results** (object) - Mining results. - **shares_good** (integer) - Number of accepted shares. - **shares_error** (integer) - Number of rejected shares. - **avg_time** (number) - Average time in seconds. - **difficulty** (number) - Current difficulty. - **connections** (object) - Network connection details. - **active** (integer) - Number of active connections. - **uptime** (integer) - Miner uptime in seconds. - **pow_algo** (string) - The algorithm currently being used. - **current_template** (string) - The current mining template. - **cpu_threads** (integer) - Number of CPU threads used. ### Response Example ```json { "id": null, "version": "2.17.0", "hashrate": { "total": [ 123456789 ], "highest": [ 130000000 ] }, "results": { "shares_good": 1500, "shares_error": 5, "avg_time": 60.5, "difficulty": 10000000 }, "connections": { "active": 1 }, "uptime": 3600, "pow_algo": "ghostrider", "current_template": "0000000000000000000000000000000000000000000000000000000000000000", "cpu_threads": 8 } ``` ``` -------------------------------- ### GET /admin/getClientLog Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the client log for a specific client stored on the server. ```APIDOC ## GET /admin/getClientLog ### Description Retrieves the client log for a specific client stored on the server. The number of maximum stored log lines per miner can be configured in the XMRigCCServer config or via command-line parameter. ### Method GET ### Endpoint /admin/getClientLog ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientLog?clientId=TestClient ``` ### Response #### Success Response (200) - **client_log** (string) - A string containing log entries, delimited by newline characters (`\n`). #### Response Example ```json {"client_log":"n-rows of client log delimited by \n"} ``` ``` -------------------------------- ### Configure Build with CMake Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/argon2/README.md Prepare the build environment using CMake. Specify the build type for optimization. ```bash cmake -DCMAKE_BUILD_TYPE=Release . ``` -------------------------------- ### Get Client Command Source: https://context7.com/bendr0id/xmrigcc/llms.txt Retrieves the current pending command for a specific miner client. ```APIDOC ## GET /admin/getClientCommand ### Description Retrieves the current pending command for a specific miner client. ### Method GET ### Endpoint /admin/getClientCommand ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```bash curl -H "Content-Type: application/json" \ -X GET "http://admin:pass@127.0.0.1:3344/admin/getClientCommand?clientId=rig01" ``` ### Response #### Success Response (200) - **control_command** (object) - Contains the command details. - **command** (string) - The command to be executed (e.g., START, STOP, RESTART, UPDATE_CONFIG, SHUTDOWN, REBOOT). #### Response Example ```json { "control_command": { "command": "START" } } ``` ``` -------------------------------- ### GET /1/config Source: https://github.com/bendr0id/xmrigcc/blob/master/doc/API.md Retrieves the current configuration of the miner. This endpoint is restricted and requires an access token. ```APIDOC ## GET /1/config ### Description Get current miner configuration. This endpoint is restricted and requires an access token and `"restricted": false` in the HTTP configuration. ### Method GET ### Endpoint /1/config ### Response #### Success Response (200) - **data** (object) - The current miner configuration object. ### Response Example ```json { "id": null, "api": { "id": null, "worker-id": null }, "http": { "enabled": true, "host": "0.0.0.0", "port": 44444, "access-token": "SECRET", "restricted": false }, "mining": { "auto-mine": true, "pool": { "algo": "ghostrider", "coin": null, "url": "stratum+tcp://pool.example.com:3333", "user": "user.worker", "pass": "x", "rig-id": null, "donate-level": 1, "donate-only": false, "tls": false, "tls-fingerprint": null, "daemon": false, "socks5": null, "socks5-user": null, "socks5-pass": null }, "params": null, "threads": 8, "huge-pages": true, "priority": 1, "max-threads-hint": null, "log-file": null, "asm": true, "yield": true, "force-ipv4": false, "donate-interval": 60, "donate-over-proxy": false } } ``` ``` -------------------------------- ### Get Client Log Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the log for a specific client. The number of lines is configurable on the server. ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientLog?clientId=TestClient ``` ```text {"client_log":"n-rows of client log delimited by \n"} ``` -------------------------------- ### Run Format Benchmarks Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/fmt/README.rst Execute the speed test or bloat test for the format-benchmark suite after building. ```bash make speed-test ``` ```bash make bloat-test ``` -------------------------------- ### Get Client Log Source: https://context7.com/bendr0id/xmrigcc/llms.txt Retrieves the remote log history for a specific miner stored on the CC server. ```APIDOC ## GET /admin/getClientLog ### Description Retrieves the remote log history for a specific miner stored on the CC server. ### Method GET ### Endpoint /admin/getClientLog ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```bash curl -H "Content-Type: application/json" \ -X GET "http://admin:pass@127.0.0.1:3344/admin/getClientLog?clientId=rig01" ``` ### Response #### Success Response (200) - **client_log** (string) - The log history for the specified client. #### Response Example ```json { "client_log": "[2023-11-13 10:15:32] speed 10s/60s/15m 4520.5 4485.2 4490.0 H/s max 4612.3 H/s\n[2023-11-13 10:15:32] accepted (156/158) diff 50000 (42 ms)\n..." } ``` ``` -------------------------------- ### Get Client Configuration Source: https://context7.com/bendr0id/xmrigcc/llms.txt Retrieves the current configuration for a specific miner, or the default configuration if no client-specific config exists. ```APIDOC ## GET /admin/getClientConfig ### Description Retrieves the current configuration for a specific miner, or the default configuration if no client-specific config exists. ### Method GET ### Endpoint /admin/getClientConfig ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```bash curl -H "Content-Type: application/json" \ -X GET "http://admin:pass@127.0.0.1:3344/admin/getClientConfig?clientId=rig01" ``` ### Response #### Success Response (200) - The response body contains the full miner JSON configuration. #### Response Example ```json { "pools": [...], "cpu": {...}, "cc-client": {...}, ... } ``` ``` -------------------------------- ### GET /admin/getClientConfig Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the current configuration for a specific client. If no client-specific configuration exists, it returns the default configuration. ```APIDOC ## GET /admin/getClientConfig ### Description Retrieves the current configuration for a specific client. If no client-specific configuration exists, it returns the default configuration. ### Method GET ### Endpoint /admin/getClientConfig ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Example ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientConfig?clientId=TestClient ``` ### Response #### Success Response (200) - The response body contains the client's configuration in JSON format. ``` -------------------------------- ### Initialize and Execute llhttp Parser Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/llhttp/README.md Initializes the llhttp parser with user-defined settings and executes it to parse an HTTP request. Ensure llhttp.h is included and settings are properly initialized. ```C #include "llhttp.h" llhttp_t parser; llhttp_settings_t settings; /* Initialize user callbacks and settings */ llhttp_settings_init(&settings); /* Set user callback */ settings.on_message_complete = handle_on_message_complete; /* Initialize the parser in HTTP_BOTH mode, meaning that it will select between * HTTP_REQUEST and HTTP_RESPONSE parsing automatically while reading the first * input. */ llhttp_init(&parser, HTTP_BOTH, &settings); /* Parse request! */ const char* request = "GET / HTTP/1.1\r\n\r\n"; int request_len = strlen(request); enum llhttp_errno err = llhttp_execute(&parser, request, request_len); if (err == HPE_OK) { /* Successfully parsed! */ } else { fprintf(stderr, "Parse error: %s %s\n", llhttp_errno_name(err), parser.reason); } ``` -------------------------------- ### Initialize Hashrate and Miner Charts Source: https://github.com/bendr0id/xmrigcc/blob/master/index.html Initializes Chart.js instances for displaying hashrate and miner counts over time. Includes custom legend generation for average hashrate and a plugin to display 'No data' when charts are empty. ```javascript let hashrateChart = new Chart(document.getElementById("hashrateChart").getContext("2d"), { type: "line", data: { datasets: [] }, options: { title: { display: true, text: 'Hashrates' }, tooltips: { mode: 'nearest', intersect: false, }, legend: { display: true, position: 'top', labels: { generateLabels: function (chart) { let data = chart.data; return Chart.helpers.isArray(data.datasets) ? data.datasets.map(function (dataset, i) { let total = 0; dataset.data.forEach(item => { total += item.y; }); let avg = (dataset.data.length > 0) ? (total / dataset.data.length).toFixed(2) : 0; return { text: dataset.label + " (avg.: " + avg + " h/s)", fillStyle: (!Chart.helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]), hidden: !chart.isDatasetVisible(i), lineCap: dataset.borderCapStyle, lineDash: dataset.borderDash, lineDashOffset: dataset.borderDashOffset, lineJoin: dataset.borderJoinStyle, lineWidth: dataset.borderWidth, strokeStyle: dataset.borderColor, pointStyle: dataset.pointStyle, // Below is extra data used for toggling the datasets datasetIndex: i }; }, this) : [] }, }, }, scales: { yAxes: [ { id: 'hashrate', position: 'left', scalePositionLeft: true, stacked: false, ticks: { beginAtZero: true }, scaleLabel: { display: true, labelString: 'Hashrate', fontSize: 16 } } ], xAxes: [{ type: 'time', distribution: 'series', time: { unit: 'minute', displayFormats: { minute: 'HH:mm' } }, ticks: { stepSize: 10, autoSkip: true, maxTicksLimit: 60 } }] }, elements: { point: { radius: 0 } }, responsive: true, maintainAspectRatio: false }, plugins: { colorschemes: { scheme: 'brewer.Paired12' } } }); let minerChart = new Chart(document.getElementById("minerChart").getContext("2d"), { type: "line", data: { datasets: [] }, options: { title: { display: true, text: 'Miners' }, tooltips: { mode: 'nearest', intersect: false, }, scales: { yAxes: [ { id: 'miner', position: 'left', scalePositionLeft: true, stacked: false, ticks: { beginAtZero: true, callback: function (value) { if (value % 1 === 0) { return value; } } }, scaleLabel: { display: true, labelString: 'Miner', fontSize: 16 } } ], xAxes: [{ type: 'time', distribution: 'series', time: { unit: 'minute', displayFormats: { minute: 'HH:mm' } }, ticks: { stepSize: 10, autoSkip: true, maxTicksLimit: 60 } }] }, elements: { point: { radius: 0 } }, responsive: true, maintainAspectRatio: false }, plugins: { colorschemes: { scheme: 'brewer.Paired12' } } }); Chart.plugins.register({ afterDraw: function (chart) { if (chart.data.datasets.length === 0) { // No data is present let ctx = chart.chart.ctx; let width = chart.chart.width; let height = chart.chart.height ctx.save(); ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.font = "16px normal 'Helvetica Nueue'"; ctx.fillText('No data to display', width / 2, height / 2); ctx.restore(); } } }); updateCharts(hashrateChart, minerChart); setInterval(function () { table.ajax.reload(null, false); }, RELOAD_INTERVAL_IN_MS); setInterval(function () { updateCharts(hashrateChart, minerChart); }, CHART_RELOAD_INTERVAL_IN_MS); }); ``` -------------------------------- ### Get Client Command Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves the current command set for a specific client. Use this to check pending operations. ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientCommand?clientId=TestClient ``` ```json { "control_command": { "command": "START" } } ``` -------------------------------- ### Get Client Status List Source: https://github.com/bendr0id/xmrigcc/wiki/XMRigCCServer-API Retrieves a list of all connected clients and their current status. Requires admin credentials. ```curl curl -H "Content-Type: application/json" -X GET http://admin:pass@127.0.0.1:3344/admin/getClientStatusList ``` ```json { "client_status_list": [ { "client_status": { "client_id": "TestClient", "current_pool": "", "current_status": "RUNNING", "hashrate_short": 0, "hashrate_medium": 0, "hashrate_long": 0, "hashrate_highest": 0, "avg_time": 0, "shares_good": 0, "shares_total": 0, "hashes_total": 0, "last_status_update": 1508526287 } } ] } ``` -------------------------------- ### Initialize Git Submodules Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/rapidjson/readme.md Update the project to include third-party submodules, such as Google Test, required for building and testing. ```bash git submodule update --init ``` -------------------------------- ### Docker Deployment Source: https://context7.com/bendr0id/xmrigcc/llms.txt Instructions for deploying XMRigCC using Docker containers. ```APIDOC ## Docker Deployment ### Description Provides commands to pull and run the official XMRigCC Docker image, including options for custom configuration files and running the CC Server. ### Running Miner Container ```bash docker run bendr0id/xmrigcc \ -o pool.supportxmr.com:443 --tls \ -u YOUR_WALLET_ADDRESS -p worker1 -k \ --cc-url=192.168.1.100:3344 \ --cc-access-token=SECRET_TOKEN \ --cc-worker-id=docker-rig01 ``` ### Running with Custom Configuration ```bash docker run -v /path/to/config.json:/config.json \ bendr0id/xmrigcc -c /config.json ``` ### Running CC Server in Docker ```bash docker run -p 3344:3344 -v /path/to/config_cc.json:/config_cc.json \ bendr0id/xmrigcc-server -c /config_cc.json ``` ``` -------------------------------- ### Set Client Command Source: https://context7.com/bendr0id/xmrigcc/llms.txt Sends a control command to a specific miner to start, stop, restart, update configuration, or shutdown. ```APIDOC ## POST /admin/setClientCommand ### Description Sends a control command to a specific miner to start, stop, restart, update configuration, or shutdown. ### Method POST ### Endpoint /admin/setClientCommand ### Query Parameters - **clientId** (string) - Required - The unique identifier of the client. ### Request Body - **control_command** (object) - Required - Contains the command to be sent. - **command** (string) - Required - The command to execute. Possible values: START, STOP, RESTART, UPDATE_CONFIG, SHUTDOWN, REBOOT. ### Request Example ```json { "control_command": { "command": "STOP" } } ``` ### Example Usage (curl) ```bash # Stop a specific miner curl -H "Content-Type: application/json" \ -X POST -d '{"control_command":{"command":"STOP"}}' \ "http://admin:pass@127.0.0.1:3344/admin/setClientCommand?clientId=rig01" # Restart a specific miner curl -H "Content-Type: application/json" \ -X POST -d '{"control_command":{"command":"RESTART"}}' \ "http://admin:pass@127.0.0.1:3344/admin/setClientCommand?clientId=rig01" # Trigger configuration update on miner curl -H "Content-Type: application/json" \ -X POST -d '{"control_command":{"command":"UPDATE_CONFIG"}}' \ "http://admin:pass@127.0.0.1:3344/admin/setClientCommand?clientId=rig01" # Shutdown the miner completely curl -H "Content-Type: application/json" \ -X POST -d '{"control_command":{"command":"SHUTDOWN"}}' \ "http://admin:pass@127.0.0.1:3344/admin/setClientCommand?clientId=rig01" # Reboot the miner machine (requires --cc-reboot-cmd configured) curl -H "Content-Type: application/json" \ -X POST -d '{"control_command":{"command":"REBOOT"}}' \ "http://admin:pass@127.0.0.1:3344/admin/setClientCommand?clientId=rig01" ``` ### Response (No specific success response body is detailed in the source, typically an empty 200 OK or a confirmation message.) ``` -------------------------------- ### Configure Build with CMake Source: https://github.com/bendr0id/xmrigcc/blob/master/src/3rdparty/rapidjson/readme.md Configure the build environment for RapidJSON using CMake. This step prepares the build system for compilation. ```bash cmake .. ``` -------------------------------- ### Get Client Status List Source: https://context7.com/bendr0id/xmrigcc/llms.txt Retrieves the status of all connected miners including hashrate, shares, and current pool information. ```APIDOC ## GET /admin/getClientStatusList ### Description Retrieves the status of all connected miners including hashrate, shares, and current pool information. ### Method GET ### Endpoint /admin/getClientStatusList ### Request Example ```bash curl -H "Content-Type: application/json" \ -X GET "http://admin:pass@127.0.0.1:3344/admin/getClientStatusList" ``` ### Response #### Success Response (200) - **client_status_list** (array) - A list of client status objects. - **client_status** (object) - Contains detailed status for a single client. - **client_id** (string) - The unique identifier for the client. - **current_pool** (string) - The pool the client is currently connected to. - **current_status** (string) - The current operational status (e.g., RUNNING, STOPPED). - **hashrate_short** (number) - Short-term average hashrate. - **hashrate_medium** (number) - Medium-term average hashrate. - **hashrate_long** (number) - Long-term average hashrate. - **hashrate_highest** (number) - The highest recorded hashrate. - **avg_time** (number) - Average time in ms for shares. - **shares_good** (number) - Number of accepted shares. - **shares_total** (number) - Total number of shares submitted. - **hashes_total** (number) - Total number of hashes processed. - **last_status_update** (number) - Timestamp of the last status update. #### Response Example ```json { "client_status_list": [ { "client_status": { "client_id": "rig01", "current_pool": "pool.supportxmr.com:443", "current_status": "RUNNING", "hashrate_short": 4520.5, "hashrate_medium": 4485.2, "hashrate_long": 4490.0, "hashrate_highest": 4612.3, "avg_time": 42, "shares_good": 156, "shares_total": 158, "hashes_total": 1842956, "last_status_update": 1699876543 } } ] } ``` ``` -------------------------------- ### Get Current Command for a Specific Client Source: https://context7.com/bendr0id/xmrigcc/llms.txt Retrieves the current pending command for a specific miner client. Requires authentication. ```bash # Get current command for a specific client curl -H "Content-Type: application/json" \ -X GET "http://admin:pass@127.0.0.1:3344/admin/getClientCommand?clientId=rig01" ```