Getting Started

This guide walks you through installing darkreach, running your first prime search, joining the network, and viewing results in the dashboard.

Prerequisites

  • Rust 1.75 or later — rustup.rs
  • GMP (GNU Multiple Precision Arithmetic Library)

macOS

bash
brew install gmp

Linux (Debian/Ubuntu)

bash
sudo apt install build-essential libgmp-dev m4

Build

bash
git clone https://github.com/darkreach-ai/darkreach.git
cd darkreach
cargo build --release

The binary will be at ./target/release/darkreach.

Run Your First Search

Try a quick factorial prime search to verify everything works:

bash
./target/release/darkreach factorial --start 1 --end 100

You should see output on stderr as candidates are sieved, filtered, and tested, with any primes logged to the console.

More search examples

bash
# Proth primes k·2^n+1
./target/release/darkreach kbn --k 3 --base 2 --min-n 1 --max-n 1000

# Palindromic primes in base 10
./target/release/darkreach palindromic --base 10 --min-digits 1 --max-digits 9

# Twin primes
./target/release/darkreach twin --k 3 --base 2 --min-n 1 --max-n 10000

# Sophie Germain primes
./target/release/darkreach sophie-germain --k 3 --base 2 --min-n 1 --max-n 10000

# Primorial primes
./target/release/darkreach primorial --start 1000 --end 50000

Connect to a Database

To persist discoveries and see them in the dashboard, provide a PostgreSQL connection:

bash
export DATABASE_URL="postgres://user:pass@localhost/darkreach"
./target/release/darkreach factorial --start 1000 --end 5000

Results will be stored in the primes table and visible in the dashboard.

Join the Network

Instead of running standalone searches, you can join the distributed network to contribute compute to coordinated campaigns:

bash
# Connect to the coordinator and start working
./target/release/darkreach work \
  --coordinator https://api.darkreach.ai

Your node will automatically:

  • Register with the coordinator
  • Claim work blocks from active searches
  • Run the sieve → test → prove pipeline
  • Report results and heartbeat every 10 seconds

See the Network & Operators guide for setting up operator accounts and multi-node deployments.

Checkpointing

Searches automatically checkpoint progress every 60 seconds with atomic writes and SHA-256 integrity verification. If a search is interrupted, it resumes from the last valid checkpoint:

bash
# Checkpoint is saved to darkreach.checkpoint by default
# Use --checkpoint to specify a custom path
./target/release/darkreach --checkpoint my-search.checkpoint \
  kbn --k 3 --base 2 --min-n 100000 --max-n 500000

Launch the Dashboard

The coordinator can serve the dashboard directly:

bash
# Start the coordinator with dashboard
./target/release/darkreach dashboard \
  --database-url postgres://user:pass@localhost/darkreach \
  --port 7001

# Open http://localhost:7001 in your browser

Or use the hosted dashboard at app.darkreach.ai.

Next Steps