Skip to content

Commit

Permalink
Merge pull request #67 from foundryservices/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
hayden-yuma authored Jan 8, 2025
2 parents f83c3e9 + 69f6cd1 commit bb3f9e4
Show file tree
Hide file tree
Showing 8 changed files with 802 additions and 593 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ venv/
ENV/
env.bak/
venv.bak/
# branch specific environments that start with issue number
.[0-9]*-*

# Spyder project settings
.spyderproject
Expand Down Expand Up @@ -166,3 +168,5 @@ timestamp.txt
# localnet config
miner.config.local.js
validator.config.local.js

local_data/
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
################################################################################
# User Parameters #
################################################################################
coldkey = default
validator_hotkey = validator
miner_hotkey = miner
netuid = $(testnet_netuid)
network = $(testnet)
logging_level = info # options= ['info', 'debug', 'trace']
# coldkey = validator
coldkey = miner
validator_hotkey = default
miner_hotkey = default
netuid = $(localnet_netuid)
network = $(localnet)
logging_level = debug # options= ['info', 'debug', 'trace']


################################################################################
# Network Parameters #
################################################################################
finney = wss://entrypoint-finney.opentensor.ai:443
testnet = wss://test.finney.opentensor.ai:443
locanet = ws://127.0.0.1:9944
localnet = ws://127.0.0.1:9945

finney_netuid = 28
testnet_netuid = 93
testnet_netuid = 272
localnet_netuid = 1


Expand All @@ -41,7 +42,7 @@ validator:
--subtensor.chain_endpoint $(network) \
--axon.port 8091 \
--netuid $(netuid) \
--logging.level $(logging_level)
--logging.$(logging_level)

miner:
pm2 start python --name miner -- ./snp_oracle/neurons/miner.py \
Expand All @@ -50,7 +51,8 @@ miner:
--subtensor.chain_endpoint $(network) \
--axon.port 8092 \
--netuid $(netuid) \
--logging.level $(logging_level) \
--logging.$(logging_level) \
--vpermit_tao_limit 2 \
--hf_repo_id foundryservices/bittensor-sn28-base-lstm \
--blacklist.force_validator_permit true \
--hf_repo_id foundryservices/mining_models \
--model mining_models/base_lstm_new.h5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div align="center">

| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 93 <br> **Mainnet UID:** 28 |
| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 272 <br> **Mainnet UID:** 28 |
| - | - |

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/miners.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div align="center">

| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 93 <br> **Mainnet UID:** 28 |
| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 272 <br> **Mainnet UID:** 28 |
| - | - |

</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/validators.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center">

| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 93 <br> **Mainnet UID:** 28 |
| This repository is the official codebase<br>for Bittensor Subnet 28 (SN28) v1.0.0+,<br>which was released on February 20th 2024. | **Testnet UID:** 272 <br> **Mainnet UID:** 28 |
| - | - |

</div>
Expand Down
1,323 changes: 758 additions & 565 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ readme = "README.md"
python = ">3.9.1,<3.12"

# Bittensor Version Strict
bittensor = "7.4.0"
bittensor = "8.5.1"

# Bittensor Dependencies We Also Need
setuptools = "~70.0.0"
pydantic = "^2.3.0"
numpy = "^1.26"
numpy = ">=2.0.1,<2.1.0"

# Subnet Specific Dependencies
torch = "^2.5.1"
Expand All @@ -35,7 +35,7 @@ pandas-market-calendars = "^4.4.2"
python-dotenv = "^1.0.1"
scikit-learn = "^1.6.0"
wandb = "^0.19.1"
cryptography = ">=42.0.5,<42.1.0"
cryptography = ">=43.0.1,<43.1.0"

[tool.poetry.group.dev.dependencies]
pre-commit-hooks = "5.0.0"
Expand Down
32 changes: 21 additions & 11 deletions snp_oracle/neurons/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,27 @@ def print_info(self):
metagraph = self.metagraph
self.uid = self.metagraph.hotkeys.index(self.wallet.hotkey.ss58_address)

log = (
"Validator | "
f"Step:{self.step} | "
f"UID:{self.uid} | "
f"Block:{self.block} | "
f"Stake:{metagraph.S[self.uid]} | "
f"VTrust:{metagraph.Tv[self.uid]} | "
f"Dividend:{metagraph.D[self.uid]} | "
f"Emission:{metagraph.E[self.uid]}"
)
bt.logging.info(log)
# Get all values in one go to avoid multiple concurrent requests
try:
current_block = self.block # Single websocket call
stake = float(metagraph.S[self.uid])
vtrust = float(metagraph.Tv[self.uid])
dividend = float(metagraph.D[self.uid])
emission = float(metagraph.E[self.uid])

log = (
"Validator | "
f"Step:{self.step} | "
f"UID:{self.uid} | "
f"Block:{current_block} | "
f"Stake:{stake:.4f} | "
f"VTrust:{vtrust:.4f} | "
f"Dividend:{dividend:.4f} | "
f"Emission:{emission:.4f}"
)
bt.logging.info(log)
except Exception as e:
bt.logging.error(f"Error getting validator info: {e}")


# The main function parses the configuration and runs the validator.
Expand Down

0 comments on commit bb3f9e4

Please sign in to comment.