Deployment Guide¶
How to deploy Crucible natively (CLI) or via Docker for single-user or multi-researcher lab environments. Last updated: June 2026
1. Installation Environments: Docker vs. Local¶
Crucible supports two primary execution environments. Researchers should select the environment that best aligns with their immediate objectives.
| Factor | Docker (Recommended for research integrity) | Local (Recommended for performance) |
|---|---|---|
| Dependencies | None on host (containerized) | Python 3.11+, Foundry, uv or pip |
| Reproducibility | ✅ Pinned environment (optimal) | ⚠️ Dependent on host Python/Foundry versions |
| Setup Time | ~3 min (one-time build) | ~1 min (one-time sync) |
| Execution Speed | Network overhead from container | ⚡ Faster (direct host network integration) |
| Artifact Access | Inside Docker volumes | Direct filesystem access (logs/) |
| Command Chaining | Requires --entrypoint bash |
Standard bash && operators |
2. Prerequisites¶
Target System Requirements¶
Crucible's resource utilization scales linearly with the number of concurrent researchers actively executing experiments.
| Resource Component | Baseline Provisioning (1 Concurrent User) | Marginal Cost per Additional User | Technical Justification |
|---|---|---|---|
| CPU | 4 Cores | +2 Cores | High single-thread performance is critical for Anvil state processing. |
| Memory (RAM) | 8 GB | +4-6 GB | Anvil processes consume ~2-4 GB per forked chain. Complex dual-chain topologies utilize ~6 GB concurrently. |
| Storage (Disk) | 50 GB Free | +50 GB | EVM fork caches (.fork_cache/) and telemetry logs (jsonl) expand rapidly. NVMe/SSD architectures are strictly recommended to mitigate I/O bottlenecks. |
| Operating System | Linux (Ubuntu 22.04+) | — | Ubuntu 24.04 LTS recommended for optimal compatibility. macOS and Windows (via WSL2) are supported for local instances. |
| Python Environment | Python 3.11+ | — | Python 3.12 is recommended for performance optimizations. |
Install Foundry (Required for Native CLI)¶
Crucible natively manages blockchain state via Foundry. Install it locally:
2. Clone & Setup¶
Clone the repository to your target deployment directory:
Install the dependencies using uv (recommended for speed):
Create your environment configuration:
Edit.env to include your archive node RPC URLs (e.g., Alchemy, Infura, or ANKR):
Initialize the workspace:
Global Testbed Configuration (testbed.yaml)¶
Crucible supports advanced settings in testbed.yaml (or testbed.local.yaml) to control determinism, disk usage, logging, limits, and webhooks:
Determinism¶
Controls how the Anvil fork handles state and execution:
determinism:
gas_price: 0 # Enforce fixed gas price
block_base_fee: 1000000000 # Force block base fee
timestamp: "fork_block" # "fork_block" or integer Unix timestamp
auto_mine: true # Automatically mine blocks
order: "fifo" # Transaction ordering
prevrandao: "0x0000000000000000000000000000000000000000000000000000000000000000"
Cleanup & Retention¶
Controls disk usage and automatic cleanup policies:
cleanup:
auto_clean_on_setup: false # Clean stale states before every setup
max_checkpoints: 10 # Max checkpoints to keep per scenario
max_cache_gb: 20 # Max disk space for fork cache
logs_retention_days: 30 # How long to keep standard logs
warn_at_disk_percent: 85.0 # Alert when disk is getting full
default_tier: "scratch" # Default run preservation tier
scratch_retention_days: 7 # Auto-delete scratch runs after 7 days
Logging & Profiling¶
Controls what artifacts are captured during the run:
logging:
base_dir: "logs"
trace_transactions: false # Capture full execution traces
storage_diffs: true # Capture pre/post storage state
gas_profiling: true # Capture per-step gas usage
Fork Cache & RPC Budgets¶
To mitigate excessive consumption of paid archive RPC credits by autonomous agents or anomalous processes, administrators may define explicit budget constraints:
fork_cache:
enabled: true
path: ".fork_cache"
cache_policy: "permissive" # "strict" or "permissive"
rpc_budget:
max_requests_per_run: 5000 # default is 5000
max_usd_estimate: 5.0 # default is $5.00
fail_if_exceeded: true
3. Primary Deployment: Native CLI¶
The recommended, fastest way to use Crucible is directly via the native CLI.
Run an Experiment¶
Fork the chain and run the experiment in two simple steps:
# 1. Start the fork in the background (or in a separate terminal)
uv run crucible fork --topology single &
# 2. Run the experiment
uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline
4. Alternative Deployment: Docker¶
If environments require strict containerization and dependency isolation, Crucible provides comprehensive Docker Compose support.
Prerequisites¶
Ensure Docker (v24.0+) and Docker Compose are installed:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
Build & Run¶
Crucible uses Docker Compose to isolate the testbed, dependencies, and chain forks.
# Build the images
docker compose build orchestrator
# Run the experiment in an isolated container
docker compose run --rm --entrypoint bash orchestrator -c "
rm -f states/*.meta.json && \
uv run crucible fork --topology single && \
uv run crucible experiment run experiments/nomad_replay.yaml --no-baseline
"
Docker Caveats¶
- Stale Anvil meta files: When switching topologies or re-forking, old
.meta.jsonfiles in thestates/Docker volume cause connection errors. Always clean before forking by includingrm -f states/*.meta.jsonbeforecrucible fork. - Chaining commands requires
--entrypoint bash: The orchestrator's entrypoint isuv run crucible, not a shell. To run multiple commands (fork + experiment) in a single container session, use--entrypoint bashand pass your commands as a string. - Streamlit not available in orchestrator: The
crucible doctorcheck forstreamlitwill fail inside the orchestrator container — this is expected. Streamlit runs in a separatedashboardservice (docker compose up -d dashboard). .venv/CACHEDIR.TAGwarning: A benign error about removing/workspace/.venv/CACHEDIR.TAGmay appear on startup. It occurs because the host's.venvis mounted into the container. Safe to ignore.
5. Multi-User Access (Lab Setup)¶
If you are deploying Crucible on a shared Linux workstation for multiple researchers, you must configure directory permissions so researchers can share cached chain state but isolate their own experiment runs.
5.1. Set Up the Shared Group¶
# Create a shared group
sudo groupadd crucible
# Add researchers to the group
sudo usermod -aG crucible alice
sudo usermod -aG crucible bob
# Grant group read/write access to the repository and artifacts
sudo chgrp -R crucible ~/crucible_testbed
sudo chmod -R g+rw ~/crucible_testbed
# Ensure new files inherit the group permissions
sudo find ~/crucible_testbed -type d -exec chmod g+s {} \;
5.2. Isolating Researcher Work¶
Researchers should NOT edit the main testbed.yaml config. Instead, they can create a testbed.local.yaml file (which is gitignored) to isolate their work and prevent port conflicts:
They can also name their runs to easily identify them in the logs:
uv run crucible experiment run experiments/nomad_replay.yaml --name 'alice-nomad-run1' --no-baseline
6. Dashboard Deployment¶
To expose the Streamlit dashboard on your lab's network so researchers can view results from their browsers:
Native Approach¶
# Listen on all network interfaces
uv run streamlit run dashboard/app.py --server.address 0.0.0.0 --server.port 8501
Docker Approach¶
-
Create a
docker-compose.override.ymlfile (this is gitignored): -
Start the dashboard as a background daemon:
Access the dashboard via http://<SERVER_IP>:8501.
7. Daily Maintenance & Cleanup¶
Artifacts and fork caches will consume disk space quickly on a shared machine. Run these commands periodically to keep the deployment healthy: