/synthiaminer

Setup CommuneX Synthia miner on Ubuntu

Synthia Miner

Setup CommuneX Synthia miner on Ubuntu

1. Update and upgrade

  • Let's start with updating and upgrading our installation.
sudo apt update && sudo apt -y upgrade

2. Install dependencies

  • Install python3
sudo apt install python3
  • Install git
sudo apt install git -y
  • Install pipx
sudo apt install pipx -y
  • Fix paths for pipx
pipx ensurepath
  • Install poetry
pipx install poetry
  • Install npm
sudo apt install npm -y
  • Install pm2
sudo npm install pm2 -g
  • Install curl
sudo apt install curl
  • Or you can do all in one go.
sudo apt install python3 git curl npm pipx -y && pipx ensurepath && pipx install poetry && sudo npm install pm2 -g

3. Clone Synthia git and change directory

  • Clone git
git clone https://github.com/agicommies/synthia.git
  • Change directory
cd synthia

4. Setup Poetry

  • Install dependencies for Synthia
poetry install
  • Enter shell
poetry shell

5. Create key

  • Create CommuneAi key on CommuneX, replace with the name you want for your key
  • Remember that this key will need at least 2.5 $COMAI for the burn fee when you register your miner
comx key create <key-name>

6. Create environment file.

  • Make sure you have signed up for Anthropic or Openrouter and created API key. Enter the API key you want to use and save the file as env/config.env
  • If you are using openrouter you will need to "OPENROUTER_API_KEY=" to the config file and add your key
nano env/config.env.sample

7. Get public IP.

  • Find your public IP, you will need this for registering a module.
curl -4 https://ipinfo.io/ip

8. Register module.

  • Register module on Subnet 3
  • Remember that you need at least 2.5 $COMIA for the burn fee
  • Replace with your key
  • Replace with your IP
  • You can also change the port if you want.
comx module register my-test-miner <key-name> --ip <your-public-IP> --port 8000 --netuid 3 

9. Test miner.

  • Make sure you have signed up for Anthropic or Openrouter and created API key. Enter the API key you want to use and save the file as env/config.env
  • Don't forget to replace with the name of your key (step 5).
  • Openrouter example.
comx module serve synthia.miner.anthropic.OpenrouterModule <key-name> --subnets-whitelist 3 --ip 0.0.0.0
  • Anthropic example.
comx module serve synthia.miner.anthropic.AnthropicModule <key-name> --subnets-whitelist 3 --ip 0.0.0.0
  • If all looks to be working you can abort with CTRL+C and go to the next step.



10. Start miner with pm2 and check logs

  • Start miner, remember to replace with the name you want.
  • Also replace with your key.
pm2 start "comx module serve synthia.miner.anthropic.OpenrouterModule <key-name> --subnets-whitelist 3 --ip 0.0.0.0" --name <pm2-name>
  • Start logs.
pm2 <pm2-name> logs