bittensor-cli 9.0.0rc3__py3-none-any.whl → 9.0.1__py3-none-any.whl

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.
bittensor_cli/cli.py CHANGED
@@ -72,7 +72,7 @@ except ImportError:
72
72
  pass
73
73
 
74
74
 
75
- __version__ = "9.0.0rc3"
75
+ __version__ = "9.0.1"
76
76
 
77
77
 
78
78
  _core_version = re.match(r"^\d+\.\d+\.\d+", __version__).group(0)
@@ -141,22 +141,15 @@ class Options:
141
141
  use_password = typer.Option(
142
142
  True,
143
143
  help="Set this to `True` to protect the generated Bittensor key with a password.",
144
- is_flag=True,
145
- flag_value=False,
146
144
  )
147
145
  public_hex_key = typer.Option(None, help="The public key in hex format.")
148
146
  ss58_address = typer.Option(
149
147
  None, "--ss58", "--ss58-address", help="The SS58 address of the coldkey."
150
148
  )
151
- overwrite_coldkey = typer.Option(
149
+ overwrite = typer.Option(
152
150
  False,
153
- help="Overwrite the old coldkey with the newly generated coldkey.",
154
- prompt=True,
155
- )
156
- overwrite_hotkey = typer.Option(
157
- False,
158
- help="Overwrite the old hotkey with the newly generated hotkey.",
159
- prompt=True,
151
+ "--overwrite/--no-overwrite",
152
+ help="Overwrite the existing wallet file with the new one.",
160
153
  )
161
154
  network = typer.Option(
162
155
  None,
@@ -663,7 +656,7 @@ class CLIManager:
663
656
  self.config_app.command("set")(self.set_config)
664
657
  self.config_app.command("get")(self.get_config)
665
658
  self.config_app.command("clear")(self.del_config)
666
- self.config_app.command("metagraph", hidden=True)(self.metagraph_config)
659
+ # self.config_app.command("metagraph", hidden=True)(self.metagraph_config)
667
660
 
668
661
  # wallet commands
669
662
  self.wallet_app.command(
@@ -811,6 +804,12 @@ class CLIManager:
811
804
  self.subnets_app.command(
812
805
  "price", rich_help_panel=HELP_PANELS["SUBNETS"]["INFO"]
813
806
  )(self.subnets_price)
807
+ self.subnets_app.command(
808
+ "set-identity", rich_help_panel=HELP_PANELS["SUBNETS"]["IDENTITY"]
809
+ )(self.subnets_set_identity)
810
+ self.subnets_app.command(
811
+ "get-identity", rich_help_panel=HELP_PANELS["SUBNETS"]["IDENTITY"]
812
+ )(self.subnets_get_identity)
814
813
 
815
814
  # weights commands
816
815
  self.weights_app.command(
@@ -970,13 +969,13 @@ class CLIManager:
970
969
  finally:
971
970
  if initiated is False:
972
971
  asyncio.create_task(cmd).cancel()
973
- if exit_early is True:
972
+ if (
973
+ exit_early is True
974
+ ): # temporarily to handle multiple run commands in one session
974
975
  try:
975
976
  raise typer.Exit()
976
977
  except Exception as e: # ensures we always exit cleanly
977
- if not isinstance(
978
- e, (typer.Exit, RuntimeError)
979
- ): # temporarily to handle multiple run commands in one session
978
+ if not isinstance(e, (typer.Exit, RuntimeError)):
980
979
  err_console.print(f"An unknown error has occurred: {e}")
981
980
 
982
981
  return self.asyncio_runner(_run())
@@ -1563,7 +1562,7 @@ class CLIManager:
1563
1562
  """
1564
1563
  Displays all the wallets and their corresponding hotkeys that are located in the wallet path specified in the config.
1565
1564
 
1566
- The output display shows each wallet and its associated `ss58` addresses for the coldkey public key and any hotkeys. The output is presented in a hierarchical tree format, with each wallet as a root node and any associated hotkeys as child nodes. The `ss58` address is displayed for each coldkey and hotkey that is not encrypted and exists on the device.
1565
+ The output display shows each wallet and its associated `ss58` addresses for the coldkey public key and any hotkeys. The output is presented in a hierarchical tree format, with each wallet as a root node and any associated hotkeys as child nodes. The `ss58` address (or an `<ENCRYPTED>` marker, for encrypted hotkeys) is displayed for each coldkey and hotkey that exists on the device.
1567
1566
 
1568
1567
  Upon invocation, the command scans the wallet directory and prints a list of all the wallets, indicating whether the
1569
1568
  public keys are available (`?` denotes unavailable or encrypted keys).
@@ -1648,7 +1647,7 @@ class CLIManager:
1648
1647
  "Netuids must be a comma-separated list of ints, e.g., `--netuids 1,2,3,4`.",
1649
1648
  )
1650
1649
 
1651
- ask_for = [WO.NAME, WO.PATH] if not all_wallets else [WO.PATH]
1650
+ ask_for = [WO.NAME] if not all_wallets else []
1652
1651
  validate = WV.WALLET if not all_wallets else WV.NONE
1653
1652
  wallet = self.wallet_ask(
1654
1653
  wallet_name, wallet_path, wallet_hotkey, ask_for=ask_for, validate=validate
@@ -1696,9 +1695,11 @@ class CLIManager:
1696
1695
  None,
1697
1696
  "--amount",
1698
1697
  "-a",
1699
- prompt=True,
1700
1698
  help="Amount (in TAO) to transfer.",
1701
1699
  ),
1700
+ transfer_all: bool = typer.Option(
1701
+ False, "--all", prompt=False, help="Transfer all available balance."
1702
+ ),
1702
1703
  wallet_name: str = Options.wallet_name,
1703
1704
  wallet_path: str = Options.wallet_path,
1704
1705
  wallet_hotkey: str = Options.wallet_hotkey,
@@ -1734,20 +1735,25 @@ class CLIManager:
1734
1735
  wallet_name,
1735
1736
  wallet_path,
1736
1737
  wallet_hotkey,
1737
- ask_for=[WO.NAME, WO.PATH],
1738
+ ask_for=[WO.NAME],
1738
1739
  validate=WV.WALLET,
1739
1740
  )
1740
-
1741
- # For Rao games - temporarily commented out
1742
- # effective_network = get_effective_network(self.config, network)
1743
- # if is_rao_network(effective_network):
1744
- # print_error("This command is disabled on the 'rao' network.")
1745
- # raise typer.Exit()
1746
-
1747
1741
  subtensor = self.initialize_chain(network)
1742
+ if transfer_all and amount:
1743
+ print_error("Cannot specify an amount and '--all' flag.")
1744
+ raise typer.Exit()
1745
+ elif transfer_all:
1746
+ amount = 0
1747
+ elif not amount:
1748
+ amount = FloatPrompt.ask("Enter amount (in TAO) to transfer.")
1748
1749
  return self._run_command(
1749
1750
  wallets.transfer(
1750
- wallet, subtensor, destination_ss58_address, amount, prompt
1751
+ wallet,
1752
+ subtensor,
1753
+ destination_ss58_address,
1754
+ amount,
1755
+ transfer_all,
1756
+ prompt,
1751
1757
  )
1752
1758
  )
1753
1759
 
@@ -1933,6 +1939,7 @@ class CLIManager:
1933
1939
  "--max-successes",
1934
1940
  help="Set the maximum number of times to successfully run the faucet for this command.",
1935
1941
  ),
1942
+ prompt: bool = Options.prompt,
1936
1943
  ):
1937
1944
  """
1938
1945
  Obtain test TAO tokens by performing Proof of Work (PoW).
@@ -1971,6 +1978,7 @@ class CLIManager:
1971
1978
  output_in_place,
1972
1979
  verbose,
1973
1980
  max_successes,
1981
+ prompt,
1974
1982
  )
1975
1983
  )
1976
1984
 
@@ -1984,6 +1992,7 @@ class CLIManager:
1984
1992
  json: Optional[str] = Options.json,
1985
1993
  json_password: Optional[str] = Options.json_password,
1986
1994
  use_password: Optional[bool] = Options.use_password,
1995
+ overwrite: bool = Options.overwrite,
1987
1996
  quiet: bool = Options.quiet,
1988
1997
  verbose: bool = Options.verbose,
1989
1998
  ):
@@ -2030,6 +2039,7 @@ class CLIManager:
2030
2039
  json,
2031
2040
  json_password,
2032
2041
  use_password,
2042
+ overwrite,
2033
2043
  )
