Skip to content

Commit

Permalink
Improve localnet docs in CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
HudsonGraeme committed Jan 17, 2025
1 parent 6fa232c commit 2232d9e
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,27 @@ $ uv sync --upgrade-package bittensor --upgrade-package requests==2.0.0

## Running Locally for Development

For local development, we suggest running a [local devnet node](https://github.com/inference-labs-inc/bittensor-devnet).

### Miner

```sh
python ./neurons/miner.py --localnet
```

### Validator

```sh
python ./neurons/validator.py --localnet
```
For local development, we recommend using our devcontainer which provides a pre-configured development environment. The devcontainer image is pulled from `ghcr.io/inference-labs-inc/bittensor-devcontainer:latest`.

1. Create the `~/.bittensor/omron` directory on your host machine if it doesn't exist
2. Open the project in VS Code with the Dev Containers extension installed
3. VS Code will prompt you to "Reopen in Container" - click this to start the devcontainer
4. Once the container starts, run:
```sh
uv sync
```
This will create and activate a virtual environment in `.venv`
5. In separate terminal windows, run:

```sh
# Terminal 1: Start the local subnet
start_localnet.sh

# Terminal 2: Start the miner
python neurons/miner.py --localnet

# Terminal 3: Start the validator
python neurons/validator.py --localnet
```

Note: btcli is pre-configured to use `ws://127.0.0.1:9944` in `~/.bittensor/config.yml`

0 comments on commit 2232d9e

Please sign in to comment.