Skip to main content

Distributed compute worker for Ants at Work colony

Project description

Ants Worker

Join the colony. Share your compute.

pip install ants-worker
ants-worker join

That's it. You're now part of the swarm.

How It Works

┌─────────────────────────────────────────────────────────────────────────┐
│                           YOUR MACHINE                                   │
│                                                                          │
│   $ ants-worker join                                                    │
│                                                                          │
│   ┌──────────────┐                                                      │
│   │ ants-worker  │──────┐                                               │
│   │              │      │  1. Register → get token                      │
│   │  Kangaroo    │      │  2. Sense cold regions                        │
│   │  Algorithm   │      │  3. Compute distinguished points              │
│   │              │      │  4. Deposit results                           │
│   │  (CPU/GPU)   │      │  5. Check for collision                       │
│   └──────────────┘      │  6. Repeat                                    │
│                         ▼                                                │
└─────────────────────────┼────────────────────────────────────────────────┘
                          │
                          │  HTTPS + Bearer Token
                          ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                     api.ants-at-work.com                                 │
│                     (Cloudflare Edge + D1)                               │
│                                                                          │
│   Collision detection happens here. When tame and wild kangaroos        │
│   land on the same point → private key found.                           │
└─────────────────────────────────────────────────────────────────────────┘

No manual configuration. No copying tokens. Just join.

Commands

ants-worker join           # Register and start working
ants-worker join -t wild   # Run as wild kangaroo (default: tame)
ants-worker status         # Check connection and worker ID
ants-worker leave          # Unregister (delete ~/.ants/config.json)
ants-worker info           # System/GPU info
ants-worker benchmark      # Test performance

GPU Acceleration (Optional)

With GPU: ~1B ops/sec. Without: ~10K ops/sec.

# Linux with NVIDIA GPU
git clone https://github.com/JeanLucPons/Kangaroo.git
cd Kangaroo && make gpu=1 && cd ..
export KANGAROO_BIN=$(pwd)/Kangaroo/kangaroo

ants-worker join

Run in Background

Screen/tmux

screen -S ants
ants-worker join
# Ctrl+A, D to detach

Systemd (Linux)

sudo tee /etc/systemd/system/ants-worker.service << 'EOF'
[Unit]
Description=Ants Worker
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/ants-worker join
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable --now ants-worker

Cloud Providers

Works on Vast.ai, Lambda Labs, RunPod, or any Linux machine:

apt update && apt install -y python3-pip
pip install ants-worker
ants-worker join

What Are We Solving?

Bitcoin Puzzle #71 - a 7.1 BTC bounty.

Target: Find the private key for address 1PWo3JeB9jrGwfHDNpdGK54CRas7fsVzXU

The key is between 2^70 and 2^71. Using Pollard's Kangaroo algorithm across many workers, we find it together.

Stigmergic Coordination

Workers coordinate through the environment (not direct messaging):

  1. Sense - Query cold regions (low pheromone = unexplored)
  2. Decide - Pick a region to explore
  3. Mark - Deposit "working" pheromone
  4. Work - Run Kangaroo algorithm
  5. Deposit - Leave results + exploration pheromone
  6. Repeat

No central coordinator. Intelligence emerges.

Architecture

                    ┌───────────────────────────────────────┐
                    │           AGENTVERSE                   │
                    │   Queen ◄──► Scouts ◄──► Hunters      │
                    │   (FET economy, agent messaging)       │
                    └─────────────────┬─────────────────────┘
                                      │
                    ┌─────────────────▼─────────────────────┐
                    │    api.ants-at-work.com (CF + D1)     │
                    │    Fast coordination, collision det.  │
                    └─────────────────┬─────────────────────┘
                                      │
              ┌───────────────────────┼───────────────────────┐
              │                       │                       │
              ▼                       ▼                       ▼
        ┌──────────┐            ┌──────────┐            ┌──────────┐
        │ Worker 1 │            │ Worker 2 │            │ Worker N │
        └──────────┘            └──────────┘            └──────────┘
                                      │
                    ┌─────────────────▼─────────────────────┐
                    │    TypeDB Cloud (ants-colony)         │
                    │    Permanent storage, patterns         │
                    └───────────────────────────────────────┘

FAQ

Is this safe? Yes. You get a unique token that can only submit work results.

Resources? Minimal bandwidth (~KB/min). CPU/GPU usage configurable. Stop with Ctrl+C.

Where's my config? ~/.ants/config.json - contains your token and worker ID.

Tame vs Wild? Both needed. Run one of each for maximum contribution:

ants-worker join -t tame &
ants-worker join -t wild &

How do I check status?

ants-worker status

Development

git clone https://github.com/ants-at-work/ants-worker
cd ants-worker
pip install -e ".[dev]"
pytest

See docs/stigmergy-compute.md for architecture details.

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ants_worker-0.1.0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ants_worker-0.1.0-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

Details for the file ants_worker-0.1.0.tar.gz.

File metadata

  • Download URL: ants_worker-0.1.0.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for ants_worker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a338a0e9a9cbbdc6b298614d43dd193351fbe94aa6d24dbbd1d6908ca3953450
MD5 8d898fef2926635502904cce14f7e5ee
BLAKE2b-256 c94c84512021e95c50a5759797ab1ad3d5fb76078d37add697efd7268fe67473

See more details on using hashes here.

File details

Details for the file ants_worker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ants_worker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for ants_worker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cdaa5e2fb8597536d9ddcce38d6b9f4fa61ce14a28ae9026e1a256068e74c10
MD5 76b04d941db7eab23f5cd5b25f6c3f89
BLAKE2b-256 9a9c3ce19a8670dd1635eb7a3d86c0f15b72d1cd8cfd6148430021a5ca60b63f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page