Detailed guide for setting up and running a CompressNode daemon.
Installation
Install the CompressNode daemon via pip. This installs the CLI tool and all dependencies including llama-cpp-python for GPU inference, web3.py for blockchain interactions, and FastAPI for the HTTP server.
- pip install compressnode - installs the CLI and all dependencies
- compressnode init --tier <1|2|3> --endpoint <url> - creates config at ~/.compressnode/
- Edit ~/.compressnode/.env to add your wallet private key and contract addresses
Configuration
All settings are configured via environment variables with the COMPRESSNODE_ prefix. The most important settings are:
- COMPRESSNODE_WALLET_PRIVATE_KEY - your operator wallet (for signing challenge responses)
- COMPRESSNODE_NODE_ENDPOINT - your public URL (must be reachable from the internet)
- COMPRESSNODE_GPU_TIER - your GPU tier (1, 2, or 3)
- COMPRESSNODE_RPC_URL - Base RPC endpoint (defaults to https://mainnet.base.org)
- COMPRESSNODE_GPU_LAYERS - number of model layers on GPU (-1 = all, recommended)
On-Chain Registration
After configuring, register your node on the Base blockchain. Registration is free - no staking required. Your node starts with 5,000 reputation (out of 10,000) and can immediately accept inference jobs. Use the dashboard at /dashboard/node or call registerNode() directly on the NodeRegistry contract.
Running the Daemon
Start the daemon with compressnode start --model <model-id>. This launches three concurrent services:
- FastAPI inference server on port 8080 - receives and processes inference requests
- Challenge watcher - polls the chain for verification challenges targeting your node and auto-responds
- Heartbeat loop - pings the CompressNode backend every 30 seconds so the network knows you're online
Docker Deployment
For production deployments, use the Docker image which includes CUDA support. Run with --gpus all to enable GPU access. The Docker image pre-compiles llama-cpp-python with CUDA support for optimal performance.