diff --git a/docs/running_availability_subnet.md b/docs/running_availability_subnet.md index a39e384..4e33e95 100644 --- a/docs/running_availability_subnet.md +++ b/docs/running_availability_subnet.md @@ -14,12 +14,17 @@ Your incentive mechanisms running on the mainnet are open to anyone. They emit r ## Infrastructure requirements -Network: Static ip address, open ports 9000 and 10000 -CPU: 2 cores -RAM: 4 GB -HDD: < 1 TB -Connection: 30+Mbps, Stable and low-latency connection -Software: Ubuntu 20.04 LTS / 22.04 LTS +- Network + - recommended static ip address + - open ports for miner (default: 10000) and validator (default: 9000) + - 10+Mbps connection, Stable and low-latency connection +- Hardware + - CPU: 2 cores + - RAM: 4 GB + - HDD: < 1 TB +- Software + - OS: Ubuntu 20.04 LTS / 22.04 LTS + - Python: >=3.9.6, <3.12 ## Steps diff --git a/requirements.txt b/requirements.txt index e84585c..1dccad3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -cybertensor>=0.2.1 +cybertensor>=0.2.2 torch \ No newline at end of file diff --git a/template/base/neuron.py b/template/base/neuron.py index af43040..4312422 100644 --- a/template/base/neuron.py +++ b/template/base/neuron.py @@ -128,7 +128,6 @@ def sync(self): """ # Ensure miner or validator hotkey is still registered on the network. self.check_registered() - self.metagraph.sync(cwtensor=self.cwtensor) if self.should_sync_metagraph(): self.resync_metagraph() @@ -155,6 +154,7 @@ def should_sync_metagraph(self): """ Check if enough epoch blocks have elapsed since the last checkpoint to sync. """ + self.metagraph.sync(cwtensor=self.cwtensor) return ( self.block - self.metagraph.last_update[self.uid] ) > self.config.neuron.epoch_length diff --git a/template/base/validator.py b/template/base/validator.py index 6ba3f81..4764c9f 100644 --- a/template/base/validator.py +++ b/template/base/validator.py @@ -372,8 +372,12 @@ def load_state(self): ct.logging.debug(f"Loading validator state from the {self.config.neuron.full_path + '/state.pt'}.") # Load the state of the validator from file. - state = torch.load(self.config.neuron.full_path + "/state.pt") - self.step = state["step"] - self.scores = state["scores"] - self.hotkeys = state["hotkeys"] - ct.logging.debug(f"Loaded validator state\t step: {self.step}\t scores: {self.scores}") + try: + state = torch.load(self.config.neuron.full_path + "/state.pt") + self.step = state["step"] + self.scores = state["scores"] + self.hotkeys = state["hotkeys"] + ct.logging.debug(f"Loaded validator state\t step: {self.step}\t scores: {self.scores}") + except FileNotFoundError: + self.step = 1 + ct.logging.debug(f"Instantiated validator state\t step: {self.step}\t")