You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Init sync with the network. Updates the metagraph.
71
-
self.sync()
72
-
73
70
# Serve axon to enable external connections.
74
71
ifnotself.config.neuron.axon_off:
75
72
self.serve_axon()
@@ -110,6 +107,14 @@ def serve_axon(self):
110
107
bt.logging.error(f"Failed to create Axon initialize with exception: {e}")
111
108
pass
112
109
110
+
@retry(
111
+
stop=stop_after_attempt(3), # Retry up to 3 times
112
+
wait=wait_fixed(1), # Wait 1 second between retries
113
+
retry=retry_if_result(
114
+
lambdaresult: resultisFalse
115
+
), # Retry if the result is False
116
+
after=print_on_retry
117
+
)
113
118
defset_weights(self):
114
119
"""
115
120
Sets the validator weights to the metagraph hotkeys based on the scores it has received from the miners. The weights determine the trust and incentive level the validator assigns to miner nodes on the network.
@@ -161,10 +166,9 @@ def set_weights(self):
161
166
wait_for_inclusion=False,
162
167
version_key=self.spec_version,
163
168
)
164
-
ifresultisTrue:
165
-
bt.logging.info("set_weights on chain successfully!")
166
-
else:
167
-
bt.logging.error("set_weights failed")
169
+
170
+
171
+
returnresult
168
172
169
173
defresync_metagraph(self):
170
174
"""Resyncs the metagraph and updates the hotkeys and moving averages based on the new metagraph."""
0 commit comments