EngramEngramDocs

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-.git
cd -Engram-
pip install -e .
02
Create wallet
bash
btcli wallet new_coldkey --wallet.name engram
btcli 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

VariableDefaultDescription
NETUID42Subnet UID
SUBTENSOR_NETWORKtestNetwork to connect to
WALLET_NAMEengramValidator coldkey
WALLET_HOTKEYvalidatorValidator hotkey
SCORING_INTERVAL120Seconds between scoring rounds
WEIGHT_INTERVAL600Seconds between weight-setting on chain
CHALLENGE_SAMPLE_SIZE10CIDs per miner per round
MIN_PROOF_RATE0.50Proof 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 →