bittensor-cli 9.8.5__tar.gz → 9.8.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/PKG-INFO +1 -1
  2. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/cli.py +51 -19
  3. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/__init__.py +3 -0
  4. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/utils.py +19 -14
  5. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/sudo.py +2 -1
  6. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/PKG-INFO +1 -1
  7. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/pyproject.toml +1 -1
  8. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/MANIFEST.in +0 -0
  9. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/README.md +0 -0
  10. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/__init__.py +0 -0
  11. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/doc_generation_helper.py +0 -0
  12. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/__init__.py +0 -0
  13. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/balances.py +0 -0
  14. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/chain_data.py +0 -0
  15. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/extrinsics/__init__.py +0 -0
  16. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/extrinsics/registration.py +0 -0
  17. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/extrinsics/root.py +0 -0
  18. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/extrinsics/transfer.py +0 -0
  19. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/minigraph.py +0 -0
  20. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/networking.py +0 -0
  21. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/subtensor_interface.py +0 -0
  22. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/main-filters.j2 +0 -0
  23. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/main-header.j2 +0 -0
  24. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/neuron-details.j2 +0 -0
  25. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/price-multi.j2 +0 -0
  26. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/price-single.j2 +0 -0
  27. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/subnet-details-header.j2 +0 -0
  28. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/subnet-details.j2 +0 -0
  29. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/subnet-metrics.j2 +0 -0
  30. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/subnets-table.j2 +0 -0
  31. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/table.j2 +0 -0
  32. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/view.css +0 -0
  33. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/view.j2 +0 -0
  34. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/bittensor/templates/view.js +0 -0
  35. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/__init__.py +0 -0
  36. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/liquidity/__init__.py +0 -0
  37. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/liquidity/liquidity.py +0 -0
  38. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/liquidity/utils.py +0 -0
  39. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/__init__.py +0 -0
  40. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/add.py +0 -0
  41. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/children_hotkeys.py +0 -0
  42. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/list.py +0 -0
  43. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/move.py +0 -0
  44. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/stake/remove.py +0 -0
  45. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/subnets/__init__.py +0 -0
  46. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/subnets/price.py +0 -0
  47. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/subnets/subnets.py +0 -0
  48. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/view.py +0 -0
  49. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/wallets.py +0 -0
  50. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/src/commands/weights.py +0 -0
  51. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli/version.py +0 -0
  52. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/SOURCES.txt +0 -0
  53. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/dependency_links.txt +0 -0
  54. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/entry_points.txt +0 -0
  55. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/requires.txt +0 -0
  56. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/bittensor_cli.egg-info/top_level.txt +0 -0
  57. {bittensor_cli-9.8.5 → bittensor_cli-9.8.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bittensor-cli
3
- Version: 9.8.5
3
+ Version: 9.8.7
4
4
  Summary: Bittensor CLI
5
5
  Author: bittensor.com
6
6
  Project-URL: homepage, https://github.com/opentensor/btcli
@@ -1070,7 +1070,8 @@ class CLIManager:
1070
1070
  not_selected_networks = [net for net in network if net != network_]
1071
1071
  if not_selected_networks:
1072
1072
  console.print(
1073
- f"Networks not selected: [dark_orange]{', '.join(not_selected_networks)}[/dark_orange]"
1073
+ f"Networks not selected: "
1074
+ f"[{COLORS.G.ARG}]{', '.join(not_selected_networks)}[/{COLORS.G.ARG}]"
1074
1075
  )
1075
1076
 
1076
1077
  self.subtensor = SubtensorInterface(network_)
@@ -1353,8 +1354,8 @@ class CLIManager:
1353
1354
  if n := args.get("network"):
1354
1355
  if n in Constants.networks:
1355
1356
  if not Confirm.ask(
1356
- f"You provided a network [dark_orange]{n}[/dark_orange] which is mapped to "
1357
- f"[dark_orange]{Constants.network_map[n]}[/dark_orange]\n"
1357
+ f"You provided a network [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}] which is mapped to "
1358
+ f"[{COLORS.G.ARG}]{Constants.network_map[n]}[/{COLORS.G.ARG}]\n"
1358
1359
  "Do you want to continue?"
1359
1360
  ):
1360
1361
  typer.Exit()
@@ -1369,14 +1370,14 @@ class CLIManager:
1369
1370
  )
