From 3e6cd9949da59158ee6abdebe5c3e13f151a6fff Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Tue, 22 Jul 2025 19:00:46 +0200 Subject: [PATCH 1/3] Brings the settable hyperparams in line with the hyperparams we retrieve from the chain. --- bittensor_cli/cli.py | 22 ++++++++++++++++++++++ bittensor_cli/src/__init__.py | 2 ++ 2 files changed, 24 insertions(+) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index fdf7ce2a2..7f1563332 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -4620,6 +4620,28 @@ def sudo_set( "Enter the new value for [dark_orange]alpha_high[/dark_orange]" ) param_value = f"{low_val},{high_val}" + if param_name == "yuma_version": + if not prompt: + err_console.print( + "`yuma_version` is set using a different hyperparameter, and thus cannot be set with `--no-prompt`" + ) + return False + if Confirm.ask( + "`yuma_version` can only be used to toggle Yuma 3. Would you like to toggle Yuma 3?" + ): + param_name = "yuma3_enabled" + question = Prompt.ask( + "Would to like to enable or disable Yuma 3?", + choices=["enable", "disable"], + ) + param_value = "true" if question == "enable" else "false" + else: + return False + if param_name == "subnet_is_active": + err_console.print( + "`subnet_is_active` is set by using `btcli subnets start`" + ) + return False if not param_value: if not prompt: diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index 6c178a818..53455dbc4 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -661,6 +661,8 @@ class WalletValidationTypes(Enum): "yuma3_enabled": ("sudo_set_yuma3_enabled", False), "alpha_sigmoid_steepness": ("sudo_set_alpha_sigmoid_steepness", True), "user_liquidity_enabled": ("toggle_user_liquidity", False), + "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", False), + "transfers_enabled": ("sudo_set_toggle_transfer", False), } HYPERPARAMS_MODULE = { From 9a5403deefda83228fdea991c2b63130f7a71e6b Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Tue, 22 Jul 2025 20:50:42 +0200 Subject: [PATCH 2/3] Updated colours --- bittensor_cli/cli.py | 40 +++++++++++++++++++---------------- bittensor_cli/src/__init__.py | 1 + 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 7f1563332..b5d00c356 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -1070,7 +1070,8 @@ def initialize_chain( not_selected_networks = [net for net in network if net != network_] if not_selected_networks: console.print( - f"Networks not selected: [dark_orange]{', '.join(not_selected_networks)}[/dark_orange]" + f"Networks not selected: " + f"[{COLORS.G.ARG}]{', '.join(not_selected_networks)}[/{COLORS.G.ARG}]" ) self.subtensor = SubtensorInterface(network_) @@ -1353,8 +1354,8 @@ def set_config( if n := args.get("network"): if n in Constants.networks: if not Confirm.ask( - f"You provided a network [dark_orange]{n}[/dark_orange] which is mapped to " - f"[dark_orange]{Constants.network_map[n]}[/dark_orange]\n" + f"You provided a network [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}] which is mapped to " + f"[{COLORS.G.ARG}]{Constants.network_map[n]}[/{COLORS.G.ARG}]\n" "Do you want to continue?" ): typer.Exit() @@ -1369,14 +1370,14 @@ def set_config( ) args["network"] = known_network if not Confirm.ask( - f"You provided an endpoint [dark_orange]{n}[/dark_orange] which is mapped to " - f"[dark_orange]{known_network}[/dark_orange]\n" + f"You provided an endpoint [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}] which is mapped to " + f"[{COLORS.G.ARG}]{known_network}[/{COLORS.G.ARG}]\n" "Do you want to continue?" ): - typer.Exit() + raise typer.Exit() else: if not Confirm.ask( - f"You provided a chain endpoint URL [dark_orange]{n}[/dark_orange]\n" + f"You provided a chain endpoint URL [{COLORS.G.ARG}]{n}[/{COLORS.G.ARG}]\n" "Do you want to continue?" ): raise typer.Exit() @@ -1451,15 +1452,15 @@ def del_config( for arg in args.keys(): if self.config.get(arg) is not None: if Confirm.ask( - f"Do you want to clear the [dark_orange]{arg}[/dark_orange] config?" + f"Do you want to clear the [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config?" ): self.config[arg] = None console.print( - f"Cleared [dark_orange]{arg}[/dark_orange] config and set to 'None'." + f"Cleared [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config and set to 'None'." ) else: console.print( - f"Skipped clearing [dark_orange]{arg}[/dark_orange] config." + f"Skipped clearing [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config." ) else: @@ -1468,19 +1469,21 @@ def del_config( if should_clear: if self.config.get(arg) is not None: if Confirm.ask( - f"Do you want to clear the [dark_orange]{arg}[/dark_orange] [bold cyan]({self.config.get(arg)})[/bold cyan] config?" + f"Do you want to clear the [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}]" + f" [bold cyan]({self.config.get(arg)})[/bold cyan] config?" ): self.config[arg] = None console.print( - f"Cleared [dark_orange]{arg}[/dark_orange] config and set to 'None'." + f"Cleared [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config and set to 'None'." ) else: console.print( - f"Skipped clearing [dark_orange]{arg}[/dark_orange] config." + f"Skipped clearing [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}] config." ) else: console.print( - f"No config set for [dark_orange]{arg}[/dark_orange]. Use `btcli config set` to set it." + f"No config set for [{COLORS.G.ARG}]{arg}[/{COLORS.G.ARG}]." + f" Use [{COLORS.G.ARG}]`btcli config set`[/{COLORS.G.ARG}] to set it." ) with open(self.config_path, "w") as f: safe_dump(self.config, f) @@ -1492,7 +1495,7 @@ def get_config(self): deprecated_configs = ["chain"] table = Table( - Column("[bold white]Name", style="dark_orange"), + Column("[bold white]Name", style=f"{COLORS.G.ARG}"), Column("[bold white]Value", style="gold1"), Column("", style="medium_purple"), box=box.SIMPLE_HEAD, @@ -4614,10 +4617,10 @@ def sudo_set( return False param_name = "alpha_values" low_val = FloatPrompt.ask( - "Enter the new value for [dark_orange]alpha_low[/dark_orange]" + f"Enter the new value for [{COLORS.G.ARG}]alpha_low[/{COLORS.G.ARG}]" ) high_val = FloatPrompt.ask( - "Enter the new value for [dark_orange]alpha_high[/dark_orange]" + f"Enter the new value for [{COLORS.G.ARG}]alpha_high[/{COLORS.G.ARG}]" ) param_value = f"{low_val},{high_val}" if param_name == "yuma_version": @@ -4639,7 +4642,8 @@ def sudo_set( return False if param_name == "subnet_is_active": err_console.print( - "`subnet_is_active` is set by using `btcli subnets start`" + f"[{COLORS.SU.HYPERPARAM}]subnet_is_active[/{COLORS.SU.HYPERPARAM}] " + f"is set by using [{COLORS.G.ARG}]`btcli subnets start`[/{COLORS.G.ARG}] command." ) return False diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index 53455dbc4..ebb01b433 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -749,6 +749,7 @@ class General(Gettable): NETUID = "#CBA880" # Tan NETUID_EXTRA = "#DDD5A9" # Light Khaki TEMPO = "#67A3A5" # Grayish Teal + ARG = "dark_orange" # aliases CK = COLDKEY HK = HOTKEY From 4b4a5599dfe94c8b28d653f3eafb701cea3d542e Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Tue, 22 Jul 2025 20:53:52 +0200 Subject: [PATCH 3/3] Updated colours --- bittensor_cli/cli.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index b5d00c356..7c9b96a10 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -4612,7 +4612,9 @@ def sudo_set( if param_name in ["alpha_high", "alpha_low"]: if not prompt: err_console.print( - "`alpha_high` and `alpha_low` values cannot be set with `--no-prompt`" + f"[{COLORS.SU.HYPERPARAM}]alpha_high[/{COLORS.SU.HYPERPARAM}] and " + f"[{COLORS.SU.HYPERPARAM}]alpha_low[/{COLORS.SU.HYPERPARAM}] " + f"values cannot be set with `--no-prompt`" ) return False param_name = "alpha_values" @@ -4626,11 +4628,13 @@ def sudo_set( if param_name == "yuma_version": if not prompt: err_console.print( - "`yuma_version` is set using a different hyperparameter, and thus cannot be set with `--no-prompt`" + f"[{COLORS.SU.HYPERPARAM}]yuma_version[/{COLORS.SU.HYPERPARAM}]" + f" is set using a different hyperparameter, and thus cannot be set with `--no-prompt`" ) return False if Confirm.ask( - "`yuma_version` can only be used to toggle Yuma 3. Would you like to toggle Yuma 3?" + f"[{COLORS.SU.HYPERPARAM}]yuma_version[/{COLORS.SU.HYPERPARAM}] can only be used to toggle Yuma 3. " + f"Would you like to toggle Yuma 3?" ): param_name = "yuma3_enabled" question = Prompt.ask(