Documentation / Concepts Bittensor / Chaîne et Runtime
Run a local subtensor chain
Dernière vérification le 2026-10-05
Run a local Bittensor subtensor chain for development, from Docker or from source.
The subtensor code is on GitHub: https://github.com/RaoFoundation/subtensor. The local chain runs the same runtime as mainnet, including dTAO subnets, on fast blocks.
Option 1: Docker (quickest)
shell
docker run --rm --name local_chain \
-p 9944:9944 -p 9945:9945 \
ghcr.io/raofoundation/subtensor-localnet:devnetImage tags:
| Tag | Contents |
|---|---|
:devnet | The commit deployed to devnet |
:testnet | The commit deployed to testnet |
:main (alias :latest) | The current main-branch candidate |
:sha-<commit> | A fixed commit, for reproducible CI |
Option 2: Build from source
shell
git clone https://github.com/RaoFoundation/subtensor.git
cd subtensor
./scripts/init.sh # installs the Rust toolchain and wasm target
./scripts/localnet.sh # builds the node and launches a fast-blocks localnetThe repository pins its Rust toolchain in rust-toolchain.toml, so init.sh installs the right version. You don't need nightly Rust.
localnet.sh builds with the pow-faucet feature, so local wallets can request test TAO from the faucet. Pass False as the first argument (./scripts/localnet.sh False) to run at normal 12-second block times instead of fast blocks.
Connect to your local chain
The local node serves RPC on ws://127.0.0.1:9944.
shell
btcli --network local query is-fast-blocksFrom Python:
python
import bittensor
client = bittensor.Client("local")Install the SDK from https://github.com/RaoFoundation/bittensor (pip install bittensor). For building from source, the Alice dev account, and faucet behaviour, see the upstream local development guide.