2034
2044
  )
2035
2045
 
@@ -2040,6 +2050,7 @@ class CLIManager:
2040
2050
  wallet_hotkey: Optional[str] = Options.wallet_hotkey,
2041
2051
  public_key_hex: Optional[str] = Options.public_hex_key,
2042
2052
  ss58_address: Optional[str] = Options.ss58_address,
2053
+ overwrite: bool = Options.overwrite,
2043
2054
  quiet: bool = Options.quiet,
2044
2055
  verbose: bool = Options.verbose,
2045
2056
  ):
@@ -2087,7 +2098,7 @@ class CLIManager:
2087
2098
  rich.print("[red]Error: Invalid SS58 address or public key![/red]")
2088
2099
  raise typer.Exit()
2089
2100
  return self._run_command(
2090
- wallets.regen_coldkey_pub(wallet, ss58_address, public_key_hex)
2101
+ wallets.regen_coldkey_pub(wallet, ss58_address, public_key_hex, overwrite)
2091
2102
  )
2092
2103
 
2093
2104
  def wallet_regen_hotkey(
@@ -2102,9 +2113,8 @@ class CLIManager:
2102
2113
  use_password: bool = typer.Option(
2103
2114
  False, # Overriden to False
2104
2115
  help="Set to 'True' to protect the generated Bittensor key with a password.",
2105
- is_flag=True,
2106
- flag_value=True,
2107
2116
  ),
2117
+ overwrite: bool = Options.overwrite,
2108
2118
  quiet: bool = Options.quiet,
2109
2119
  verbose: bool = Options.verbose,
2110
2120
  ):
