Skip to main content

CLI Reference

BlockZero miners and validators are run as Python scripts from the repository. Each role requires two cooperating processes.

Miner

Process 1: train.py — GPU Training Loop

env TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTS=1 \
python mycelia/miner/train.py --path <config_directory>

Process 2: model_io.py — Chain Sync Daemon

python mycelia/miner/model_io.py --path <config_directory>

Arguments

ArgumentTypeDescription
--path PATHstringPath to the config directory containing the YAML config file. Falls back to default config in mycelia/config.py if not provided.

Examples

# Run local training
env TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTS=1 \
python mycelia/miner/train.py \
--path ~/subnet-MoE/checkpoints/miner/<your hotkey>/<run name>/

# Run chain communication
python mycelia/miner/model_io.py \
--path ~/subnet-MoE/checkpoints/miner/<your hotkey>/<run name>/

Validator

Process 1: run.py — Constant Evaluation

python mycelia/validator/run.py --path <config_directory>

Process 2: server.py — Model Serving

python3 mycelia/shared/server.py --path <config_directory>

Arguments

ArgumentTypeDescription
--path PATHstringPath to the config directory containing the YAML config file. Falls back to default config in mycelia/config.py if not provided.

Examples

# Run constant evaluation
python mycelia/validator/run.py \
--path ~/subnet-MoE/checkpoints/validator/<your hotkey>/<run name>/

# Run model serving
python3 mycelia/shared/server.py \
--path ~/subnet-MoE/checkpoints/validator/<your hotkey>/<run name>/

Config Generation

Generate a template config file for either role:

python mycelia/shared/config.py \
--get_template <validator|miner> \
--coldkey_name <your coldkey name> \
--hotkey_name <your hotkey name> \
--run_name <your naming to specify this run>

Environment Variables

VariableUsed byDescription
BZ_AUTH_TOKENvalidatorBearer token for the validator HTTP API.
BZ_WANDB_API_KEYminerW&B API key. Required when wandb: true in config.
TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTSminerSet to 1 for train.py.