6.3 Running Locally (Staging)
Run C-SWON on a local blockchain for development and testing. No testnet TAO required.
Local blockchain = isolated authority nodes on your machine. Not connected to testnet or mainnet. See 6.4 Local Deploy for the recommended Docker-based approach.
Prerequisites
| Requirement | Version |
|---|---|
| Python | 3.10–3.12 |
| Docker | recent (docker --version) |
| Git | any recent |
| bittensor | 10.x |
Quick Start (Docker — recommended)
# Pull and start local chain
docker pull ghcr.io/opentensor/subtensor-localnet:devnet-ready
docker run -d --name local_chain -p 9944:9944 -p 9945:9945 \
ghcr.io/opentensor/subtensor-localnet:devnet-ready
# Wait for block production
docker logs -f local_chain # Ctrl-C once you see blocks
Two endpoints:
| Port | Use |
|---|---|
ws://127.0.0.1:9944 | Metagraph queries, neuron traffic |
ws://127.0.0.1:9945 | Wallet operations (transfer, stake, register, create) |
Then follow 6.4 Local Deploy for the full walkthrough.
Alternative: Build Subtensor from Source
Only needed if Docker is unavailable.
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
# Linux dependencies
sudo apt update && sudo apt install -y make build-essential git clang curl libssl-dev llvm libudev-dev protobuf-compiler
# Clone and build
git clone https://github.com/opentensor/subtensor.git
cd subtensor
./subtensor/scripts/init.sh
./scripts/localnet.sh # fast blocks (250ms)
# or
./scripts/localnet.sh False # normal blocks (12s)
Environment Setup
cd C-SWON
python3.12 -m venv .venv && source .venv/bin/activate
pip install bittensor && pip install -e .
# Create .env
cat > .env << 'EOF'
CSWON_MOCK_EXEC=true
CSWON_SYNTHETIC_SALT=$(python -c "import secrets; print(secrets.token_hex(32))")
EOF
set -a && source .env && set +a
Wallets, Registration, and Running
Follow 6.4 Local Deploy Steps 4–12 for the complete local workflow.
Warning:
docker restart local_chainresets all chain state. You will need to redo wallet funding, registration, and staking.
Navigation
| ← Previous | 6.2 Running on Mainnet |
| → Next | 6.4 Local Deploy Guide |
| Index | Documentation Index |