Worker Deployment
Workers are the compute nodes that run prime searches. They connect to a coordinator, claim work blocks, run sieves and primality tests, and report results. Each worker can handle any of the 12 prime forms.
Prerequisites
- Rust toolchain (1.75+)
- GMP library
- Network access to the coordinator
1. Build from source
# Install dependencies
# macOS: brew install gmp rust
# Linux: sudo apt install build-essential libgmp-dev m4
git clone https://github.com/darkreach-ai/darkreach.git
cd darkreach
cargo build --release2. Run a worker
Point the worker at your coordinator and specify a search form with its parameters.
# Connect to a coordinator and start searching
./target/release/darkreach \
--coordinator http://COORDINATOR:7001 \
--worker-id my-worker \
--checkpoint darkreach.checkpoint \
kbn --k 3 --base 2 --min-n 100000 --max-n 500000The worker will register with the coordinator, appear in the fleet dashboard, and start claiming work blocks automatically.
3. Verify heartbeat
Once the worker is running, verify it appears in the coordinator dashboard under the Fleet tab. Workers send heartbeats every 30 seconds. You can also check the coordinator logs for registration events.
4. Scaling with systemd
Use systemd template units to run multiple worker instances on the same machine. Each instance gets its own checkpoint file and worker ID.
[Unit]
Description=Darkreach Worker (%i)
After=network.target
[Service]
Type=simple
EnvironmentFile=/opt/darkreach/.env
ExecStart=/usr/local/bin/darkreach \
--coordinator http://COORDINATOR:7001 \
--worker-id %H-%i \
--checkpoint /opt/darkreach/darkreach-%i.checkpoint \
kbn --k 3 --base 2 --min-n 1000 --max-n 100000
WorkingDirectory=/opt/darkreach
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetDeploy and scale:
# Install worker template
sudo cp deploy/darkreach-worker@.service /etc/systemd/system/
sudo systemctl daemon-reload
# Start 4 worker instances
sudo systemctl enable --now darkreach-worker@{1..4}
# Check status
sudo systemctl status 'darkreach-worker@*'Monitoring
Worker status, throughput, and prime discoveries are visible in the dashboard. The Fleet tab shows all connected workers with their current search form, candidates tested, and last heartbeat time.