From b2d745ed50033c3a9dce31fd3eba582c788fdc39 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 15 May 2025 16:44:17 +0200 Subject: [PATCH 1/5] Prints failures that arise from subnet register in cases of non-json-output --- bittensor_cli/src/commands/subnets/subnets.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bittensor_cli/src/commands/subnets/subnets.py b/bittensor_cli/src/commands/subnets/subnets.py index fd050bd0a..5e043029f 100644 --- a/bittensor_cli/src/commands/subnets/subnets.py +++ b/bittensor_cli/src/commands/subnets/subnets.py @@ -1668,6 +1668,9 @@ async def register( ) if json_output: json_console.print(json.dumps({"success": success, "msg": msg})) + else: + if not success: + err_console.print(f"Failure: {msg}") # TODO: Confirm emissions, incentive, Dividends are to be fetched from subnet_state or keep NeuronInfo From e07fd6722500505a8388bd5956c4d61927e6aa78 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 15 May 2025 16:44:35 +0200 Subject: [PATCH 2/5] Passes prompt to register extrinsics --- bittensor_cli/src/commands/subnets/subnets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bittensor_cli/src/commands/subnets/subnets.py b/bittensor_cli/src/commands/subnets/subnets.py index 5e043029f..260c132cb 100644 --- a/bittensor_cli/src/commands/subnets/subnets.py +++ b/bittensor_cli/src/commands/subnets/subnets.py @@ -1656,13 +1656,15 @@ async def register( return if netuid == 0: - success, msg = await root_register_extrinsic(subtensor, wallet=wallet) + success, msg = await root_register_extrinsic( + subtensor, wallet=wallet, prompt=prompt + ) else: success, msg = await burned_register_extrinsic( subtensor, wallet=wallet, netuid=netuid, - prompt=False, + prompt=prompt, old_balance=balance, era=era, ) From 6fc5c67b16bf32d9b5c7f42aaade596ca68489be Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Thu, 15 May 2025 16:46:43 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Removed=20`prompt`=20arg=20in=20`root=5Freg?= =?UTF-8?q?ister=5Fextrinsic`=20&=20`burned=5Fregister=5Fextrinsic`=20?= =?UTF-8?q?=E2=80=94=20it=20is=20already=20handled=20in=20`subnets.registe?= =?UTF-8?q?r`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bittensor_cli/src/bittensor/extrinsics/registration.py | 1 - bittensor_cli/src/bittensor/extrinsics/root.py | 1 - bittensor_cli/src/commands/subnets/subnets.py | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/bittensor_cli/src/bittensor/extrinsics/registration.py b/bittensor_cli/src/bittensor/extrinsics/registration.py index 2632a69de..c230f1134 100644 --- a/bittensor_cli/src/bittensor/extrinsics/registration.py +++ b/bittensor_cli/src/bittensor/extrinsics/registration.py @@ -678,7 +678,6 @@ async def burned_register_extrinsic( wait_for_inclusion: bool = True, wait_for_finalization: bool = True, era: Optional[int] = None, - prompt: bool = False, ) -> tuple[bool, str]: """Registers the wallet to chain by recycling TAO. diff --git a/bittensor_cli/src/bittensor/extrinsics/root.py b/bittensor_cli/src/bittensor/extrinsics/root.py index aca5f07d1..d8d4900aa 100644 --- a/bittensor_cli/src/bittensor/extrinsics/root.py +++ b/bittensor_cli/src/bittensor/extrinsics/root.py @@ -290,7 +290,6 @@ async def root_register_extrinsic( wallet: Wallet, wait_for_inclusion: bool = True, wait_for_finalization: bool = True, - prompt: bool = False, ) -> tuple[bool, str]: r"""Registers the wallet to root network. diff --git a/bittensor_cli/src/commands/subnets/subnets.py b/bittensor_cli/src/commands/subnets/subnets.py index 260c132cb..c8bba8436 100644 --- a/bittensor_cli/src/commands/subnets/subnets.py +++ b/bittensor_cli/src/commands/subnets/subnets.py @@ -1656,15 +1656,12 @@ async def register( return if netuid == 0: - success, msg = await root_register_extrinsic( - subtensor, wallet=wallet, prompt=prompt - ) + success, msg = await root_register_extrinsic(subtensor, wallet=wallet) else: success, msg = await burned_register_extrinsic( subtensor, wallet=wallet, netuid=netuid, - prompt=prompt, old_balance=balance, era=era, ) From b12b9b6821d7c64f127da7676678e21290905f51 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 21 May 2025 15:10:43 -0700 Subject: [PATCH 4/5] remove references to non-existent fields, add a clear error message --- bittensor_cli/src/commands/wallets.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bittensor_cli/src/commands/wallets.py b/bittensor_cli/src/commands/wallets.py index 006fb5119..ae6a01ab8 100644 --- a/bittensor_cli/src/commands/wallets.py +++ b/bittensor_cli/src/commands/wallets.py @@ -438,11 +438,10 @@ async def wallet_create( "name": wallet.name, "path": wallet.path, "hotkey": wallet.hotkey_str, - "hotkey_ss58": wallet.hotkey.ss58_address, "coldkey_ss58": wallet.coldkeypub.ss58_address, } - except KeyFileError: - err = "KeyFileError: File is not writable" + except KeyFileError as error: + err = str(error) print_error(err) output_dict["error"] = err try: @@ -458,10 +457,9 @@ async def wallet_create( "path": wallet.path, "hotkey": wallet.hotkey_str, "hotkey_ss58": wallet.hotkey.ss58_address, - "coldkey_ss58": wallet.coldkeypub.ss58_address, } - except KeyFileError: - err = "KeyFileError: File is not writable" + except KeyFileError as error: + err = str(error) print_error(err) output_dict["error"] = err if json_output: From 2375ab244ad39d381e4110250832330fb7eb6daa Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Thu, 22 May 2025 12:35:43 -0700 Subject: [PATCH 5/5] Bumps changelog --- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be2bc9ade..18bfb4041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 9.4.2 /2025-04-22 + +## What's Changed +* Subnets Register Improvements by @thewhaleking in https://github.com/opentensor/btcli/pull/450 +* Fix `KeyFileError: File is not writable` during `btcli wallet create` command by @basfroman in https://github.com/opentensor/btcli/pull/452 + +**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.4.1...v9.4.2 + ## 9.4.1 /2025-04-17 ## What's Changed diff --git a/pyproject.toml b/pyproject.toml index 240c6f892..453f1ac1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "bittensor-cli" -version = "9.4.1" +version = "9.4.2" description = "Bittensor CLI" readme = "README.md" authors = [