diff --git a/Makefile b/Makefile index bb1c0fc..44b4b24 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ localnet_netuid = 1 logging_level = trace # options= ['info', 'debug', 'trace'] netuid = $(testnet_netuid) -network = test +network = $(testnet) ## User Parameters coldkey = default @@ -29,7 +29,7 @@ validator: --neuron.name validator \ --wallet.name $(coldkey) \ --wallet.hotkey $(validator_hotkey) \ - --network $(network) \ + --subtensor.network $(network) \ --axon.port 30335 \ --netuid $(netuid) \ --logging.level $(logging_level) @@ -39,7 +39,7 @@ miner: --neuron.name miner \ --wallet.name $(coldkey) \ --wallet.hotkey $(miner_hotkey) \ - --network $(network) \ + --subtensor.network $(network) \ --axon.port 30336 \ --netuid $(netuid) \ --logging.level $(logging_level) \ diff --git a/precog/utils/bittensor.py b/precog/utils/bittensor.py index 42790bc..7903a33 100644 --- a/precog/utils/bittensor.py +++ b/precog/utils/bittensor.py @@ -5,13 +5,15 @@ def setup_bittensor_objects(self): # if chain enpoint isn't set, use the network arg - if self.config.chain_endpoint is None: - self.config.chain_endpoint = bt.subtensor.determine_chain_endpoint_and_network(self.config.network)[1] + if self.config.subtensor.chain_endpoint is None: + self.config.subtensor.chain_endpoint = bt.subtensor.determine_chain_endpoint_and_network( + self.config.subtensor.network + )[1] else: # if chain endpoint is set, overwrite network arg - self.config.network = self.config.chain_endpoint + self.config.subtensor.network = self.config.subtensor.chain_endpoint # Initialize subtensor. - self.subtensor = bt.subtensor(config=self.config, network=self.config.network) + self.subtensor = bt.subtensor(config=self.config, network=self.config.subtensor.network) self.metagraph = self.subtensor.metagraph(self.config.netuid) self.wallet = bt.wallet(name=self.config.wallet.name, hotkey=self.config.wallet.hotkey) self.dendrite = bt.dendrite(wallet=self.wallet) diff --git a/precog/utils/general.py b/precog/utils/general.py index af17e3e..59b9fc2 100644 --- a/precog/utils/general.py +++ b/precog/utils/general.py @@ -27,9 +27,11 @@ def parse_arguments(parser: Optional[argparse.ArgumentParser] = None): """ if parser is None: parser = argparse.ArgumentParser(description="Configuration") - parser.add_argument("--chain_endpoint", type=str, default=None) # for testnet: wss://test.finney.opentensor.ai:443 parser.add_argument( - "--network", + "--subtensor.chain_endpoint", type=str, default=None + ) # for testnet: wss://test.finney.opentensor.ai:443 + parser.add_argument( + "--subtensor.network", choices=["finney", "test", "local"], default="finney", )