Skip to content

Commit

Permalink
Merge pull request #48 from coinmetrics/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
matt-yuma authored Jan 14, 2025
2 parents b7cc7b6 + 5cf32cb commit 3be11b9
Show file tree
Hide file tree
Showing 17 changed files with 595 additions and 380 deletions.
8 changes: 4 additions & 4 deletions .env.miner.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Network Configuration
NETWORK=localnet # Options: localnet, testnet, finney
# Options: localnet, testnet, finney
NETWORK=testnet

# Wallet Configuration
COLDKEY=miner
Expand All @@ -8,13 +9,12 @@ MINER_HOTKEY=default
# Node Configuration
MINER_NAME=miner
MINER_PORT=8092
AXON_IP=127.0.0.1
AXON_EXTERNAL_IP=127.0.0.1

# Miner Settings
TIMEOUT=16
VPERMIT_TAO_LIMIT=2
FORWARD_FUNCTION=base_miner

# Logging
LOGGING_LEVEL=info # Options: info, debug, trace
# Options: info, debug, trace
LOGGING_LEVEL=debug
8 changes: 4 additions & 4 deletions .env.validator.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Network Configuration
NETWORK=testnet # Options: localnet, testnet, finney
# Options: localnet, testnet, finney
NETWORK=testnet

# Wallet Configuration
COLDKEY=validator
Expand All @@ -8,8 +9,7 @@ VALIDATOR_HOTKEY=default
# Node Configuration
VALIDATOR_NAME=validator
VALIDATOR_PORT=8091
AXON_IP=127.0.0.1
AXON_EXTERNAL_IP=127.0.0.1

# Logging
LOGGING_LEVEL=info # Options: info, debug, trace
# Options: info, debug, trace
LOGGING_LEVEL=debug
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ENV_FILE ?= .env

include $(ENV_FILE)
export

Expand All @@ -12,7 +10,7 @@ ifeq ($(NETWORK),localnet)
else ifeq ($(NETWORK),testnet)
netuid = 256
else ifeq ($(NETWORK),finney)
#netuid = 64
netuid = 55
$(error Finney network not supported yet)
endif

Expand All @@ -27,28 +25,26 @@ register:
}

validator:
python start_validator.py \
pm2 start --name $(VALIDATOR_NAME) python3 -- precog/validators/validator.py \
--neuron.name $(VALIDATOR_NAME) \
--wallet.name $(COLDKEY) \
--wallet.hotkey $(VALIDATOR_HOTKEY) \
--subtensor.chain_endpoint $($(NETWORK)) \
--axon.port $(VALIDATOR_PORT) \
--axon.ip $(AXON_IP) \
--axon.external_ip $(AXON_EXTERNAL_IP) \
--netuid $(netuid) \
--logging.level $(LOGGING_LEVEL)
--logging.level $(LOGGING_LEVEL) \
--wandb.off

miner:
python start_miner.py \
pm2 start --name $(MINER_NAME) python3 -- precog/miners/miner.py \
--neuron.name $(MINER_NAME) \
--wallet.name $(COLDKEY) \
--wallet.hotkey $(MINER_HOTKEY) \
--subtensor.chain_endpoint $($(NETWORK)) \
--axon.port $(MINER_PORT) \
--axon.ip $(AXON_IP) \
--axon.external_ip $(AXON_EXTERNAL_IP) \
--netuid $(netuid) \
--logging.level $(LOGGING_LEVEL) \
--timeout $(TIMEOUT) \
--vpermit_tao_limit $(VPERMIT_TAO_LIMIT) \
--forward_function $(FORWARD_FUNCTION)
--forward_function $(FORWARD_FUNCTION) \
--wandb.off
94 changes: 78 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

# **CoinMetrics Precog Subnet** <!-- omit in toc -->

<div align="center">

| **Testnet UID:** 256 <br> **Mainnet UID:** 55 |
| - |

</div>

<br/>

