From b035a497fcf88c2e1112b94a56a3dea2d0e5fb78 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Wed, 10 Sep 2025 19:45:06 +0800 Subject: [PATCH] chore: replace references to deprecated --num-cores flag with --workers --- README.md | 13 ++++++------- src/lib.rs | 4 ++-- src/main.rs | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1a1564b..fe3e9d4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # External Miner Service for Quantus Network -Note: This repository is now a Cargo workspace. Build and run the CLI with (the --num-cores flag remains available as an alias for --cores): +Note: This repository is now a Cargo workspace. Build and run the CLI with: - cargo build -p miner-cli --release -- cargo run -p miner-cli -- --port 9833 [--metrics-port 9900] [--cores N] +- cargo run -p miner-cli -- --port 9833 [--metrics-port 9900] [--workers N] This crate provides an external mining service that can be used with a Quantus Network node. It exposes an HTTP API for managing mining jobs. @@ -30,7 +30,7 @@ The service can be configured using command-line arguments or environment variab Example: ```bash -# Run on the default port 9833 with all available cores +# Run on the default port 9833 using about half of total cpu resources ../target/release/quantus-miner # Run on a custom port with 4 workers (logical CPUs) @@ -58,15 +58,14 @@ RUST_LOG=info,miner=debug ../target/release/quantus-miner --workers 4 ``` -The service will start and log messages to the console, indicating the port it's listening on and the number of cores -it's using. +The service will start and log messages to the console, indicating the port it's listening on and the number of worker threads in use. Example output: ``` INFO external_miner > Starting external miner service... INFO external_miner > Using auto-detected workers (leaving headroom): 4 -INFO external_miner > Server starting on 0.0.0.0:9833 +INFO external_miner > Server starting on 0.0.0.0:9833 ``` ## API Specification @@ -91,4 +90,4 @@ The miner previously used a flag named `--num-cores`. To better reflect intent, These documents provide reviewers with the authoritative context for changes. Commits and pull requests should link to the relevant prompt/response entry. -- Authoring/process guide: agents.md \ No newline at end of file +- Authoring/process guide: agents.md diff --git a/src/lib.rs b/src/lib.rs index 34d5dd8..eeec52e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ Use the new workspace crates instead of the old root library: - Examples: - cargo run -p miner-cli -- --port 9833 - cargo run -p miner-cli -- --port 9833 --metrics-port 9900 - - cargo run -p miner-cli -- --num-cores 4 + - cargo run -p miner-cli -- --workers 4 - crates/miner-service - The service layer: HTTP API (compatible with the node), job orchestration, @@ -44,5 +44,5 @@ Notes: - Build the binary via the new CLI package: cargo build -p miner-cli --release - Run the service: - cargo run -p miner-cli -- --port 9833 [--metrics-port 9900] [--num-cores N] + cargo run -p miner-cli -- --port 9833 [--metrics-port 9900] [--workers N] */ diff --git a/src/main.rs b/src/main.rs index b0a1f26..b4b0f6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ Run the external miner using the new CLI binary: Examples: - cargo run -p miner-cli -- --port 9833 - cargo run -p miner-cli -- --port 9833 --metrics-port 9900 - - cargo run -p miner-cli -- --num-cores 4 + - cargo run -p miner-cli -- --workers 4 See crates/miner-cli for the active entrypoint and crates/miner-service for the service layer. */ @@ -27,7 +27,7 @@ fn main() { Examples:\n\ - cargo run -p miner-cli -- --port 9833\n\ - cargo run -p miner-cli -- --port 9833 --metrics-port 9900\n\ - - cargo run -p miner-cli -- --num-cores 4\n" + - cargo run -p miner-cli -- --workers 4\n" ); std::process::exit(1); }