From 4c2b916a7bc46cab8e8cf06863794304686d586a Mon Sep 17 00:00:00 2001 From: Carro Date: Mon, 7 Aug 2023 12:07:13 -0500 Subject: [PATCH 1/2] create and serve the axon at startup so we can get the ip on the chain, then delete the axon --- openvalidators/neuron.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index 6ba439b..e6f4283 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -127,6 +127,13 @@ 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 + ).serve() + + del axon + # Dendrite pool for querying the network during training. bt.logging.debug("loading", "dendrite_pool") if self.config.neuron.mock_dendrite_pool: From e7dc5ab72ab92fbdd8832dd8442df0c9ffa33d18 Mon Sep 17 00:00:00 2001 From: Carro Date: Mon, 7 Aug 2023 12:13:33 -0500 Subject: [PATCH 2/2] fix old style of serving, appears that creating the axon object serves the ip --- openvalidators/neuron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvalidators/neuron.py b/openvalidators/neuron.py index e6f4283..d38be22 100644 --- a/openvalidators/neuron.py +++ b/openvalidators/neuron.py @@ -130,7 +130,7 @@ def __init__(self): bt.logging.debug('serving ip to chain...') axon = bt.axon( wallet=self.wallet, metagraph=self.metagraph, config=self.config - ).serve() + ) del axon