1370
1371
  args["network"] = known_network
1371
1372
  if not Confirm.ask(
1372
- f"You provided an endpoint [dark_orange]{n}[/dark_orange] which is mapped to "
1373
- f"[dark_orange]{known_network}[/dark_orange]\n"
1373
+ f"You provided an endpoint [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}] which is mapped to "
1374
+ f"[{COLORS.G.ARG}]{known_network}[/{COLORS.G.ARG}]\n"
1374
1375
  "Do you want to continue?"
1375
1376
  ):
1376
- typer.Exit()
1377
+ raise typer.Exit()
1377
1378
  else:
1378
1379
  if not Confirm.ask(
1379
- f"You provided a chain endpoint URL [dark_orange]{n}[/dark_orange]\n"
1380
+ f"You provided a chain endpoint URL [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}]\n"
1380
1381
  "Do you want to continue?"
1381
1382
  ):
1382
1383
  raise typer.Exit()
@@ -1451,15 +1452,15 @@ class CLIManager:
1451
1452
  for arg in args.keys():
1452
1453
  if self.config.get(arg) is not None:
1453
1454
  if Confirm.ask(
1454
- f"Do you want to clear the [dark_orange]{arg}[/dark_orange] config?"
1455
+ f"Do you want to clear the [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config?"
1455
1456
  ):
1456
1457
  self.config[arg] = None
1457
1458
  console.print(
1458
- f"Cleared [dark_orange]{arg}[/dark_orange] config and set to 'None'."
1459
+ f"Cleared [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config and set to 'None'."
1459
1460
  )
1460
1461
  else:
1461
1462
  console.print(
1462
- f"Skipped clearing [dark_orange]{arg}[/dark_orange] config."
1463
+ f"Skipped clearing [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config."
1463
1464
  )
1464
1465
 
1465
1466
  else:
@@ -1468,19 +1469,21 @@ class CLIManager:
1468
1469
  if should_clear:
1469
1470
  if self.config.get(arg) is not None:
1470
1471
  if Confirm.ask(
1471
- f"Do you want to clear the [dark_orange]{arg}[/dark_orange] [bold cyan]({self.config.get(arg)})[/bold cyan] config?"
1472
+ f"Do you want to clear the [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}]"
1473
+ f" [bold cyan]({self.config.get(arg)})[/bold cyan] config?"
1472
1474
  ):
1473
1475
  self.config[arg] = None
1474
1476
  console.print(
1475
- f"Cleared [dark_orange]{arg}[/dark_orange] config and set to 'None'."
1477
+ f"Cleared [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config and set to 'None'."
1476
1478
  )
1477
1479
  else:
1478
1480
  console.print(
1479
- f"Skipped clearing [dark_orange]{arg}[/dark_orange] config."
1481
+ f"Skipped clearing [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config."
1480
1482
  )
1481
1483
  else:
1482
1484
  console.print(
1483
- f"No config set for [dark_orange]{arg}[/dark_orange]. Use `btcli config set` to set it."
1485
+ f"No config set for [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}]."
1486
+ f" Use [{COLORS.G.ARG}]`btcli config set`[/{COLORS.G.ARG}] to set it."
1484
1487
  )
1485
1488
  with open(self.config_path, "w") as f:
1486
1489
  safe_dump(self.config, f)
@@ -1492,7 +1495,7 @@ class CLIManager:
1492
1495
  deprecated_configs = ["chain"]
1493
1496
 
