Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ the creation of valuable datasets for the community's miners.

To learn more about the Bittensor validation process, check out this [documentation](https://tensor-wiki.vercel.app/validating/validating).

# Running

These validators are designed to run and update themselves automatically. To run a validator, follow these steps:

1. Install this repository, you can do so by following the steps outlined in [the installation section](#install).
2. Install [Weights and Biases](https://docs.wandb.ai/quickstart) and run `wandb.init()` within this repository. This will initialize Weights and Biases, enabling you to view KPIs and Metrics on your validator.
3. Install [PM2](https://pm2.io/docs/runtime/guide/installation/) and the [`jq` package](https://jqlang.github.io/jq/) on your system.
**On Linux**:
```bash
sudo apt update && sudo apt install jq
```
**On Mac OS**
```bash
brew update && brew install jq
```
4. Run the `run.sh` script which will handle running your validator and pulling the latest updates as they are issued.
```bash
$ pm2 start autorun.sh -- script validators/openvalidators/neuron.py --wallet.name <your-wallet-name> --wallet.hotkey <your-wallet-hot-key>
```

# Usage
There are currently four main avenues for engaging with this repository:

Expand Down
28 changes: 22 additions & 6 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ args=()
version_location="./openvalidators/__init__.py"
version="__version__"

args=$@

# Check if pm2 is installed
if ! command -v pm2 &> /dev/null
then
Expand Down Expand Up @@ -149,10 +147,27 @@ strip_quotes() {
# Parse command line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--script) script="$2"; shift ;;
--name) name="$2"; shift ;;
--*) shift ;;
*) shift ;;
--script)
script="$2";
shift ;;
--name)
name="$2"
shift ;;
--*)
flag="$1";
echo "flag is: $flag"
value="$2";
if [[ $value == *"--"* ]]; then
value="True";
args+=("$flag=$value");
else
args+=("$flag=$value");
shift;
fi
;;
*)
echo "Unknown parameter passed"
shift ;;
esac
shift
done
Expand All @@ -178,6 +193,7 @@ fi

# Run the Python script with the arguments using pm2
echo "Running $script with the following arguments with pm2:"
echo "pm2 start $script --name $proc_name --interpreter python3 -- ${args[@]}"
pm2 start "$script" --name $proc_name --interpreter python3 -- "${args[@]}"

# Check if packages are installed.
Expand Down