Run a Validator
Validators score miners by issuing storage-proof challenges and measuring recall accuracy, latency, and proof success rate.
Setup
01
Clone and install
bash
git clone https://github.com/Dipraise1/-Engram-.gitcd -Engram-pip install -e .
02
Create wallet
bash
btcli wallet new_coldkey --wallet.name engrambtcli wallet new_hotkey --wallet.name engram --wallet.hotkey validator
03
Register on subnet
bash
btcli subnet register --netuid 42 --wallet.name engram --wallet.hotkey validator --subtensor.network test
04
Generate ground truth corpus
The validator needs a local corpus to issue recall challenges.
bash
USE_LOCAL_EMBEDDER=true python scripts/generate_ground_truth.py --count 1000
05
Start validator
bash
python neurons/validator.py --wallet.name engram --wallet.hotkey validator --netuid 42
Scoring loop
The validator runs a loop every 120 seconds:
01
Sync metagraph — Fetch current neuron list and axon IPs from the chain.
02
Issue challenges — Send random CIDs from the ground truth corpus to each miner and verify the returned vectors match.
03
Measure latency — Record round-trip time for each challenge response.
04
Compute scores — Composite score = 0.50 × recall@10 + 0.30 × latency_score + 0.20 × proof_success_rate.
05
Set weights — Commit normalized scores to the chain via substrate extrinsic every 600 seconds.
Scoring formula
composite_score = (0.50 * recall_at_10+ 0.30 * latency_score # 1.0 at ≤100ms, 0.0 at ≥500ms+ 0.20 * proof_success_rate)# Miners below 50% proof success rate receive weight 0
Configuration
| Variable | Default | Description |
|---|---|---|
| NETUID | 42 | Subnet UID |
| SUBTENSOR_NETWORK | test | Network to connect to |
| WALLET_NAME | engram | Validator coldkey |
| WALLET_HOTKEY | validator | Validator hotkey |
| SCORING_INTERVAL | 120 | Seconds between scoring rounds |
| WEIGHT_INTERVAL | 600 | Seconds between weight-setting on chain |
| CHALLENGE_SAMPLE_SIZE | 10 | CIDs per miner per round |
| MIN_PROOF_RATE | 0.50 | Proof success rate below which weight = 0 |
Warning
Validators require a minimum stake to set weights on chain. Check the current minimum with
btcli subnet show --netuid 42.engram docs · v0.1edit on github →