1494
1497
  table = Table(
1495
- Column("[bold white]Name", style="dark_orange"),
1498
+ Column("[bold white]Name", style=f"{COLORS.G.ARG}"),
1496
1499
  Column("[bold white]Value", style="gold1"),
1497
1500
  Column("", style="medium_purple"),
1498
1501
  box=box.SIMPLE_HEAD,
@@ -4594,7 +4597,9 @@ class CLIManager:
4594
4597
  "Param name not supplied with `--no-prompt` flag. Cannot continue"
4595
4598
  )
4596
4599
  return False
4597
- hyperparam_list = [field.name for field in fields(SubnetHyperparameters)]
4600
+ hyperparam_list = sorted(
4601
+ [field.name for field in fields(SubnetHyperparameters)]
4602
+ )
4598
4603
  console.print("Available hyperparameters:\n")
4599
4604
  for idx, param in enumerate(hyperparam_list, start=1):
4600
4605
  console.print(f" {idx}. {param}")
@@ -4609,17 +4614,44 @@ class CLIManager:
4609
4614
  if param_name in ["alpha_high", "alpha_low"]:
4610
4615
  if not prompt:
4611
4616
  err_console.print(
4612
- "`alpha_high` and `alpha_low` values cannot be set with `--no-prompt`"
4617
+ f"[{COLORS.SU.HYPERPARAM}]alpha_high[/{COLORS.SU.HYPERPARAM}] and "
4618
+ f"[{COLORS.SU.HYPERPARAM}]alpha_low[/{COLORS.SU.HYPERPARAM}] "
4619
+ f"values cannot be set with `--no-prompt`"
4613
4620
  )
4614
4621
  return False
4615
4622
  param_name = "alpha_values"
4616
4623
  low_val = FloatPrompt.ask(
4617
- "Enter the new value for [dark_orange]alpha_low[/dark_orange]"
4624
+ f"Enter the new value for [{COLORS.G.ARG}]alpha_low[/{COLORS.G.ARG}]"
4618
4625
  )
4619
4626
  high_val = FloatPrompt.ask(
4620
- "Enter the new value for [dark_orange]alpha_high[/dark_orange]"
4627
+ f"Enter the new value for [{COLORS.G.ARG}]alpha_high[/{COLORS.G.ARG}]"
4621
4628
  )
4622
4629
  param_value = f"{low_val},{high_val}"
4630
+ if param_name == "yuma_version":
4631
+ if not prompt:
4632
+ err_console.print(
4633
+ f"[{COLORS.SU.HYPERPARAM}]yuma_version[/{COLORS.SU.HYPERPARAM}]"
4634
+ f" is set using a different hyperparameter, and thus cannot be set with `--no-prompt`"
4635
+ )
4636
+ return False
4637
+ if Confirm.ask(
4638
+ f"[{COLORS.SU.HYPERPARAM}]yuma_version[/{COLORS.SU.HYPERPARAM}] can only be used to toggle Yuma 3. "
4639
+ f"Would you like to toggle Yuma 3?"
4640
+ ):
4641
+ param_name = "yuma3_enabled"
4642
+ question = Prompt.ask(
4643
+ "Would to like to enable or disable Yuma 3?",
4644
+ choices=["enable", "disable"],
4645
+ )
4646
+ param_value = "true" if question == "enable" else "false"
4647
+ else:
4648
+ return False
4649
+ if param_name == "subnet_is_active":
4650
+ err_console.print(
4651
+ f"[{COLORS.SU.HYPERPARAM}]subnet_is_active[/{COLORS.SU.HYPERPARAM}] "
4652
+ f"is set by using [{COLORS.G.ARG}]`btcli subnets start`[/{COLORS.G.ARG}] command."
4653
+ )
4654
+ return False
4623
4655
 
4624
4656
  if not param_value:
4625
4657
  if not prompt:
