bittensor-cli 9.0.0rc4__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.0rc4"
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()
@@ -2960,24 +2969,24 @@ class CLIManager:
2960
2969
  )
2961
2970
 
2962
2971
  if include_hotkeys:
2963
- included_hotkeys = parse_to_list(
2972
+ include_hotkeys = parse_to_list(
2964
2973
  include_hotkeys,
2965
2974
  str,
2966
2975
  "Hotkeys must be a comma-separated list of ss58s, e.g., `--include-hotkeys 5Grw....,5Grw....`.",
2967
2976
  is_ss58=True,
2968
2977
  )
2969
2978
  else:
2970
- included_hotkeys = []
2979
+ include_hotkeys = []
2971
2980
 
2972
2981
  if exclude_hotkeys:
2973
- excluded_hotkeys = parse_to_list(
2982
+ exclude_hotkeys = parse_to_list(
2974
2983
  exclude_hotkeys,
2975
2984
  str,
2976
2985
  "Hotkeys must be a comma-separated list of ss58s, e.g., `--exclude-hotkeys 5Grw....,5Grw....`.",
2977
2986
  is_ss58=True,
2978
2987
  )
2979
2988
  else:
2980
- excluded_hotkeys = []
2989
+ exclude_hotkeys = []
2981
2990
 
2982
2991
  # TODO: Ask amount for each subnet explicitly if more than one
2983
2992
  if not stake_all and not amount:
@@ -3017,8 +3026,8 @@ class CLIManager:
3017
3026
  amount,
3018
3027
  prompt,
3019
3028
  all_hotkeys,
3020
- included_hotkeys,
3021
- excluded_hotkeys,
3029
+ include_hotkeys,
3030
+ exclude_hotkeys,
3022
3031
  safe_staking,
3023
3032
  rate_tolerance,
3024
3033
  allow_partial_stake,
@@ -3126,32 +3135,32 @@ class CLIManager:
3126
3135
  if interactive and any(
3127
3136
  [hotkey_ss58_address, include_hotkeys, exclude_hotkeys, all_hotkeys]
3128
3137
  ):
3129
- err_console.print(
3138
+ print_error(
3130
3139
  "Interactive mode cannot be used with hotkey selection options like --include-hotkeys, --exclude-hotkeys, --all-hotkeys, or --hotkey."
3131
3140
  )
3132
3141
  raise typer.Exit()
3133
3142
 
3134
3143
  if unstake_all and unstake_all_alpha:
3135
- err_console.print("Cannot specify both unstake-all and unstake-all-alpha.")
3144
+ print_error("Cannot specify both unstake-all and unstake-all-alpha.")
3136
3145
  raise typer.Exit()
3137
3146
 
3138
3147
  if not interactive and not unstake_all and not unstake_all_alpha:
3139
3148
  netuid = get_optional_netuid(netuid, all_netuids)
3140
3149
  if all_hotkeys and include_hotkeys:
3141
- err_console.print(
3150
+ print_error(
3142
3151
  "You have specified hotkeys to include and also the `--all-hotkeys` flag. The flag"
3143
3152
  " should only be used standalone (to use all hotkeys) or with `--exclude-hotkeys`."
3144
3153
  )
3145
3154
  raise typer.Exit()
3146
3155
 
3147
3156
  if include_hotkeys and exclude_hotkeys:
3148
- err_console.print(
3157
+ print_error(
3149
3158
  "You have specified both including and excluding hotkeys options. Select one or the other."
3150
3159
  )
3151
3160
  raise typer.Exit()
3152
3161
 
3153
3162
  if unstake_all and amount:
3154
- err_console.print(
3163
+ print_error(
3155
3164
  "Cannot specify both a specific amount and 'unstake-all'. Choose one or the other."
3156
3165
  )
3157
3166
  raise typer.Exit()
@@ -3265,24 +3274,20 @@ class CLIManager:
3265
3274
  )
3266
3275
 
3267
3276
  if include_hotkeys:
3268
- included_hotkeys = parse_to_list(
3277
+ include_hotkeys = parse_to_list(
3269
3278
  include_hotkeys,
3270
3279
  str,
3271
3280
  "Hotkeys must be a comma-separated list of ss58s or names, e.g., `--include-hotkeys hk1,hk2`.",
3272
3281
  is_ss58=False,
3273
3282
  )
3274
- else:
3275
- included_hotkeys = []
3276
3283
 
3277
3284
  if exclude_hotkeys:
3278
- excluded_hotkeys = parse_to_list(
3285
+ exclude_hotkeys = parse_to_list(
3279
3286
  exclude_hotkeys,
3280
3287
  str,
3281
3288
  "Hotkeys must be a comma-separated list of ss58s or names, e.g., `--exclude-hotkeys hk3,hk4`.",
3282
3289
  is_ss58=False,
3283
3290
  )
3284
- else:
3285
- excluded_hotkeys = []
3286
3291
 
3287
3292
  return self._run_command(
3288
3293
  remove_stake.unstake(
@@ -3290,8 +3295,8 @@ class CLIManager:
3290
3295
  subtensor=self.initialize_chain(network),
3291
3296
  hotkey_ss58_address=hotkey_ss58_address,
3292
3297
  all_hotkeys=all_hotkeys,
3293
- include_hotkeys=included_hotkeys,
3294
- exclude_hotkeys=excluded_hotkeys,
3298
+ include_hotkeys=include_hotkeys,
3299
+ exclude_hotkeys=exclude_hotkeys,
3295
3300
  amount=amount,
3296
3301
  prompt=prompt,
3297
3302
  interactive=interactive,
@@ -3745,7 +3750,6 @@ class CLIManager:
3745
3750
  [],
3746
3751
  "--proportions",
3747
3752
  "--prop",
3748
- "-p",
3749
3753
  help="Enter the stake weight proportions for the child hotkeys (sum should be less than or equal to 1)",
3750
3754
  prompt=False,
3751
3755
  ),
@@ -3753,9 +3757,10 @@ class CLIManager:
3753
3757
  wait_for_finalization: bool = Options.wait_for_finalization,
3754
3758
  quiet: bool = Options.quiet,
3755
3759
  verbose: bool = Options.verbose,
3760
+ prompt: bool = Options.prompt,
3756
3761
  ):
3757
3762
  """
3758
- Set child hotkeys on specified subnets.
3763
+ Set child hotkeys on a specified subnet (or all). Overrides currently set children.
3759
3764
 
3760
3765
  Users can specify the 'proportion' to delegate to child hotkeys (ss58 address). The sum of proportions cannot be greater than 1.
3761
3766
 
@@ -3792,7 +3797,7 @@ class CLIManager:
3792
3797
  wallet_name,
3793
3798
  wallet_path,
3794
3799
  wallet_hotkey,
3795
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3800
+ ask_for=[WO.NAME, WO.HOTKEY],
3796
3801
  validate=WV.WALLET_AND_HOTKEY,
3797
3802
  )
3798
3803
  return self._run_command(
@@ -3804,6 +3809,7 @@ class CLIManager:
3804
3809
  proportions=proportions,
3805
3810
  wait_for_finalization=wait_for_finalization,
3806
3811
  wait_for_inclusion=wait_for_inclusion,
3812
+ prompt=prompt,
3807
3813
  )
3808
3814
  )
3809
3815
 
@@ -3829,9 +3835,10 @@ class CLIManager:
3829
3835
  wait_for_finalization: bool = Options.wait_for_finalization,
3830
3836
  quiet: bool = Options.quiet,
3831
3837
  verbose: bool = Options.verbose,
3838
+ prompt: bool = Options.prompt,
3832
3839
  ):
3833
3840
  """
3834
- Remove all children hotkeys on a specified subnet.
3841
+ Remove all children hotkeys on a specified subnet (or all).
3835
3842
 
3836
3843
  This command is used to remove delegated authority from all child hotkeys, removing their position and influence on the subnet.
3837
3844
 
@@ -3844,7 +3851,7 @@ class CLIManager:
3844
3851
  wallet_name,
3845
3852
  wallet_path,
3846
3853
  wallet_hotkey,
3847
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3854
+ ask_for=[WO.NAME, WO.HOTKEY],
3848
3855
  validate=WV.WALLET_AND_HOTKEY,
3849
3856
  )
3850
3857
  if all_netuids and netuid:
@@ -3863,6 +3870,7 @@ class CLIManager:
3863
3870
  netuid,
3864
3871
  wait_for_inclusion,
3865
3872
  wait_for_finalization,
3873
+ prompt=prompt,
3866
3874
  )
3867
3875
  )
3868
3876
 
@@ -3918,7 +3926,7 @@ class CLIManager:
3918
3926
  wallet_name,
3919
3927
  wallet_path,
3920
3928
  wallet_hotkey,
3921
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
3929
+ ask_for=[WO.NAME, WO.HOTKEY],
3922
3930
  validate=WV.WALLET_AND_HOTKEY,
3923
3931
  )
3924
3932
  if all_netuids and netuid:
@@ -3970,13 +3978,13 @@ class CLIManager:
3970
3978
  """
3971
3979
  self.verbosity_handler(quiet, verbose)
3972
3980
 
3973
- hyperparams = self._run_command(
3974
- sudo.get_hyperparameters(self.initialize_chain(network), netuid),
3975
- exit_early=False,
3976
- )
3977
-
3978
- if not hyperparams:
3979
- 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()
3980
3988
 
3981
3989
  if not param_name:
3982
3990
  hyperparam_list = [field.name for field in fields(SubnetHyperparameters)]
@@ -3991,6 +3999,16 @@ class CLIManager:
3991
3999
  )
3992
4000
  param_name = hyperparam_list[choice - 1]
3993
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
+
3994
4012
  if not param_value:
3995
4013
  param_value = Prompt.ask(
3996
4014
  f"Enter the new value for [{COLOR_PALETTE['GENERAL']['SUBHEADING']}]{param_name}[/{COLOR_PALETTE['GENERAL']['SUBHEADING']}] in the VALUE column format"
@@ -4060,7 +4078,9 @@ class CLIManager:
4060
4078
  [green]$[/green] btcli sudo proposals
4061
4079
  """
4062
4080
  self.verbosity_handler(quiet, verbose)
4063
- return self._run_command(sudo.proposals(self.initialize_chain(network)))
4081
+ return self._run_command(
4082
+ sudo.proposals(self.initialize_chain(network), verbose)
4083
+ )
4064
4084
 
4065
4085
  def sudo_senate_vote(
4066
4086
  self,
@@ -4438,6 +4458,7 @@ class CLIManager:
4438
4458
  validate=WV.WALLET_AND_HOTKEY,
4439
4459
  )
4440
4460
  identity = prompt_for_subnet_identity(
4461
+ current_identity={},
4441
4462
  subnet_name=subnet_name,
4442
4463
  github_repo=github_repo,
4443
4464
  subnet_contact=subnet_contact,
@@ -4468,6 +4489,118 @@ class CLIManager:
4468
4489
  verbose=verbose,
4469
4490
  )
4470
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
+
4471
4604
  def subnets_pow_register(
4472
4605
  self,
4473
4606
  wallet_name: Optional[str] = Options.wallet_name,
@@ -4515,6 +4648,7 @@ class CLIManager:
4515
4648
  "-tbp",
4516
4649
  help="Set the number of threads per block for CUDA.",
4517
4650
  ),
4651
+ prompt: bool = Options.prompt,
4518
4652
  ):
4519
4653
  """
4520
4654
  Register a neuron (a subnet validator or a subnet miner) using Proof of Work (POW).
@@ -4552,6 +4686,7 @@ class CLIManager:
4552
4686
  use_cuda,
4553
4687
  dev_id,
4554
4688
  threads_per_block,
4689
+ prompt=prompt,
4555
4690
  )
4556
4691
  )
4557
4692
 
@@ -4582,7 +4717,7 @@ class CLIManager:
4582
4717
  wallet_name,
4583
4718
  wallet_path,
4584
4719
  wallet_hotkey,
4585
- ask_for=[WO.NAME, WO.PATH, WO.HOTKEY],
4720
+ ask_for=[WO.NAME, WO.HOTKEY],
4586
4721
  validate=WV.WALLET_AND_HOTKEY,
4587
4722
  )
4588
4723
  return self._run_command(
@@ -4717,6 +4852,7 @@ class CLIManager:
4717
4852
  ),
4718
4853
  quiet: bool = Options.quiet,
4719
4854
  verbose: bool = Options.verbose,
4855
+ prompt: bool = Options.prompt,
4720
4856
  ):
4721
4857
  """
4722
4858
  Reveal weights for a specific subnet.
@@ -4788,6 +4924,7 @@ class CLIManager:
4788
4924
  weights,
4789
4925
  salt,
4790
4926
  __version_as_int__,
4927
+ prompt=prompt,
4791
4928
  )
4792
4929
  )
4793
4930
 
@@ -4813,6 +4950,7 @@ class CLIManager:
4813
4950
  ),
4814
4951
  quiet: bool = Options.quiet,
4815
4952
  verbose: bool = Options.verbose,
4953
+ prompt: bool = Options.prompt,
4816
4954
  ):
4817
4955
  """
4818
4956
 
@@ -4883,6 +5021,7 @@ class CLIManager:
4883
5021
  weights,
4884
5022
  salt,
4885
5023
  __version_as_int__,
5024
+ prompt=prompt,
4886
5025
  )
4887
5026
  )
4888
5027