Skip to main content

Mining on Lium Compute Subnet

Introduction​

Welcome to the Lium Compute Subnet mining guide. This subnet enables GPU owners to contribute computational resources to a decentralized network and earn TAO rewards. As a miner, you'll operate a distributed infrastructure consisting of a central miner server (CPU-based) that manages multiple GPU executors.

Prerequisites​

Before you begin mining on the Lium subnet, ensure you understand:

  • Bittensor fundamentals: Familiarize yourself with hotkeys, coldkeys, and wallet management
  • Subnet economics: Understand how rewards are distributed based on validator stake
  • Technical requirements: Basic Linux administration and Docker knowledge
Security Notice

Never place your coldkey on a mining server. Coldkeys should only exist on secure, offline machines. Mining operations only require hotkeys.

Architecture Overview​

The Lium mining system consists of two components:

  1. Central Miner Server: A lightweight CPU server that coordinates your mining operations
  2. GPU Executors: One or more GPU-equipped machines that perform actual computations

System Requirements​

Central Miner Server​

The central miner requires minimal resources:

ComponentMinimumRecommended
CPU4 cores8 cores
RAM8 GB16 GB
Storage50 GB100 GB SSD
Network100 Mbps1 Gbps
OSUbuntu 20.04+Ubuntu 22.04

GPU Executors​

Each executor must have compatible GPUs. View the current GPU rewards and compatibility matrix in the official constants file.

GPU Selection

Higher-tier GPUs (A100, H100) typically earn more rewards but require proportionally higher investment. Choose GPUs based on your budget and expected ROI.

Installation Guide​

Step 1: Prepare Your Environment​

First, clone the Lium Compute Subnet repository:

git clone https://github.com/Datura-ai/compute-subnet.git
cd compute-subnet

Step 2: Install Dependencies​

Run the installation script to set up required tools:

chmod +x scripts/install_miner_on_ubuntu.sh
./scripts/install_miner_on_ubuntu.sh

Verify the installation:

# Check Bittensor CLI
btcli --version

# Check Docker
docker --version

If either tool is missing:

Step 3: Configure Your Miner​

Create your configuration file from the template:

cp neurons/miners/.env.template neurons/miners/.env

Edit the .env file with your specific settings:

# Your Bittensor wallet name (check with: btcli wallet list)
BITTENSOR_WALLET_NAME=your_wallet_name

# Your hotkey name (must be registered on subnet 51)
BITTENSOR_WALLET_HOTKEY_NAME=your_hotkey_name

# External IP address of this server (must be publicly accessible)
EXTERNAL_IP_ADDRESS=your.server.ip.address

# Path to your Bittensor wallet directory
HOST_WALLET_DIR=/home/your_user/.bittensor/wallets

# Network ports (ensure EXTERNAL_PORT is open in firewall)
INTERNAL_PORT=8000
EXTERNAL_PORT=8000
Network Configuration

Ensure your EXTERNAL_PORT is:

  • Open in your firewall/security groups
  • Not blocked by your ISP
  • Properly forwarded if behind NAT

Step 4: Register Your Hotkey​

If you haven't already registered your hotkey on subnet 51:

btcli subnet register --netuid 51 --wallet.name <your_wallet> --wallet.hotkey <your_hotkey>
Registration Cost

Registration requires a dynamic TAO fee that fluctuates based on network demand. Check current costs before registering.

Step 5: Start the Central Miner​

Launch your miner using Docker Compose:

cd neurons/miners
docker compose up -d

Verify the miner is running:

docker compose ps
docker compose logs -f

Managing GPU Executors​

Understanding Validator Assignment​

When adding executors, you need to assign each one to a specific validator. Validators are responsible for scoring your work and determining rewards.

For optimal rewards, consider using a stake-weighted distribution strategy. See our Validator Assignment Strategy Guide for detailed recommendations on how to assign your executors based on validator stake distribution.

Adding an Executor​

To add a GPU executor to your mining operation:

  1. Set up the executor machine following the executor setup guide

  2. Choose a validator hotkey based on stake distribution at TaoMarketCap

  3. Register the executor with your central miner:

docker exec <miner_container> python /root/app/src/cli.py add-executor \
--address <executor_ip> \
--port <executor_port> \
--validator <validator_hotkey>

Parameters:

  • <miner_container>: Your miner container name/ID (find with docker ps)
  • <executor_ip>: Public IP address of the executor machine
  • <executor_port>: Executor's listening port (default: 8001)
  • <validator_hotkey>: The validator's SS58 hotkey address

Removing an Executor​

To remove an executor from your pool:

docker exec <miner_container> python /root/app/src/cli.py remove-executor \
--address <executor_ip> \
--port <executor_port>

Switching Validators​

To reassign an executor to a different validator:

docker exec -it <docker_instance> pdm run /root/app/src/cli.py switch-validator \
--address <executor_ip> \
--port <executor_port> \
--validator <validator_hotkey>

Monitoring and Maintenance​

Track Your Performance​

Monitor your mining rewards and performance:

View Miner Logs​

# View recent logs
docker compose logs --tail=100

# Follow logs in real-time
docker compose logs -f

# Check specific executor connections
docker exec <miner_container> python /root/app/src/cli.py list-executors

Common Issues and Solutions​

IssueSolution
Executor not connectingVerify firewall rules and network connectivity
Low/no rewardsCheck validator assignments match stake distribution
Miner container crashesReview logs and ensure wallet files are accessible
Registration failedEnsure sufficient TAO balance for registration fee

Security Best Practices​

  1. Key Management

    • Store coldkeys offline in secure locations
    • Only deploy hotkeys to mining servers
    • Regularly rotate compromised keys
  2. Network Security

    • Use firewalls to restrict access to mining ports
    • Implement SSH key authentication
    • Keep systems updated with security patches
  3. Operational Security

    • Monitor for unusual activity
    • Set up alerts for executor disconnections
    • Maintain backups of configuration files

Economic Considerations​

Understanding Rewards​

Your mining rewards depend on:

  • Number and quality of GPU executors
  • Proper validator assignment strategy
  • Network competition and total hashrate
  • Subnet emission schedule

Risks and Deregistration​

Deregistration Risk

Miners with consistently low performance may be deregistered from the subnet. This occurs when:

  • Your emissions rank in the bottom of active miners
  • A new miner registers and you have the lowest score
  • You fail to maintain minimum performance standards

ROI Calculation​

Before investing in mining infrastructure, consider:

  • Hardware costs (GPUs, servers, networking)
  • Operational expenses (electricity, bandwidth, maintenance)
  • Current TAO price and emission rates
  • Competition from other miners

Getting Help​

Resources​

Troubleshooting Checklist​

Before requesting support, verify:

  • Hotkey is registered on subnet 51
  • Docker containers are running
  • Network ports are open and accessible
  • Executors are properly assigned to validators
  • Wallet files have correct permissions

Next Steps​

After successfully setting up your miner:

  1. Add GPU Executors: Follow the executor setup guide
  2. Monitor Performance: Track your rewards and adjust as needed
  3. Scale Operations: Add more executors as you validate profitability
  4. Join Community: Engage with other miners in Discord for tips and updates

This documentation is maintained by the Lium team and community. For corrections or improvements, please submit a pull request.