🌟 Important Prerequisites Notice

Before you embark on this journey with Masa Subnet 42, please take note:

  1. 🌐 Data Scraping Focus: Subnet 42 is designed for efficient data scraping from the X (Twitter) network. Ensure your setup is optimized for high-quality data extraction.
  2. πŸ”— Access to a Masa Protocol Node: Required to scrape data from X.
  3. πŸ§ͺ Testnet Availability: You can test your setup on the testnet (netuid 165) before moving to the mainnet to ensure everything is functioning correctly.

πŸ“‹ Prerequisites

  • 🐍 Python 3.12 or higher
  • πŸ’Ό A Bittensor wallet with TAO
  • 🌐 Access to the Bittensor network (testnet or mainnet)
  • πŸ› οΈ Familiarity with the Masa Protocol for data scraping

🌟 Key Features of Masa Subnet 42

Masa Subnet 42 offers specialized tools and frameworks to enhance your data scraping capabilities:

  • Masa SDK: Provides efficient tools for data scraping and validation.
  • Kurtosis Reward Curve: Ensures fair distribution of rewards based on performance.
  • Data Scraping and Validation: Miners extract trending tweets, while validators ensure data quality and relevance.

These features are designed to help you effectively participate in the data-driven ecosystem of Masa Subnet 42.

πŸ› οΈ Step 1: Environment Setup

  1. Clone the repository:

    git clone https://github.com/masa-finance/masa-bittensor
    cd masa-bittensor
    
  2. Create or activate a virtual environment:

    # Create virtual environment
    python -m venv venv
    
    # Activate virtual environment
    source venv/bin/activate
    
  3. Get the latest release:

    latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
    
  4. Checkout the latest release:

    git checkout $latest_tag
    
  5. Install Required Packages:

    pip install -e .
    
  6. Setup Protocol Config: To set up the protocol, you need to follow the instructions provided in the protocol setup guide. Please visit the protocol setup guide to complete the necessary steps. Once you have set up the protocol, you can return here to continue with the next steps. If you’re setting up a protocol node on the same machine as your miner, no further configuration is needed.

  7. Run the miner:

    pm2 start "make run-miner"
    

    Your miner should now be running! To view the logs, run

    pm2 logs
    

    There are many configurations that you can adjust, but in most cases, the defaults will suffice. Below is a list of flags you can pass to the run-miner command in the Makefile to adjust the miner’s behavior.

    • --twitter.max_tweets_per_request - the maximum number of tweets to scrape per request. Note that Twitter’s current rate limit is 900 requests per 15 minutes. Defaults to 100.

    • --blacklist.min_stake_required - the minimum amount of TAO a validator must have staked for your miner to respond

    • --blacklist.force_validator_permit - requires a validator to have a vpermit for your miner to respond

    • --neuron.auto_update - auto update your code when we release a new version!

    Be sure to restart your miner after editing the Makefile to apply the changes!

    For an accurate, up to date list of possible configurations, check out our source code!