Skip to content

Commit

Permalink
Merge pull request #5 from cybercongress/add_availability_subnet
Browse files Browse the repository at this point in the history
Update docs for running Availability Subnet
  • Loading branch information
Snedashkovsky authored Apr 19, 2024
2 parents 4b9eec7 + 34e283e commit 42b88b5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
34 changes: 28 additions & 6 deletions docs/running_availability_subnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ Get list of your wallet addresses:
```bash
ctcli wallet list
```
Transfer at list 0.1 GPUSSY to your miner and validator coldkey wallets to register in the subnet.
Transfer at any GPUSSY amount to your miner and validator hotkey wallets to include addresses to blockchain.
Transfer at least 0.3 GPUSSY to your miner and validator coldkey wallets to register in the subnet and to stake.
Transfer any GPUSSY amount to your miner and validator hotkey wallets to include addresses to blockchain.

## 4. (Optional) Register keys
## 4. Register keys

This step registers your subnet validator and subnet miner keys to the subnet giving them the **first two slots** on the subnet.

Expand Down Expand Up @@ -149,7 +149,7 @@ miner default 9 True 0.00000 0.00000 0.00000 0.00000 0.0
Wallet balance: GPUSSY0.1
```

## 7. Get emissions flowing
## 6. Get emissions flowing

Nominate your validator to the root subnet using the `ctcli`:
```bash
Expand All @@ -162,13 +162,35 @@ The output will be similar to the below:
Successfully became a delegate on space-pussy
```

## 7. Stake to your validator
Selfstake to your validator:
```bash
ctcli stake add --wallet.name=validator --wallet.hotkey=default --cwtensor.network=space-pussy
```
Follow the below prompts:

```bash
Enter GPUSSY amount to stake: 0.1
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3.94it/s]
Do you want to stake to the following keys from validator:
- default:pussy1...: 0.1 GPUSSY
[y/n]: y
Do you want to stake:
amount: GPUSSY0.099000000
to: default [y/n]: y
✅ Finalized
Balance:
GPUSSY0.8... ➡ GPUSSY0.7...
Stake:
GPUSSY0.0... ➡ GPUSSY0.09...
```

## 8. Run subnet miner and subnet validator

Run the subnet miner:

```bash
python neurons/miner.py --netuid=1 --wallet.name=miner --wallet.hotkey=default --logging.debug --cwtensor.network=space-pussy --axon.pot=9000
python neurons/miner.py --netuid=1 --wallet.name=miner --wallet.hotkey=default --logging.debug --cwtensor.network=space-pussy --axon.port=9000
```

You will see the below terminal output:
Expand All @@ -180,7 +202,7 @@ You will see the below terminal output:
Run the subnet validator:

```bash
python neurons/validator.py --netuid 1 --wallet.name=validator --wallet.hotkey=default --logging.debug --cwtensor.network=space-pussy --axon.pot=10000
python neurons/validator.py --netuid=1 --wallet.name=validator --wallet.hotkey=default --logging.debug --cwtensor.network=space-pussy --axon.port=10000
```

You will see the below terminal output:
Expand Down
2 changes: 1 addition & 1 deletion neurons/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, config=None):

def save_state(self):
# TODO(developer): State saving you can do here
ct.logging.warning('Miner.save_state function is not implemented')
ct.logging.trace('Miner.save_state function is not implemented')

async def forward(
self, synapse: Dummy
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cybertensor>=0.2.0
cybertensor>=0.2.1
torch
2 changes: 1 addition & 1 deletion template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# TODO(developer): Change this value when updating your code base.
# Define the version of the template module.
__version__ = "0.1.0"
__version__ = "0.1.1"
version_split = __version__.split(".")
__spec_version__ = (
(1000 * int(version_split[0]))
Expand Down
4 changes: 2 additions & 2 deletions template/base/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ def should_set_weights(self) -> bool:
) # don't set weights if you're a miner

def save_state(self):
ct.logging.warning(
ct.logging.trace(
"save_state() not implemented for this neuron. You can implement this function to save model checkpoints "
"or other useful data."
)

def load_state(self):
ct.logging.warning(
ct.logging.trace(
"load_state() not implemented for this neuron. You can implement this function to load model checkpoints "
"or other useful data."
)

0 comments on commit 42b88b5

Please sign in to comment.