@@ -661,6 +661,8 @@ HYPERPARAMS = {
661
661
  "yuma3_enabled": ("sudo_set_yuma3_enabled", False),
662
662
  "alpha_sigmoid_steepness": ("sudo_set_alpha_sigmoid_steepness", True),
663
663
  "user_liquidity_enabled": ("toggle_user_liquidity", False),
664
+ "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", False),
665
+ "transfers_enabled": ("sudo_set_toggle_transfer", False),
664
666
  }
665
667
 
666
668
  HYPERPARAMS_MODULE = {
@@ -747,6 +749,7 @@ class ColorPalette(Gettable):
747
749
  NETUID = "#CBA880" # Tan
748
750
  NETUID_EXTRA = "#DDD5A9" # Light Khaki
749
751
  TEMPO = "#67A3A5" # Grayish Teal
752
+ ARG = "dark_orange"
750
753
  # aliases
751
754
  CK = COLDKEY
752
755
  HK = HOTKEY
@@ -622,20 +622,23 @@ def decode_hex_identity_dict(info_dictionary) -> dict[str, Any]:
622
622
 
623
623
  Examples:
624
624
  input_dict = {
625
- ... "name": {"value": "0x6a6f686e"},
626
- ... "additional": [
627
- ... [{"data": "0x64617461"}]
628
- ... ]
629
- ... }
625
+ "name": {"value": "0x6a6f686e"},
626
+ "additional": [
627
+ {"data1": "0x64617461"},
628
+ ("data2", "0x64617461")
629
+ ]
630
+ }
630
631
  decode_hex_identity_dict(input_dict)
631
- {'name': 'john', 'additional': [('data', 'data')]}
632
+ {'name': 'john', 'additional': [('data1', 'data'), ('data2', 'data')]}
632
633
  """
633
634
 
634
- def get_decoded(data: str) -> str:
635
+ def get_decoded(data: Optional[str]) -> str:
635
636
  """Decodes a hex-encoded string."""
637
+ if data is None:
638
+ return ""
636
639
  try:
637
640
  return hex_to_bytes(data).decode()
638
- except UnicodeDecodeError:
641
+ except (UnicodeDecodeError, ValueError):
639
642
  print(f"Could not decode: {key}: {item}")
640
643
 
641
644
  for key, value in info_dictionary.items():
@@ -651,12 +654,14 @@ def decode_hex_identity_dict(info_dictionary) -> dict[str, Any]:
651
654
  if key == "additional":
652
655
  additional = []
653
656
  for item in value:
654
- additional.append(
655
- tuple(
656
- get_decoded(data=next(iter(sub_item.values())))
657
- for sub_item in item
658
- )
659
- )
657
+ if isinstance(item, dict):
658
+ for k, v in item.items():
659
+ additional.append((k, get_decoded(v)))
660
+ else:
661
+ if isinstance(item, (tuple, list)) and len(item) == 2:
662
+ k_, v = item
663
+ k = k_ if k_ is not None else ""
664
+ additional.append((k, get_decoded(v)))
660
665
  info_dictionary[key] = additional
661
666
 
662
667
  return info_dictionary
@@ -671,7 +671,8 @@ async def get_hyperparameters(
671
671
  dict_out = []
672
672
 
673
673
  normalized_values = normalize_hyperparameters(subnet, json_output=json_output)
674
- for param, value, norm_value in normalized_values:
674
+ sorted_values = sorted(normalized_values, key=lambda x: x[0])
675
+ for param, value, norm_value in sorted_values:
675
676
  if not json_output:
676
677
  table.add_row(" " + param, value, norm_value)
677
678
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bittensor-cli
3
- Version: 9.8.5
3
+ Version: 9.8.7
4
4
  Summary: Bittensor CLI
5
5
  Author: bittensor.com
6
6
  Project-URL: homepage, https://github.com/opentensor/btcli
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bittensor-cli"
7
- version = "9.8.5"
7
+ version = "9.8.7"
8
8
  description = "Bittensor CLI"
9
9
  readme = "README.md"
10
10
  authors = [
File without changes
File without changes
File without changes