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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.1.8 / 2023-08-12

## What's Changed
- Make sure to serve axon first by @camfairchild in 14921d35c


**Full Changelog**: https://github.com/opentensor/validators/compare/v1.1.7...v1.1.8


## 1.1.7 / 2023-08-11
### What’s Changed
- Hotfix cutoff limit by @Eugene-hu in #126
Expand Down
2 changes: 1 addition & 1 deletion openvalidators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
from . import weights
from . import event

__version__ = "1.1.7"
__version__ = "1.1.8"
version_split = __version__.split(".")
__spec_version__ = (1000 * int(version_split[0])) + (10 * int(version_split[1])) + (1 * int(version_split[2]))
10 changes: 10 additions & 0 deletions openvalidators/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def add_args(cls, parser):
default=4096,
)

parser.add_argument(
"--neuron.axon_off",
"--axon_off",
action="store_true",
# Note: the validator needs to serve an Axon with their IP or they may
# be blacklisted by the firewall of serving peers on the network.
help="Set this flag to not attempt to serve an Axon.",
default=False,
)

parser.add_argument("--wandb.off", action="store_true", help="Turn off wandb.", default=False)
parser.add_argument(
"--wandb.project_name",
Expand Down
29 changes: 24 additions & 5 deletions openvalidators/neuron.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,31 @@ def __init__(self):
self.gating_model = GatingModel(metagraph=self.metagraph, config=self.config).to(self.device)
bt.logging.debug(str(self.gating_model))

bt.logging.debug('serving ip to chain...')
axon = bt.axon(
wallet=self.wallet, metagraph=self.metagraph, config=self.config
)
if not self.config.neuron.axon_off:
bt.logging.debug('serving ip to chain...')
try:
axon = bt.axon(
wallet=self.wallet, metagraph=self.metagraph, config=self.config
)

try:
self.subtensor.serve_axon(
netuid=self.config.netuid,
axon=axon,
use_upnpc=False,
wait_for_finalization=True,
)
except Exception as e:
bt.logging.error(f'Failed to serve Axon with exception: {e}')
pass

del axon
except Exception as e:
bt.logging.error(f'Failed to create Axon initialize with exception: {e}')
pass

del axon
else:
bt.logging.debug('axon off, not serving ip to chain.')

# Dendrite pool for querying the network during training.
bt.logging.debug("loading", "dendrite_pool")
Expand Down