| | |
| :-: | :-: |
| **Status** | <img src="https://img.shields.io/github/v/release/coinmetrics/precog?label=Release" height="25"/> <img src="https://img.shields.io/github/actions/workflow/status/coinmetrics/precog/ci.yml?label=Build" height="25"/> <br> <a href="https://github.com/pre-commit/pre-commit" target="_blank"> <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&label=Pre-Commit" height="25"/> </a> <a href="https://github.com/psf/black" target="_blank"> <img src="https://img.shields.io/badge/code%20style-black-000000.svg?label=Code%20Style" height="25"/> </a> <br> <img src="https://img.shields.io/github/license/coinmetrics/precog?label=License" height="25"/> |
Expand Down Expand Up @@ -35,6 +44,29 @@ The incentive mechanism was specifically designed to reward precise statements o
| 2 vCPUs | 2 vCPUs |

---

## Prerequisites

Before beginning, ensure you have:

1. **Python Installation**
- Python version 3.9, 3.10, or 3.11 installed
- We recommend using `pyenv` for Python version management

2. **Bittensor Knowledge**
- Understanding of the Bittensor ecosystem and wallet management
- Familiarity with creating and managing Bittensor wallets
- Review the [Bittensor Wallet Documentation](https://docs.bittensor.com/getting-started/wallets)
- For general understanding, see the [Bittensor Documentation](https://docs.bittensor.com/)

3. **Poetry**
- Basic understanding of Poetry for dependency management
- See the [Poetry Documentation](https://python-poetry.org/docs/) for installation and usage

4. **System Requirements**
- NodeJS and NPM (for PM2 installation)
- Basic understanding of command-line interfaces

## Installation

First, install PM2:
Expand Down Expand Up @@ -70,40 +102,70 @@ poetry install
---
## Configuration

### Makefile
Start by editing the Makefile with your wallet and network information:
```
################################################################################
# User Parameters #
################################################################################
coldkey = default
validator_hotkey = validator
miner_hotkey = miner
netuid = $(testnet_netuid)
network = $(testnet)
```

### .env Files
Copy the example `.env` files and edit all desired values:
Copy the example `.env` files and edit all desired values. If you are running a validator, you will only need to copy the .env.validator file. If you are running a miner, you will only need to copy the .env.miner file:

#### .env.validator
```
cp .env.validator.example .env.validator
```
Edit `.env.validator` with your desired values.

```
# Network Configuration
# Options: localnet, testnet, finney
NETWORK=testnet
# Wallet Configuration
COLDKEY=your_validator_coldkey
VALIDATOR_HOTKEY=your_validator_hotkey
# Node Configuration
VALIDATOR_NAME=validator
VALIDATOR_PORT=8091
# Logging
# Options: info, debug, trace
LOGGING_LEVEL=debug
```

#### .env.miner
```
cp .env.miner.example .env.miner
```
Edit `.env.miner` with your desired values.

### Wandb
Wandb integration is planned for mainnet launch and does not currently work.
```# Network Configuration
# Options: localnet, testnet, finney
NETWORK=testnet
# Wallet Configuration
COLDKEY=your_miner_coldkey
MINER_HOTKEY=your_miner_hotkey
# Node Configuration
MINER_NAME=miner
# This port must be open to accept incoming TCP connections.
MINER_PORT=8092
# Miner Settings
TIMEOUT=16
VPERMIT_TAO_LIMIT=2
#Adjust this function if you would like to specify a custom forward function
FORWARD_FUNCTION=base_miner
# Logging
# Options: info, debug, trace
LOGGING_LEVEL=debug
```

---
## Deployment

### Registering a Hotkey
Once you have configured your .env files as per the instructions above, you can register a miner with `make register ENV_FILE=.env.miner` or register a validator with `make register ENV_FILE=.env.validator`.

### Running a Miner
Base miner:
1. Run the command:
Expand Down
5 changes: 5 additions & 0 deletions docs/Release Notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release Notes
=============

1.0.0
-----
Released on January 14th 2025
- Release to mainnet

0.3.0
-----
Released on January 7th 2025
Expand Down
Loading

0 comments on commit 3be11b9

Please sign in to comment.