# Steps to Make a Validator on Commune

By [Marco Rodrigues](https://paragraph.com/@macrodrigues) · 2023-10-05

---

[_Commune_](https://github.com/commune-ai/commune)_, is a set of development tools that work very similarly to_ [_Bittsensor_](https://bittensor.com/)_. Both aim to achieve a decentralized AI system through Blockchain technology._

The Commune protocol is fully open-source and incentivizes developers to create modular, interoperable modules, that can be used locally or remotely. These so-called modules can wrap up machine-learning tools in structured folders. Enabling AI models to be easily shareable, and participants can be rewarded with the blockchain’s native token ($COM).

### 1 - First Steps

To start using the commune repository, you first need to install the following dependencies on your Linux machine:

    sudo apt update
    sudo apt install python3-pip
    sudo apt install git
    sudo apt install npm 
    sudo npm install pm2
    

You’re now ready to clone the `Git` repository:

    git clone https://github.com/commune-ai/commune.git
    

In case you don’t have docker installed:

    sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    sudo apt update
    sudo apt install docker.io make -y
    sudo systemctl start docker
    sudo systemctl enable docker
    

Then start the Docker container (this might take a while):

    cd commune
    make up
    

Install commune with the following `pip` command:

    pip install -e ./
    

Now go to the docker container:

    make enter
    

We’ll continue from the container, but if you want to do `git pull` of the project, you need to do `exit`.

### 2 - Create a validator

Once you have done the setup, you can now run one of the following commands to register a validator.

    c vali register tag=<validator_name>
    

or

    c register vali::<validator_name>
    

The output should look like this:

    Launching class:Vali name:vali::<validator_name> fn:serve mode:pm2
    📡 Registering vali::<validator_name> with address 85.52.243.11:50082 replacing None
    ✅ Registered vali::<validator_name> with address 85.52.243.11:50082
    {'success': True, 'message': 'Server vali::<validator_name> registered to commune', 'server_name': 'vali::<validator_name>
    

In case you want to register it on a Python file, do the following:

    import commune as c
    
    c.module('vali').register(tag='<validator_name>')
    

The validator isn't registered yet! You need to stake some $COM tokens first. For that, continue reading.

⚠️ **Note:** If you want to stop your validator for some reason to the following:

    c kill vali::<validator_name>
    

Create a key to transfer funds to your validator.

    c add_key <my_key>
    

You should get something like this:

    {
        'crypto_type': 1,
        'seed_hex': 'ff7bc...',
        'derive_path': None,
        'path': '<my_key>',
        'ss58_format': 42,
        'public_key': '6444e...',
        'ss58_address': '5ELB7R...',
        'private_key': 'e6a4299f7d...',
        'mnemonic': 'aim border ...'
    }
    

Don’t forget to save the mnemonic phrase, to recover your key (aka wallet) in the future. To recover do this:

    c add_key <my_key> mnemonic=<your_key_mnemonic>
    

To list all keys (including validators):

    c keys
    

To remove keys:

    c rm_key <my_key>
    

### 3 - Buy tokens

To register the validator you need to stake 100 tokens, and for that, you need to buy them on Commune’s [Discord](https://discord.com/invite/DgjvQXvhqf).

Once on Discord, you’ll find the channel `otc` and you can use the acronym WTB (Want to Buy) to ask for tokens. Example: `WTB 5K / $2.2`.

Then you’ll be contacted to provide an address. You can give the address of one of your keys.

Now if you do `c get_balance <my_key>` you should see your tokens.

### 4 - Stake on a validator

The validator also has its own address, to know which one is, you can run the following in the terminal:

    c key_stats vali::<validator_name>
    

You should get something like this:

    {
        'staketo': [],
        'total_stake': 0,
        'registered': False,
        'balance': 2.0,
        'addresss': '5CPZE...'
    }
    

In Python:

    c.key_stats('vali::<validator_name>')
    

To stake $COM tokens, we use one of the keys we’ve generated and the validator’s `address` that we got after doing `c key_stats vali::<validator_name>`.

    c stake <my_key> amount 5CPfg6...
    

Your validator should look like this now:

    {
        'staketo': [],
        'total_stake': 100,
        'registered': True,
        'balance': 2.0,
        'addresss': '5CPZE...'
    }
    

⚠️ **Note:** If you didn’t manage to register your validator, you can try to do `c s loop`, which looks for unregistered validators.

### **Final Notes**

Commune AI is a very young project, and steps may change over time, the best way is to reach their [Discord](https://discord.com/invite/DgjvQXvhqf) channel for all sorts of questions, and the [GitHub](https://github.com/commune-ai/commune) repository. See below other sources:

[https://medium.com/@Calc482/step-by-step-guide-to-delegating-tokens-to-commune-validators-d5a5bd050973](https://medium.com/@Calc482/step-by-step-guide-to-delegating-tokens-to-commune-validators-d5a5bd050973)

[

How to: create a Commune Wallet (key)
-------------------------------------

How to: create a Commune Wallet (key) Setting Up Commune on Ubuntu/UnixOS with Docker Requirements: Ubuntu or UnixOS (local machine or VPS) Update and Install Necessary Packages: sudo apt-get update ...

https://medium.com

![](https://storage.googleapis.com/papyrus_images/379aae2ba29ad379c7f02fe3d04af91a1e0b43b0087188203cd56d0da45e9f6a.png)

](https://medium.com/@COMswap/step-by-step-guide-how-to-create-a-wallet-key-60a8fd193bc9)

[

How to: Delegating $COM tokens to Validators
--------------------------------------------

How to: Delegating $COM tokens to Validators 1. Stake to Validator: c stake ss58\_adress amount validators\_ss58\_adress 2. We have launched our own validator. If you like our work and the products we ...

https://medium.com

![](https://storage.googleapis.com/papyrus_images/fc873fd753a4476ab92aed3adf13b76a7ccc4e441d1fbed4fc107f258e65b2ca.png)

](https://medium.com/@COMswap/how-to-delegating-com-tokens-to-validators-060ff862b65e)

---

*Originally published on [Marco Rodrigues](https://paragraph.com/@macrodrigues/steps-to-make-a-validator-on-commune)*
