Code Monkey home page Code Monkey logo

bittensor-ufw's Introduction

Bittensor UFW Configuration Tutorial

Howdy folks, this is a quick update to mitigate naive DDOS attacks.

This guide will walk you through how to set up a firewall configuration for your Bittensor miner or validator using the provided script and PM2. This will help you keep your system secure while only allowing authorized connections.

This helps maintain a nicely firewalled network that does not allow anyone to query it unless they are querying from a validator registered and recorded on the metagraph.

By implementing firewall rules we all create a protected network that can only be accessed from the endpoints that we have recorded in the metagraph (miners and validators). This should also help stop random IPs from doing bad things, and ensure all things done are done via IPs recorded on the network.

Note: Having said this, validator owners should be careful now as you are the front facing entity, so you need to ensure you have rate limitations and proper firewalls (perhaps only accessible through your APIs) to stop attackers from DDOS-ing you. Miners should also stay vigilant. As the network grows, so will the number of people trying to break it.

If you encounter any issues, please refer to the official Bittensor documentation or reach out to the community support at the Discord.

Prerequisites

  1. Python: Make sure Python 3.x is installed.
  2. UFW (Uncomplicated Firewall): Ensure UFW is installed on your system.
  3. PM2: You'll need PM2 for managing the process. You can install it globally using npm install pm2 -g.
  4. Bittensor: Make sure you have Bittensor installed and properly configured.

Steps

1. Clone the Repository

First, clone the repository containing the script.

git clone https://github.com/ifrit98/bittensor-ufw.git
cd bittensor-ufw

2. Install the Required Libraries

Before running the script, you must install the required libraries:

sudo apt update        # Update the package lists
sudo apt install ufw   # Install UFW
pip install bittensor  # Install bittensor
pip install validators # Install openvalidators (if running a validator)

3. Configure and Start the Script with PM2

Start the script using PM2:

pm2 start ufw.py --name ufw

This will start the UFW configuration script in the background, and PM2 will make sure it stays running.

4. Check the Status

You can check the status of the script using:

pm2 status ufw

5. Start Your Bittensor Miner/Validator

You can now start your Bittensor miner or validator as usual. The UFW script will automatically update the firewall rules to allow connections from the top 50 validators in the Bittensor network.

6. Additional PM2 Commands

  • To view the logs:

    pm2 logs ufw
  • To stop the script:

    pm2 stop ufw
  • To restart the script:

    pm2 restart ufw

bittensor-ufw's People

Contributors

ifrit98 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.