@@ -2143,6 +2153,7 @@ class CLIManager:
2143
2153
  json,
2144
2154
  json_password,
2145
2155
  use_password,
2156
+ overwrite,
2146
2157
  )
2147
2158
  )
2148
2159
 
@@ -2160,10 +2171,9 @@ class CLIManager:
2160
2171
  use_password: bool = typer.Option(
2161
2172
  False, # Overriden to False
2162
2173
  help="Set to 'True' to protect the generated Bittensor key with a password.",
2163
- is_flag=True,
2164
- flag_value=True,
2165
2174
  ),
2166
2175
  uri: Optional[str] = Options.uri,
2176
+ overwrite: bool = Options.overwrite,
2167
2177
  quiet: bool = Options.quiet,
2168
2178
  verbose: bool = Options.verbose,
2169
2179
  ):
@@ -2204,7 +2214,9 @@ class CLIManager:
2204
2214
  )
2205
2215
  if not uri:
2206
2216
  n_words = get_n_words(n_words)
2207
- return self._run_command(wallets.new_hotkey(wallet, n_words, use_password, uri))
2217
+ return self._run_command(
2218
+ wallets.new_hotkey(wallet, n_words, use_password, uri, overwrite)
2219
+ )
2208
2220
 
2209
2221
  def wallet_new_coldkey(
2210
2222
  self,
@@ -2219,6 +2231,7 @@ class CLIManager:
2219
2231
  ),
2220
2232
  use_password: Optional[bool] = Options.use_password,
2221
2233
  uri: Optional[str] = Options.uri,
2234
+ overwrite: bool = Options.overwrite,
2222
2235
  quiet: bool = Options.quiet,
2223
2236
  verbose: bool = Options.verbose,
2224
2237
  ):
@@ -2258,7 +2271,7 @@ class CLIManager:
2258
2271
  if not uri:
2259
2272
  n_words = get_n_words(n_words)
2260
2273
  return self._run_command(
2261
- wallets.new_coldkey(wallet, n_words, use_password, uri)
2274
+ wallets.new_coldkey(wallet, n_words, use_password, uri, overwrite)
2262
2275
  )
2263
2276
 
2264
2277
  def wallet_check_ck_swap(
@@ -2294,6 +2307,7 @@ class CLIManager:
2294
2307
  n_words: Optional[int] = None,
2295
2308
  use_password: bool = Options.use_password,
2296
2309
  uri: Optional[str] = Options.uri,
2310
+ overwrite: bool = Options.overwrite,
2297
2311
  quiet: bool = Options.quiet,
2298
2312
  verbose: bool = Options.verbose,
2299
2313
  ):
@@ -2337,12 +2351,7 @@ class CLIManager:
2337
2351
  if not uri:
2338
2352
  n_words = get_n_words(n_words)
