2a. TEE Miners
Tee-worker is the Masa component to scrape data from a secure TEE enclave. It uses the ego framework to build, run and sign the binary.
Hardware Prerequisites
Required Hardware
🔒 Intel SGX Support
- Intel SGX 2.0+ enabled CPU required
- Hardware-level security enclave
- Secure computation environment
💻 Compatible Processors
- 11th Gen+ Intel Core series
- Modern Intel Xeon processors
- Must have SGX feature enabled in BIOS
Verify your CPU supports Intel SGX 2.0 or higher before setting up mining operations. The SGX feature must also be enabled in your system BIOS.
Cloud Provider Recommendations
For optimal TEE mining performance and reliability, we recommend using Microsoft Azure. This provider has been extensively tested and validated by our team to ensure seamless compatibility with Masa Network’s TEE mining requirements:
Microsoft Azure
✓ Offers SGX-enabled virtual machines
✓ Proven reliability for TEE workloads
✓ Validated for Masa Network mining
✓ Our recommended provider
Azure instance capacity planning
When running TEE miners on Azure, it’s important to understand the capacity limits to optimize costs and performance. Here’s what we’ve validated:
Instance Specifications
Standard DC4s v2
- 4 vCPUs
- 16 GiB Memory
- SGX-enabled
Miner Capacity
- Maximum 4 TEE miners per instance
- 1 miner per vCPU recommended
- Attempting to run >4 miners causes automatic termination
To optimize costs, you can run multiple miners on a single Azure instance as long as you stay within the vCPU limits. This approach is more cost-effective than running individual instances for each miner.
System Setup & Configuration
Prerequisites
Before starting TEE mining operations, ensure you have:
Docker Setup
✓ Docker installed and running
✓ Permissions to run containers
Network Keys
✓ BTCLI to installation to manage your wallet
✓ Generate coldkey and hotkey mnemonics and register your miner
Keep your coldkey and hotkey mnemonics secure and backed up. These are required for mining operations and cannot be recovered if lost.
Subnet 42 TEE worker setup
To begin mining on Subnet 42, follow these steps to set up your TEE worker:
Clone Repository
First, clone the Subnet 42 repository which contains the TEE mining software:
Navigate to Directory
Change into the repository directory:
Copy Environment File
Create your environment configuration file:
Edit Environment File
Configure your .env file by updating the following fields:
- Your coldkey mnemonic from wallet creation
- Your hotkey mnemonic from wallet creation
- Your role (miner or validator)
- Your machine’s public IP address and port by default:8091 and 8080
- Network UID (165 for testnet, 42 for mainnet)
- Network name (test or finney) finney is for mainnet.
- Telemetry Result Worker Address (This is the address of the telemetry result worker)
- A comma separated list of twitter credentials to use if you want to scrape twitter data
- A comma separated list of twitter Bearer API tokens to use. Takes precedence over TWITTER_ACCOUNTS. This is the most reliable way to scrape twitter data.
The .env file comes pre-configured for the Subnet 165 testnet environment. No additional network configuration is needed.
When running multiple miners on one instance, you will need to create separate configuration files for each miner. Each config file should have unique settings like ports and wallet keys to avoid conflicts between miners.
Start Your Node
Start your node with Docker Compose based on your configured role:
For miners:
This will:
- Launch the required containers for your node type
- Initialize your miner node
- Connect to the subnet network
Verify TEE Worker
Once your node is running, verify the TEE worker is accessible by visiting your configured address in a browser:
You should see a response indicating the TEE worker is running. If you get a connection error:
- Verify your IP address is correct in the .env file
- Check that port 8080 is open in your firewall
- Ensure the TEE worker container is running properly
The browser may show a security warning due to the self-signed certificate. This is expected and you can proceed to verify the endpoint is responding.
Monitor Logs
Monitor your miner’s logs to ensure everything is running properly:
To see TEE worker logs:
To see miner or validator logs:
Watch for:
- Successful network connections
- Mining activity
- Any potential errors or warnings
It may take a few minutes for your miner to fully sync with the network and begin mining operations.