Skip to content

Commit

Permalink
Set archive network if network is not specified as well as if network…
Browse files Browse the repository at this point in the history
… specified as finney (through option or config)
  • Loading branch information
thewhaleking committed Sep 30, 2024
1 parent 104d554 commit 1d6c5fd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,9 @@ def set_config(
if valid_endpoint:
if valid_endpoint in Constants.network_map.values():
known_network = next(
key for key, value in Constants.network_map.items() if value == network
key
for key, value in Constants.network_map.items()
if value == network
)
args["network"] = known_network
if not Confirm.ask(
Expand Down Expand Up @@ -2802,7 +2804,7 @@ def root_my_delegates(
wallet_path,
wallet_hotkey,
ask_for=([WO.NAME] if not all_wallets else [WO.PATH]),
validate=WV.WALLET if not all_wallets else WV.NONE
validate=WV.WALLET if not all_wallets else WV.NONE,
)
self._run_command(
root.my_delegates(wallet, self.initialize_chain(network), all_wallets)
Expand Down Expand Up @@ -2860,17 +2862,17 @@ def root_list_delegates(
[green]$[/green] btcli root list_delegates --subtensor.network finney # can also be `test` or `local`
[blue bold]NOTE[/blue bold]: This commmand is intended for use within a
[blue bold]NOTE[/blue bold]: This command is intended for use within a
console application. It prints directly to the console and does not return any value.
"""
self.verbosity_handler(quiet, verbose)

if network:
if network == "finney":
network = "wss://archive.chain.opentensor.ai:443"
elif self.config.get("network"):
if self.config.get("network") == "finney":
network = "wss://archive.chain.opentensor.ai:443"
if network and network == "finney":
network = "wss://archive.chain.opentensor.ai:443"
elif self.config.get("network") == "finney":
network = "wss://archive.chain.opentensor.ai:443"
elif not network:
network = "wss://archive.chain.opentensor.ai:443"

sub = self.initialize_chain(network)
return self._run_command(root.list_delegates(sub))
Expand Down

0 comments on commit 1d6c5fd

Please sign in to comment.