Getting Started
This document provides a complete guide for setting up and running an SN106 Bittensor subnet validator. The validator continuously monitors concentrated liquidity positions across supported blockchains and submits miner weight calculations to the Bittensor network every 20 minutes.
For information about the overall system architecture, see System Architecture. For miner setup instructions, see For Miners. For detailed configuration options, see Configuration.
Prerequisites
Section titled “Prerequisites”System Requirements
Section titled “System Requirements”The SN106 validator requires sufficient computational resources to handle multi-chain data collection and weight calculations.
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8 cores |
| RAM | 8GB | 16GB |
| Storage | 50GB SSD | 100GB+ SSD |
| Network | 50+ Mbps | 100+ Mbps |
| OS | Linux/macOS/Windows | Ubuntu 22.04 LTS |
Software Dependencies
Section titled “Software Dependencies”| Dependency | Version | Purpose |
|---|---|---|
| Node.js | v18.0.0+ | Runtime environment |
| npm | v8.0.0+ | Package management |
| Git | Latest | Repository management |
Blockchain Access Requirements
Section titled “Blockchain Access Requirements”The validator requires RPC access to multiple blockchain networks:
| Network | Status | Purpose |
|---|---|---|
| Solana | Active | Raydium CLMM position monitoring |
| Bittensor Subtensor | Active | Weight submission and hotkey management |
| Ethereum | Coming Soon | Uniswap V3 integration |
| Base | Coming Soon | Uniswap V3 integration |
Sources: README.md:54-81
Installation Process
Section titled “Installation Process”Installation Flow Overview
Section titled “Installation Flow Overview”flowchart TD
START["Start Installation"]
CLONE["git clone repository"]
INSTALL["npm install"]
CONFIG["Configure .env file"]
VALIDATE["Validate configuration"]
RUN["npm run validator"]
CLONE --> INSTALL
INSTALL --> CONFIG
CONFIG --> VALIDATE
VALIDATE --> RUN
CONFIG --> ENV_EXAMPLE[".env.example template"]
CONFIG --> ENV_FILE[".env production file"]
VALIDATE --> CONFIG_TS["config/environment.ts validation"]
RUN --> VALIDATOR_INDEX["validator/index.ts execution"]
ENV_EXAMPLE -.-> ENV_FILE
ENV_FILE --> CONFIG_TS
CONFIG_TS --> VALIDATOR_INDEX
Sources: README.md:84-138
Step 1: Repository Setup
Section titled “Step 1: Repository Setup”Clone the SN106 repository and install dependencies:
git clone <repository-url>cd sn106npm installThe npm install command will install all dependencies defined in package.json, including Bittensor SDK, Solana Web3.js, and other required packages.
Step 2: Environment Configuration
Section titled “Step 2: Environment Configuration”Create your environment configuration file:
cp .env.example .envEdit the .env file with your specific configuration values. The environment template provides the required variable structure.
Sources: README.md:95-102 , .env.example:1-15
Configuration Setup
Section titled “Configuration Setup”Core Configuration Variables
Section titled “Core Configuration Variables”The validator requires several categories of environment variables for proper operation:
Bittensor Network Configuration
Section titled “Bittensor Network Configuration”# Subtensor WebSocket endpointSUBTENSOR_WS_URL=wss://your-subtensor-endpoint
# Validator hotkey for weight submissionVALIDATOR_HOTKEY_URI=your-hotkey-uri-or-mnemonic
# Subnet network IDNETUID=106The VALIDATOR_HOTKEY_URI supports multiple formats:
- Mnemonic phrases:
word1 word2 word3 ... word12 - Private keys:
0x1234...(hexadecimal format) - URI format:
//Aliceor other Polkadot-style URIs
Solana Network Configuration
Section titled “Solana Network Configuration”# Solana RPC endpointSOLANA_RPC_ENDPOINT=https://your-solana-rpc
# Smart contract program IDsSN106_SVM_PROGRAM_ID=your-program-idRAYDIUM_CLMM_PROGRAM_ID=your-clmm-program-idValidator Operation Settings
Section titled “Validator Operation Settings”# Execution interval (minutes)VALIDATOR_INTERVAL_MINUTES=20
# Burn mechanism percentageBURN_PERCENTAGE=95The burn mechanism allocates 95% of emissions to the subnet owner (UID 0) and distributes the remaining 5% among miners through a single setWeights transaction.
Sources: README.md:104-132 , .env.example:1-15
Configuration Validation Flow
Section titled “Configuration Validation Flow”flowchart TD
ENV_FILE[".env file"]
ENV_VARS["Environment Variables"]
CONFIG_TS["config/environment.ts"]
VALIDATION["Runtime Validation"]
VALIDATOR_START["Validator Startup"]
ERROR_HANDLING["Configuration Error Handling"]
ENV_FILE --> ENV_VARS
ENV_VARS --> CONFIG_TS
CONFIG_TS --> VALIDATION
VALIDATION --> VALIDATOR_START
VALIDATION --> ERROR_HANDLING
CONFIG_TS --> SUBTENSOR_CONFIG["Subtensor Configuration"]
CONFIG_TS --> SOLANA_CONFIG["Solana Configuration"]
CONFIG_TS --> CHAIN_CONFIG["Multi-Chain Configuration"]
VALIDATION --> HOTKEY_VALIDATION["VALIDATOR_HOTKEY_URI validation"]
VALIDATION --> RPC_VALIDATION["RPC endpoint validation"]
VALIDATION --> PROGRAM_ID_VALIDATION["Program ID validation"]
ERROR_HANDLING --> EXIT["Process exit with error"]
Sources: README.md:104-132
Running the Validator
Section titled “Running the Validator”Starting the Validator
Section titled “Starting the Validator”Execute the validator using the npm script:
npm run validatorThis command starts the validator process defined in validator/index.ts, which initializes the main orchestration loop.
Validator Operation Cycle
Section titled “Validator Operation Cycle”The validator operates on a continuous 20-minute cycle performing the following operations:
flowchart TD
TIMER["20-minute Timer"]
START_CYCLE["Start Validation Cycle"]
DATA_COLLECTION["Multi-Chain Data Collection"]
WEIGHT_CALC["Weight Calculation"]
WEIGHT_SUBMISSION["Subtensor Weight Submission"]
LOGGING["Operation Logging"]
WAIT["Wait for Next Cycle"]
TIMER --> START_CYCLE
START_CYCLE --> DATA_COLLECTION
DATA_COLLECTION --> WEIGHT_CALC
WEIGHT_CALC --> WEIGHT_SUBMISSION
WEIGHT_SUBMISSION --> LOGGING
LOGGING --> WAIT
WAIT --> TIMER
DATA_COLLECTION --> FETCH_POSITIONS["Fetch NFT Positions"]
DATA_COLLECTION --> FETCH_TICKS["Fetch Current Ticks"]
DATA_COLLECTION --> FETCH_HOTKEYS["Fetch Hotkey Mappings"]
DATA_COLLECTION --> FETCH_ALPHA_PRICES["Fetch Alpha Prices"]
WEIGHT_CALC --> POOL_WEIGHTS["Pool Weight Calculation"]
WEIGHT_CALC --> NFT_SCORING["NFT Position Scoring"]
WEIGHT_CALC --> EMA_SMOOTHING["EMA Weight Smoothing"]
WEIGHT_SUBMISSION --> BURN_MECHANISM["95% Burn to UID 0"]
WEIGHT_SUBMISSION --> MINER_DISTRIBUTION["5% to Miners"]
WEIGHT_SUBMISSION --> SUBTENSOR_TX["setWeightsOnSubtensor call"]
LOGGING --> WEIGHT_HISTORY["weights/weights_history.json"]
LOGGING --> CONSOLE_LOGS["Console Output"]
Sources: README.md:140-147
Core Validator Operations
Section titled “Core Validator Operations”Data Collection Phase
Section titled “Data Collection Phase”- Multi-Chain Position Fetching: Retrieves NFT liquidity positions from enabled chains using
getEnabledChains() - Current Tick Analysis: Fetches current market tick data for accurate position scoring
- Hotkey-to-UID Mapping: Maps Bittensor hotkeys to subnet UIDs for weight assignment
- Alpha Price Monitoring: Collects subnet alpha token prices for performance-based weight allocation
Weight Calculation Phase
Section titled “Weight Calculation Phase”- Pool Weight Distribution: Calculates pool-level weight allocation based on alpha token performance
- NFT Position Scoring: Evaluates individual NFT positions based on:
- Position concentration (narrower ranges score higher)
- Distance from current market price
- Liquidity amount provided
- EMA Smoothing: Applies exponential moving average to prevent weight volatility
Submission Phase
Section titled “Submission Phase”- Burn Mechanism: Allocates 95% of weights to subnet owner (UID 0)
- Miner Distribution: Distributes remaining 5% among qualifying miners
- Subtensor Transaction: Submits final weights via
setWeightsOnSubtensor
Sources: README.md:140-147
Monitoring and Maintenance
Section titled “Monitoring and Maintenance”Log Monitoring
Section titled “Log Monitoring”The validator provides comprehensive logging for operational monitoring:
- Console Output: Real-time operation status and progress indicators
- Weight History: All weight submissions saved to
weights/weights_history.json - Error Tracking: Detailed error messages for troubleshooting
Health Checks
Section titled “Health Checks”The validator includes automatic health monitoring:
- Connection Monitoring: Automatic detection of RPC connection issues
- Reconnection Logic: Automatic reconnection for temporary network failures
- Performance Optimization: Batch processing and multicall operations for efficiency
Operational Status Indicators
Section titled “Operational Status Indicators”Monitor these key indicators for validator health:
| Indicator | Location | Expected Behavior |
|---|---|---|
| Cycle Completion | Console logs | Every 20 minutes |
| Weight Submissions | weights/weights_history.json | Successful transactions |
| Data Collection | Console output | Multi-chain data retrieval |
| Error Rate | Console logs | Minimal connection errors |
Sources: README.md:148-154
Next Steps
Section titled “Next Steps”After successfully starting your validator:
- Monitor Initial Cycles: Watch the first few validation cycles to ensure proper operation
- Review Weight History: Check
weights/weights_history.jsonfor successful submissions - Set Up Monitoring: Implement log monitoring for production environments
- Configure Backups: Ensure proper backup systems for validator hotkeys and configuration
For detailed configuration options, see Configuration. For Docker deployment, see Docker Deployment. For validator operation best practices, see For Validators.
Sources: README.md:170-186