2339
2353
  return self._run_command(
2340
- wallets.wallet_create(
2341
- wallet,
2342
- n_words,
2343
- use_password,
2344
- uri,
2345
- )
2354
+ wallets.wallet_create(wallet, n_words, use_password, uri, overwrite)
2346
2355
  )
2347
2356
 
2348
2357
  def wallet_balance(
@@ -2873,7 +2882,7 @@ class CLIManager:
2873
2882
  netuid = get_optional_netuid(netuid, all_netuids)
2874
2883
 
2875
2884
  if stake_all and amount:
2876
- err_console.print(
2885
+ print_error(
2877
2886
  "Cannot specify an amount and 'stake-all'. Choose one or the other."
2878
2887
  )
2879
2888
  raise typer.Exit()
@@ -2883,14 +2892,14 @@ class CLIManager:
2883
2892
  raise typer.Exit()
2884
2893
 
2885
2894
  if all_hotkeys and include_hotkeys:
2886
- err_console.print(
2895
+ print_error(
2887
2896
  "You have specified hotkeys to include and also the `--all-hotkeys` flag. The flag"
2888
2897
  "should only be used standalone (to use all hotkeys) or with `--exclude-hotkeys`."
2889
2898
  )
2890
2899
  raise typer.Exit()
2891
2900
 
2892
2901
  if include_hotkeys and exclude_hotkeys:
2893
- err_console.print(
2902
+ print_error(
2894
2903
  "You have specified options for both including and excluding hotkeys. Select one or the other."
2895
2904
  )
2896
2905
  raise typer.Exit()
@@ -2919,6 +2928,7 @@ class CLIManager:
2919
2928
  subnets.show(
2920
2929
  subtensor=self.initialize_chain(network),
2921
2930
  netuid=netuid,
2931
+ sort=False,
2922
2932
  max_rows=12,
2923
2933
  prompt=False,
2924
2934
  delegate_selection=True,
@@ -2959,24 +2969,24 @@ class CLIManager:
2959
2969
  )
2960
2970
 
2961
2971
  if include_hotkeys:
2962
- included_hotkeys = parse_to_list(
2972
+ include_hotkeys = parse_to_list(
2963
2973
  include_hotkeys,
2964
2974
  str,
2965
2975
  "Hotkeys must be a comma-separated list of ss58s, e.g., `--include-hotkeys 5Grw....,5Grw....`.",
2966
2976
  is_ss58=True,
2967
2977
  )
2968
2978
  else:
2969
- included_hotkeys = []
2979
+ include_hotkeys = []
2970
2980
 
2971
2981
  if exclude_hotkeys:
2972
- excluded_hotkeys = parse_to_list(
2982
+ exclude_hotkeys = parse_to_list(
2973
2983
  exclude_hotkeys,
2974
2984
  str,
2975
2985
  "Hotkeys must be a comma-separated list of ss58s, e.g., `--exclude-hotkeys 5Grw....,5Grw....`.",
2976
2986
  is_ss58=True,
2977
2987
  )
2978
2988
  else:
2979
- excluded_hotkeys = []
2989
+ exclude_hotkeys = []
2980
2990
 
2981
2991
  # TODO: Ask amount for each subnet explicitly if more than one
2982
2992
  if not stake_all and not amount:
@@ -3016,8 +3026,8 @@ class CLIManager:
3016
3026
  amount,
3017
3027
  prompt,
3018
3028
  all_hotkeys,
3019
- included_hotkeys,
3020
- excluded_hotkeys,
3029
+ include_hotkeys,
3030
+ exclude_hotkeys,
3021
3031
  safe_staking,
3022
3032
  rate_tolerance,
3023
3033
  allow_partial_stake,
@@ -3125,32 +3135,32 @@ class CLIManager:
3125
3135
  if interactive and any(
3126
3136
  [hotkey_ss58_address, include_hotkeys, exclude_hotkeys, all_hotkeys]
3127
3137
  ):
3128
- err_console.print(
3138
+ print_error(
3129
3139
  "Interactive mode cannot be used with hotkey selection options like --include-hotkeys, --exclude-hotkeys, --all-hotkeys, or --hotkey."
3130
3140
  )
3131
3141
  raise typer.Exit()
3132
3142
 
3133
3143
  if unstake_all and unstake_all_alpha:
3134
- err_console.print("Cannot specify both unstake-all and unstake-all-alpha.")
3144
+ print_error("Cannot specify both unstake-all and unstake-all-alpha.")
3135
3145
  raise typer.Exit()
3136
3146
 
3137
3147
  if not interactive and not unstake_all and not unstake_all_alpha:
3138
3148
  netuid = get_optional_netuid(netuid, all_netuids)
3139
3149
  if all_hotkeys and include_hotkeys:
3140
- err_console.print(
3150
+ print_error(
3141
3151
  "You have specified hotkeys to include and also the `--all-hotkeys` flag. The flag"
3142
3152
  " should only be used standalone (to use all hotkeys) or with `--exclude-hotkeys`."
3143
3153
  )
3144
3154
  raise typer.Exit()
3145
3155
 
3146
3156
  if include_hotkeys and exclude_hotkeys:
3147
- err_console.print(
3157
+ print_error(
3148
3158
  "You have specified both including and excluding hotkeys options. Select one or the other."
3149
3159
  )
3150
3160
  raise typer.Exit()
3151
3161
 
3152
3162
  if unstake_all and amount:
3153
- err_console.print(
3163
+ print_error(
3154
3164
  "Cannot specify both a specific amount and 'unstake-all'. Choose one or the other."
3155
3165
  )
3156
3166
  raise typer.Exit()
@@ -3264,24 +3274,20 @@ class CLIManager:
3264
3274
  )
3265
3275
 
3266
3276
  if include_hotkeys:
3267
- included_hotkeys = parse_to_list(
3277
+ include_hotkeys = parse_to_list(
3268
3278
  include_hotkeys,
3269
3279
  str,
3270
3280
  "Hotkeys must be a comma-separated list of ss58s or names, e.g., `--include-hotkeys hk1,hk2`.",
3271
3281
  is_ss58=False,
3272
3282
  )
3273
- else:
3274
- included_hotkeys = []
3275
3283
 
3276
3284
  if exclude_hotkeys:
3277
- excluded_hotkeys = parse_to_list(
3285
+ exclude_hotkeys = parse_to_list(
3278
3286
  exclude_hotkeys,
3279
3287
  str,
3280
3288
  "Hotkeys must be a comma-separated list of ss58s or names, e.g., `--exclude-hotkeys hk3,hk4`.",
3281
3289
  is_ss58=False,
3282
3290
  )
3283
- else:
3284
- excluded_hotkeys = []
3285
3291
 
3286
3292
  return self._run_command(
3287
3293
  remove_stake.unstake(
@@ -3289,8 +3295,8 @@ class CLIManager:
3289
3295
  subtensor=self.initialize_chain(network),
3290
3296
  hotkey_ss58_address=hotkey_ss58_address,
3291
3297
  all_hotkeys=all_hotkeys,
3292
- include_hotkeys=included_hotkeys,
3293
- exclude_hotkeys=excluded_hotkeys,
3298
+ include_hotkeys=include_hotkeys,
3299
+ exclude_hotkeys=exclude_hotkeys,
3294
3300
  amount=amount,
3295
3301
  prompt=prompt,
3296
3302
  interactive=interactive,
@@ -3744,7 +3750,6 @@ class CLIManager:
3744
3750
  [],
3745
3751
  "--proportions",
3746
3752
  "--prop",
3747
- "-p",
3748
3753
  help="Enter the stake weight proportions for the child hotkeys (sum should be less than or equal to 1)",
3749
3754
  prompt=False,
3750
3755
  ),
@@ -3752,9 +3757,10 @@ class CLIManager:
3752
3757
  wait_for_finalization: bool = Options.wait_for_finalization,
3753
3758
  quiet: bool = Options.quiet,
3754
3759
  verbose: bool = Options.verbose,
3760
+ prompt: bool = Options.prompt,
3755
3761
  ):
3756
3762
  """
3757
- Set child hotkeys on specified subnets.
3763
+ Set child hotkeys on a specified subnet (or all). Overrides currently set children.
3758
3764
 
3759
3765
  Users can specify the 'proportion' to delegate to child hotkeys (ss58 address). The sum of proportions cannot be greater than 1.
3760
3766
 
@@ -3791,7 +3797,7 @@ class CLIManager:
3791
3797
  wallet_name,
3792
3798
  wallet_path,
3793
3799
  wallet_hotkey,
3794
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3800
+ ask_for=[WO.NAME, WO.HOTKEY],
3795
3801
  validate=WV.WALLET_AND_HOTKEY,
3796
3802
  )
3797
3803
  return self._run_command(
@@ -3803,6 +3809,7 @@ class CLIManager:
3803
3809
  proportions=proportions,
3804
3810
  wait_for_finalization=wait_for_finalization,
3805
3811
  wait_for_inclusion=wait_for_inclusion,
3812
+ prompt=prompt,
3806
3813
  )
3807
3814
  )
3808
3815
 
@@ -3828,9 +3835,10 @@ class CLIManager:
3828
3835
  wait_for_finalization: bool = Options.wait_for_finalization,
3829
3836
  quiet: bool = Options.quiet,
3830
3837
  verbose: bool = Options.verbose,
3838
+ prompt: bool = Options.prompt,
3831
3839
  ):
3832
3840
  """
3833
- Remove all children hotkeys on a specified subnet.
3841
+ Remove all children hotkeys on a specified subnet (or all).
3834
3842
 
3835
3843
  This command is used to remove delegated authority from all child hotkeys, removing their position and influence on the subnet.
3836
3844
 
@@ -3843,7 +3851,7 @@ class CLIManager:
3843
3851
  wallet_name,
3844
3852
  wallet_path,
3845
3853
  wallet_hotkey,
3846
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3854
+ ask_for=[WO.NAME, WO.HOTKEY],
3847
3855
  validate=WV.WALLET_AND_HOTKEY,
3848
3856
  )
3849
3857
  if all_netuids and netuid:
@@ -3862,6 +3870,7 @@ class CLIManager:
3862
3870
  netuid,
3863
3871
  wait_for_inclusion,
3864
3872
  wait_for_finalization,
3873
+ prompt=prompt,
3865
3874
  )
3866
3875
  )
3867
3876
 
@@ -3917,7 +3926,7 @@ class CLIManager:
3917
3926
  wallet_name,
3918
3927
  wallet_path,
3919
3928
  wallet_hotkey,
3920
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3929
+ ask_for=[WO.NAME, WO.HOTKEY],
3921
3930
  validate=WV.WALLET_AND_HOTKEY,
3922
3931
  )
3923
3932
  if all_netuids and netuid:
@@ -3969,13 +3978,13 @@ class CLIManager:
3969
3978
  """
3970
3979
  self.verbosity_handler(quiet, verbose)
3971
3980
 
3972
- hyperparams = self._run_command(
3973
- sudo.get_hyperparameters(self.initialize_chain(network), netuid),
3974
- exit_early=False,
3975
- )
3976
-
3977
- if not hyperparams:
3978
- raise typer.Exit()
3981
+ if not param_name or not param_value:
3982
+ hyperparams = self._run_command(
3983
+ sudo.get_hyperparameters(self.initialize_chain(network), netuid),
3984
+ exit_early=False,
3985
+ )
3986
+ if not hyperparams:
3987
+ raise typer.Exit()
3979
3988
 
3980
3989
  if not param_name:
3981
3990
  hyperparam_list = [field.name for field in fields(SubnetHyperparameters)]
@@ -3990,6 +3999,16 @@ class CLIManager:
3990
3999
  )
3991
4000
  param_name = hyperparam_list[choice - 1]
3992
4001
 
4002
+ if param_name in ["alpha_high", "alpha_low"]:
4003
+ param_name = "alpha_values"
4004
+ low_val = FloatPrompt.ask(
4005
+ "Enter the new value for [dark_orange]alpha_low[/dark_orange]"
4006
+ )
4007
+ high_val = FloatPrompt.ask(
4008
+ "Enter the new value for [dark_orange]alpha_high[/dark_orange]"
4009
+ )
4010
+ param_value = f"{low_val},{high_val}"
4011
+
3993
4012
  if not param_value:
3994
4013
  param_value = Prompt.ask(
3995
4014
  f"Enter the new value for [{COLOR_PALETTE['GENERAL']['SUBHEADING']}]{param_name}[/{COLOR_PALETTE['GENERAL']['SUBHEADING']}] in the VALUE column format"
@@ -4059,7 +4078,9 @@ class CLIManager:
4059
4078
  [green]$[/green] btcli sudo proposals
4060
4079
  """
4061
4080
  self.verbosity_handler(quiet, verbose)
4062
- return self._run_command(sudo.proposals(self.initialize_chain(network)))
4081
+ return self._run_command(
4082
+ sudo.proposals(self.initialize_chain(network), verbose)
4083
+ )
4063
4084
 
4064
4085
  def sudo_senate_vote(
4065
4086
  self,
@@ -4327,6 +4348,11 @@ class CLIManager:
4327
4348
  self,
4328
4349
  network: Optional[list[str]] = Options.network,
4329
4350
  netuid: int = Options.netuid,
4351
+ sort: bool = typer.Option(
4352
+ False,
4353
+ "--sort",
4354
+ help="Sort the subnets by uid.",
4355
+ ),
4330
4356
  quiet: bool = Options.quiet,
4331
4357
  verbose: bool = Options.verbose,
4332
4358
  prompt: bool = Options.prompt,
@@ -4342,8 +4368,11 @@ class CLIManager:
4342
4368
  subtensor = self.initialize_chain(network)
4343
4369
  return self._run_command(
4344
4370
  subnets.show(
4345
- subtensor,
4346
- netuid,
4371
+ subtensor=subtensor,
4372
+ netuid=netuid,
4373
+ sort=sort,
4374
+ max_rows=None,
4375
+ delegate_selection=False,
4347
4376
  verbose=verbose,
4348
4377
  prompt=prompt,
4349
4378
  )
@@ -4429,6 +4458,7 @@ class CLIManager:
4429
4458
  validate=WV.WALLET_AND_HOTKEY,
4430
4459
  )
4431
4460
  identity = prompt_for_subnet_identity(
4461
+ current_identity={},
4432
4462
  subnet_name=subnet_name,
4433
4463
  github_repo=github_repo,
4434
4464
  subnet_contact=subnet_contact,
@@ -4459,6 +4489,118 @@ class CLIManager:
4459
4489
  verbose=verbose,
4460
4490
  )
4461
4491
 
4492
+ def subnets_get_identity(
4493
+ self,
4494
+ network: Optional[list[str]] = Options.network,
4495
+ netuid: int = Options.netuid,
4496
+ quiet: bool = Options.quiet,
4497
+ verbose: bool = Options.verbose,
4498
+ ):
4499
+ """
4500
+ Get the identity information for a subnet.
4501
+
4502
+ This command displays the identity information of a subnet including name, GitHub repo, contact details, etc.
4503
+
4504
+ [green]$[/green] btcli subnets get-identity --netuid 1
4505
+ """
4506
+ self.verbosity_handler(quiet, verbose)
4507
+ return self._run_command(
4508
+ subnets.get_identity(
4509
+ self.initialize_chain(network),
4510
+ netuid,
4511
+ )
4512
+ )
4513
+
4514
+ def subnets_set_identity(
4515
+ self,
4516
+ wallet_name: str = Options.wallet_name,
4517
+ wallet_path: str = Options.wallet_path,
4518
+ wallet_hotkey: str = Options.wallet_hotkey,
4519
+ network: Optional[list[str]] = Options.network,
4520
+ netuid: int = Options.netuid,
4521
+ subnet_name: Optional[str] = typer.Option(
4522
+ None, "--subnet-name", "--name", help="Name of the subnet"
4523
+ ),
4524
+ github_repo: Optional[str] = typer.Option(
4525
+ None, "--github-repo", "--repo", help="GitHub repository URL"
4526
+ ),
4527
+ subnet_contact: Optional[str] = typer.Option(
4528
+ None,
4529
+ "--subnet-contact",
4530
+ "--contact",
4531
+ "--email",
4532
+ help="Contact email for subnet",
4533
+ ),
4534
+ subnet_url: Optional[str] = typer.Option(
4535
+ None, "--subnet-url", "--url", help="Subnet URL"
4536
+ ),
4537
+ discord: Optional[str] = typer.Option(
4538
+ None, "--discord-handle", "--discord", help="Discord handle"
4539
+ ),
4540
+ description: Optional[str] = typer.Option(
4541
+ None, "--description", help="Description"
4542
+ ),
4543
+ additional_info: Optional[str] = typer.Option(
4544
+ None, "--additional-info", help="Additional information"
4545
+ ),
4546
+ prompt: bool = Options.prompt,
4547
+ quiet: bool = Options.quiet,
4548
+ verbose: bool = Options.verbose,
4549
+ ):
4550
+ """
4551
+ Set or update the identity information for a subnet.
4552
+
4553
+ This command allows subnet owners to set or update identity information like name, GitHub repo, contact details, etc.
4554
+
4555
+ [bold]Common Examples:[/bold]
4556
+
4557
+ 1. Interactive subnet identity setting:
4558
+ [green]$[/green] btcli subnets set-identity --netuid 1
4559
+
4560
+ 2. Set subnet identity with specific values:
4561
+ [green]$[/green] btcli subnets set-identity --netuid 1 --subnet-name MySubnet --github-repo https://github.com/myorg/mysubnet --subnet-contact team@mysubnet.net
4562
+ """
4563
+ self.verbosity_handler(quiet, verbose)
4564
+ wallet = self.wallet_ask(
4565
+ wallet_name,
4566
+ wallet_path,
4567
+ wallet_hotkey,
4568
+ ask_for=[WO.NAME],
4569
+ validate=WV.WALLET,
4570
+ )
4571
+
4572
+ current_identity = self._run_command(
4573
+ subnets.get_identity(
4574
+ self.initialize_chain(network),
4575
+ netuid,
4576
+ f"Current Subnet {netuid}'s Identity",
4577
+ ),
4578
+ exit_early=False,
4579
+ )
4580
+ if current_identity is None:
4581
+ raise typer.Exit()
4582
+
4583
+ identity = prompt_for_subnet_identity(
4584
+ current_identity=current_identity,
4585
+ subnet_name=subnet_name,
4586
+ github_repo=github_repo,
4587
+ subnet_contact=subnet_contact,
4588
+ subnet_url=subnet_url,
4589
+ discord=discord,
4590
+ description=description,
4591
+ additional=additional_info,
4592
+ )
4593
+
4594
+ return self._run_command(
4595
+ subnets.set_identity(
4596
+ wallet,
4597
+ self.initialize_chain(network),
4598
+ netuid,
4599
+ identity,
4600
+ prompt,
4601
+ )
4602
+ )
4603
+
4462
4604
  def subnets_pow_register(
4463
4605
  self,
4464
4606
  wallet_name: Optional[str] = Options.wallet_name,
@@ -4506,6 +4648,7 @@ class CLIManager:
4506
4648
  "-tbp",
4507
4649
  help="Set the number of threads per block for CUDA.",
4508
4650
  ),
4651
+ prompt: bool = Options.prompt,
4509
4652
  ):
4510
4653
  """
4511
4654
  Register a neuron (a subnet validator or a subnet miner) using Proof of Work (POW).
@@ -4543,6 +4686,7 @@ class CLIManager:
4543
4686
  use_cuda,
4544
4687
  dev_id,
4545
4688
  threads_per_block,
4689
+ prompt=prompt,
4546
4690
  )
4547
4691
  )
4548
4692
 
@@ -4573,7 +4717,7 @@ class CLIManager:
4573
4717
  wallet_name,
4574
4718
  wallet_path,
4575
4719
  wallet_hotkey,
4576
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
4720
+ ask_for=[WO.NAME, WO.HOTKEY],
4577
4721
  validate=WV.WALLET_AND_HOTKEY,
4578
4722
  )
4579
4723
  return self._run_command(
@@ -4708,6 +4852,7 @@ class CLIManager:
4708
4852
  ),
4709
4853
  quiet: bool = Options.quiet,
4710
4854
  verbose: bool = Options.verbose,
4855
+ prompt: bool = Options.prompt,
4711
4856
  ):
4712
4857
  """
4713
4858
  Reveal weights for a specific subnet.
@@ -4779,6 +4924,7 @@ class CLIManager:
4779
4924
  weights,
4780
4925
  salt,
4781
4926
  __version_as_int__,
4927
+ prompt=prompt,
4782
4928
  )
4783
4929
  )
4784
4930
 
@@ -4804,6 +4950,7 @@ class CLIManager:
4804
4950
  ),
4805
4951
  quiet: bool = Options.quiet,
4806
4952
  verbose: bool = Options.verbose,
4953
+ prompt: bool = Options.prompt,
4807
4954
  ):
4808
4955
  """
4809
4956
 
@@ -4874,6 +5021,7 @@ class CLIManager:
4874
5021
  weights,
4875
5022
  salt,
4876
5023
  __version_as_int__,
5024
+ prompt=prompt,
4877
5025
  )
4878
5026
  )
4879
5027