bittensor-cli 9.21.0rc1__tar.gz → 9.21.2__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.
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/PKG-INFO +4 -9
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/cli.py +49 -150
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/__init__.py +2 -11
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/chain_data.py +9 -1
- bittensor_cli-9.21.2/bittensor_cli/src/bittensor/extrinsics/registration.py +286 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/extrinsics/root.py +47 -136
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/extrinsics/serving.py +23 -2
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/minigraph.py +62 -89
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/subtensor_interface.py +28 -9
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/utils.py +28 -83
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/move.py +52 -4
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/subnets/subnets.py +8 -8
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/sudo.py +122 -50
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/wallets.py +0 -32
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/weights.py +12 -38
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/pyproject.toml +5 -13
- bittensor_cli-9.21.0rc1/bittensor_cli/src/bittensor/extrinsics/registration.py +0 -1646
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/README.md +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/doc_generation_helper.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/balances.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/extrinsics/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/extrinsics/mev_shield.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/extrinsics/transfer.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/networking.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/main-filters.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/main-header.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/neuron-details.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/price-multi.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/price-single.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/subnet-details-header.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/subnet-details.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/subnet-metrics.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/subnets-table.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/table.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/view.css +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/view.j2 +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/bittensor/templates/view.js +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/axon/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/axon/axon.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/contribute.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/contributors.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/create.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/dissolve.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/refund.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/update.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/utils.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/crowd/view.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/liquidity/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/liquidity/liquidity.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/liquidity/utils.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/proxy.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/add.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/auto_staking.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/children_hotkeys.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/claim.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/list.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/remove.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/stake/wizard.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/subnets/__init__.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/subnets/mechanisms.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/subnets/price.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/src/commands/view.py +0 -0
- {bittensor_cli-9.21.0rc1 → bittensor_cli-9.21.2}/bittensor_cli/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bittensor-cli
|
|
3
|
-
Version: 9.21.
|
|
3
|
+
Version: 9.21.2
|
|
4
4
|
Summary: Bittensor CLI
|
|
5
5
|
Author: bittensor.com
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -18,29 +18,24 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
18
18
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
19
19
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
20
|
Classifier: Topic :: Utilities
|
|
21
|
-
Requires-Dist: wheel
|
|
22
|
-
Requires-Dist: async-substrate-interface
|
|
21
|
+
Requires-Dist: wheel>0.46.1
|
|
22
|
+
Requires-Dist: async-substrate-interface>=2.0.4,<3.0.0
|
|
23
23
|
Requires-Dist: aiohttp~=3.13
|
|
24
|
-
Requires-Dist: backoff~=2.2.1
|
|
25
24
|
Requires-Dist: bittensor-drand>=1.3.0
|
|
26
25
|
Requires-Dist: GitPython>=3.0.0
|
|
27
26
|
Requires-Dist: netaddr~=1.3.0
|
|
28
|
-
Requires-Dist: numpy>=2.0.1,<3.0.0
|
|
29
27
|
Requires-Dist: Jinja2
|
|
30
|
-
Requires-Dist: pycryptodome>=3.0.0,<4.0.0
|
|
31
28
|
Requires-Dist: PyYAML~=6.0
|
|
32
29
|
Requires-Dist: rich>=13.7,<15.0
|
|
33
|
-
Requires-Dist: cyscale>=0.3.
|
|
30
|
+
Requires-Dist: cyscale>=0.3.3,<1.0.0
|
|
34
31
|
Requires-Dist: typer>=0.16
|
|
35
32
|
Requires-Dist: typing_extensions>4.0.0; python_version<'3.11'
|
|
36
33
|
Requires-Dist: bittensor-wallet==4.0.1
|
|
37
34
|
Requires-Dist: packaging
|
|
38
35
|
Requires-Dist: plotille>=5.0.0
|
|
39
36
|
Requires-Dist: plotly>=6.0.0
|
|
40
|
-
Requires-Dist: torch>=1.13.1,<3.0 ; extra == "cuda"
|
|
41
37
|
Project-URL: Repository, https://github.com/opentensor/btcli
|
|
42
38
|
Project-URL: homepage, https://github.com/opentensor/btcli
|
|
43
|
-
Provides-Extra: cuda
|
|
44
39
|
|
|
45
40
|
<div align="center">
|
|
46
41
|
|
|
@@ -16,7 +16,6 @@ from dataclasses import fields
|
|
|
16
16
|
from pathlib import Path
|
|
17
17
|
from typing import Coroutine, Optional, Union
|
|
18
18
|
|
|
19
|
-
import numpy as np
|
|
20
19
|
import rich
|
|
21
20
|
import typer
|
|
22
21
|
from async_substrate_interface.errors import (
|
|
@@ -124,8 +123,6 @@ except ImportError:
|
|
|
124
123
|
logger = logging.getLogger("btcli")
|
|
125
124
|
_epilog = "Made with [bold red]:heart:[/bold red] by The Openτensor Foundaτion"
|
|
126
125
|
|
|
127
|
-
np.set_printoptions(precision=8, suppress=True, floatmode="fixed")
|
|
128
|
-
|
|
129
126
|
|
|
130
127
|
def arg__(arg_name: str) -> str:
|
|
131
128
|
"""
|
|
@@ -383,6 +380,7 @@ class Options:
|
|
|
383
380
|
None,
|
|
384
381
|
"--tolerance",
|
|
385
382
|
"--rate-tolerance",
|
|
383
|
+
"--limit",
|
|
386
384
|
help="Set the rate tolerance percentage for transactions (default: 0.05 for 5%).",
|
|
387
385
|
callback=validate_rate_tolerance,
|
|
388
386
|
)
|
|
@@ -585,7 +583,7 @@ def parse_mnemonic(mnemonic: str) -> str:
|
|
|
585
583
|
)
|
|
586
584
|
if int(items[0][0]) != 1:
|
|
587
585
|
print_error("Numbered mnemonics must begin with 1")
|
|
588
|
-
raise typer.Exit()
|
|
586
|
+
raise typer.Exit(1)
|
|
589
587
|
if [int(x[0]) for x in items] != list(
|
|
590
588
|
range(int(items[0][0]), int(items[-1][0]) + 1)
|
|
591
589
|
):
|
|
@@ -593,7 +591,7 @@ def parse_mnemonic(mnemonic: str) -> str:
|
|
|
593
591
|
"Missing or duplicate numbers in a numbered mnemonic. "
|
|
594
592
|
"Double-check your numbered mnemonics and try again."
|
|
595
593
|
)
|
|
596
|
-
raise typer.Exit()
|
|
594
|
+
raise typer.Exit(1)
|
|
597
595
|
response = " ".join(item[1] for item in items)
|
|
598
596
|
else:
|
|
599
597
|
response = mnemonic
|
|
@@ -639,7 +637,7 @@ def get_creation_data(
|
|
|
639
637
|
if json_path:
|
|
640
638
|
if not os.path.exists(json_path):
|
|
641
639
|
print_error(f"The JSON file '{json_path}' does not exist.")
|
|
642
|
-
raise typer.Exit()
|
|
640
|
+
raise typer.Exit(1)
|
|
643
641
|
|
|
644
642
|
if json_path and not json_password:
|
|
645
643
|
json_password = Prompt.ask(
|
|
@@ -747,7 +745,7 @@ def debug_callback(value: bool) -> None:
|
|
|
747
745
|
f"file was created using the {arg__('BTCLI_DEBUG_FILE')} environment variable, please set the value for"
|
|
748
746
|
f" the same location, and re-run this {arg__('btcli --debug')} command."
|
|
749
747
|
)
|
|
750
|
-
raise typer.Exit()
|
|
748
|
+
raise typer.Exit(1)
|
|
751
749
|
save_file_loc_ = Prompt.ask(
|
|
752
750
|
"Enter the file location to save the debug log for the previous command.",
|
|
753
751
|
default="~/.bittensor/debug-export",
|
|
@@ -1061,9 +1059,6 @@ class CLIManager:
|
|
|
1061
1059
|
rich_help_panel=HELP_PANELS["WALLET"]["INFORMATION"],
|
|
1062
1060
|
hidden=True,
|
|
1063
1061
|
)(self.wallet_inspect)
|
|
1064
|
-
self.wallet_app.command(
|
|
1065
|
-
"faucet", rich_help_panel=HELP_PANELS["WALLET"]["OPERATIONS"]
|
|
1066
|
-
)(self.wallet_faucet)
|
|
1067
1062
|
self.wallet_app.command(
|
|
1068
1063
|
"set-identity", rich_help_panel=HELP_PANELS["WALLET"]["IDENTITY"]
|
|
1069
1064
|
)(self.wallet_set_id)
|
|
@@ -1588,6 +1583,7 @@ class CLIManager:
|
|
|
1588
1583
|
f.write(
|
|
1589
1584
|
f"BTCLI {__version__}\n"
|
|
1590
1585
|
f"Async-Substrate-Interface: {importlib.metadata.version('async-substrate-interface')}\n"
|
|
1586
|
+
f"Cyscale: {importlib.metadata.version('cyscale')}\n"
|
|
1591
1587
|
f"Bittensor-Wallet: {importlib.metadata.version('bittensor-wallet')}\n"
|
|
1592
1588
|
f"Command: {' '.join(sys.argv)}\n"
|
|
1593
1589
|
f"Config: {self.config}\n"
|
|
@@ -1638,7 +1634,7 @@ class CLIManager:
|
|
|
1638
1634
|
)
|
|
1639
1635
|
if quiet and verbose:
|
|
1640
1636
|
print_error("Cannot specify both `--quiet` and `--verbose`")
|
|
1641
|
-
raise typer.Exit()
|
|
1637
|
+
raise typer.Exit(1)
|
|
1642
1638
|
if json_output and verbose:
|
|
1643
1639
|
verbosity_console_handler(3)
|
|
1644
1640
|
elif json_output or quiet:
|
|
@@ -1837,7 +1833,7 @@ class CLIManager:
|
|
|
1837
1833
|
raise typer.Exit()
|
|
1838
1834
|
else:
|
|
1839
1835
|
print_error(f"{error}")
|
|
1840
|
-
raise typer.Exit()
|
|
1836
|
+
raise typer.Exit(1)
|
|
1841
1837
|
|
|
1842
1838
|
for arg, val in args.items():
|
|
1843
1839
|
if val is not None:
|
|
@@ -2028,7 +2024,7 @@ class CLIManager:
|
|
|
2028
2024
|
print_error(
|
|
2029
2025
|
f"Proxy {name} already exists. Use `btcli config update-proxy` to update it."
|
|
2030
2026
|
)
|
|
2031
|
-
raise typer.Exit()
|
|
2027
|
+
raise typer.Exit(1)
|
|
2032
2028
|
proxy_type_val: str
|
|
2033
2029
|
if isinstance(proxy_type, ProxyType):
|
|
2034
2030
|
proxy_type_val = proxy_type.value
|
|
@@ -2439,7 +2435,7 @@ class CLIManager:
|
|
|
2439
2435
|
|
|
2440
2436
|
if mechanism_count is None or mechanism_count <= 0:
|
|
2441
2437
|
print_error(f"Subnet {netuid} does not exist.")
|
|
2442
|
-
raise typer.Exit()
|
|
2438
|
+
raise typer.Exit(1)
|
|
2443
2439
|
|
|
2444
2440
|
if mechanism_id is not None:
|
|
2445
2441
|
if mechanism_id < 0 or mechanism_id >= mechanism_count:
|
|
@@ -2447,7 +2443,7 @@ class CLIManager:
|
|
|
2447
2443
|
f"Mechanism ID {mechanism_id} is out of range for subnet {netuid}. "
|
|
2448
2444
|
f"Valid range: [bold cyan]0 to {mechanism_count - 1}[/bold cyan]."
|
|
2449
2445
|
)
|
|
2450
|
-
raise typer.Exit()
|
|
2446
|
+
raise typer.Exit(1)
|
|
2451
2447
|
return mechanism_id
|
|
2452
2448
|
|
|
2453
2449
|
if mechanism_count == 1:
|
|
@@ -2546,14 +2542,14 @@ class CLIManager:
|
|
|
2546
2542
|
f"Error: Wallet does not exist. \n"
|
|
2547
2543
|
f"Please verify your wallet information: {wallet}"
|
|
2548
2544
|
)
|
|
2549
|
-
raise typer.Exit()
|
|
2545
|
+
raise typer.Exit(1)
|
|
2550
2546
|
|
|
2551
2547
|
if validate == WV.WALLET_AND_HOTKEY and not valid[1]:
|
|
2552
2548
|
print_error(
|
|
2553
2549
|
f"Error: Wallet '{wallet.name}' exists but the hotkey '{wallet.hotkey_str}' does not. \n"
|
|
2554
2550
|
f"Please verify your wallet information: {wallet}"
|
|
2555
2551
|
)
|
|
2556
|
-
raise typer.Exit()
|
|
2552
|
+
raise typer.Exit(1)
|
|
2557
2553
|
if return_wallet_and_hotkey:
|
|
2558
2554
|
valid = utils.is_valid_wallet(wallet)
|
|
2559
2555
|
if valid[1]:
|
|
@@ -2671,7 +2667,7 @@ class CLIManager:
|
|
|
2671
2667
|
print_error(
|
|
2672
2668
|
"You have specified both the inclusion and exclusion options. Only one of these options is allowed currently."
|
|
2673
2669
|
)
|
|
2674
|
-
raise typer.Exit()
|
|
2670
|
+
raise typer.Exit(1)
|
|
2675
2671
|
|
|
2676
2672
|
if netuids:
|
|
2677
2673
|
netuids = parse_to_list(
|
|
@@ -2781,7 +2777,7 @@ class CLIManager:
|
|
|
2781
2777
|
"""
|
|
2782
2778
|
if not is_valid_ss58_address(destination_ss58_address):
|
|
2783
2779
|
print_error("You have entered an incorrect ss58 address. Please try again.")
|
|
2784
|
-
raise typer.Exit()
|
|
2780
|
+
raise typer.Exit(1)
|
|
2785
2781
|
|
|
2786
2782
|
self.verbosity_handler(quiet, verbose, json_output, prompt)
|
|
2787
2783
|
proxy = self.is_valid_proxy_name_or_ss58(proxy, announce_only)
|
|
@@ -3041,112 +3037,6 @@ class CLIManager:
|
|
|
3041
3037
|
)
|
|
3042
3038
|
)
|
|
3043
3039
|
|
|
3044
|
-
def wallet_faucet(
|
|
3045
|
-
self,
|
|
3046
|
-
wallet_name: Optional[str] = Options.wallet_name,
|
|
3047
|
-
wallet_path: Optional[str] = Options.wallet_path,
|
|
3048
|
-
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
|
|
3049
|
-
network: Optional[list[str]] = Options.network,
|
|
3050
|
-
# TODO add the following to config
|
|
3051
|
-
processors: Optional[int] = typer.Option(
|
|
3052
|
-
defaults.pow_register.num_processes,
|
|
3053
|
-
"--processors",
|
|
3054
|
-
help="Number of processors to use for proof of work (POW) registration.",
|
|
3055
|
-
),
|
|
3056
|
-
update_interval: Optional[int] = typer.Option(
|
|
3057
|
-
defaults.pow_register.update_interval,
|
|
3058
|
-
"--update-interval",
|
|
3059
|
-
"-u",
|
|
3060
|
-
help="The number of nonces to process before checking for next block during registration",
|
|
3061
|
-
),
|
|
3062
|
-
output_in_place: Optional[bool] = typer.Option(
|
|
3063
|
-
defaults.pow_register.output_in_place,
|
|
3064
|
-
help="Whether to output the registration statistics in-place.",
|
|
3065
|
-
),
|
|
3066
|
-
verbose: Optional[bool] = typer.Option( # TODO verbosity handler
|
|
3067
|
-
defaults.pow_register.verbose,
|
|
3068
|
-
"--verbose",
|
|
3069
|
-
"-v",
|
|
3070
|
-
help="Whether to output the registration statistics verbosely.",
|
|
3071
|
-
),
|
|
3072
|
-
use_cuda: Optional[bool] = typer.Option(
|
|
3073
|
-
defaults.pow_register.cuda.use_cuda,
|
|
3074
|
-
"--use-cuda/--no-use-cuda",
|
|
3075
|
-
"--cuda/--no-cuda",
|
|
3076
|
-
help="Set flag to use CUDA for proof of work (POW) registration.",
|
|
3077
|
-
),
|
|
3078
|
-
dev_id: Optional[int] = typer.Option(
|
|
3079
|
-
defaults.pow_register.cuda.dev_id,
|
|
3080
|
-
"--dev-id",
|
|
3081
|
-
"-d",
|
|
3082
|
-
help="Set the CUDA device id(s) in the order of speed, where 0 is the fastest.",
|
|
3083
|
-
),
|
|
3084
|
-
threads_per_block: Optional[int] = typer.Option(
|
|
3085
|
-
defaults.pow_register.cuda.tpb,
|
|
3086
|
-
"--threads-per-block",
|
|
3087
|
-
"-tbp",
|
|
3088
|
-
help="Set the number of threads per block for CUDA.",
|
|
3089
|
-
),
|
|
3090
|
-
max_successes: Optional[int] = typer.Option(
|
|
3091
|
-
3,
|
|
3092
|
-
"--max-successes",
|
|
3093
|
-
help="Set the maximum number of times to successfully run the faucet for this command.",
|
|
3094
|
-
),
|
|
3095
|
-
prompt: bool = Options.prompt,
|
|
3096
|
-
):
|
|
3097
|
-
"""
|
|
3098
|
-
Obtain test TAO tokens by performing Proof of Work (PoW).
|
|
3099
|
-
|
|
3100
|
-
This command is useful for users who need test tokens for operations on a local blockchain.
|
|
3101
|
-
|
|
3102
|
-
[blue bold]IMPORTANT[/blue bold]: THIS COMMAND IS DISABLED ON FINNEY AND TESTNET.
|
|
3103
|
-
|
|
3104
|
-
USAGE
|
|
3105
|
-
|
|
3106
|
-
The command uses the proof-of-work (POW) mechanism to validate the user's effort and rewards them with test TAO tokens. It is
|
|
3107
|
-
typically used in local blockchain environments where transactions do not use real TAO tokens.
|
|
3108
|
-
|
|
3109
|
-
EXAMPLE
|
|
3110
|
-
|
|
3111
|
-
[green]$[/green] btcli wallet faucet --faucet.num_processes 4 --faucet.cuda.use_cuda
|
|
3112
|
-
|
|
3113
|
-
[bold]Note[/bold]: This command is meant for used in local environments where users can experiment with the blockchain without using real TAO tokens. Users must have the necessary hardware setup, especially when opting for CUDA-based GPU calculations. It is currently disabled on testnet and mainnet (finney). You can only use this command on a local blockchain.
|
|
3114
|
-
"""
|
|
3115
|
-
# TODO should we add json_output?
|
|
3116
|
-
wallet = self.wallet_ask(
|
|
3117
|
-
wallet_name,
|
|
3118
|
-
wallet_path,
|
|
3119
|
-
wallet_hotkey,
|
|
3120
|
-
ask_for=[WO.NAME, WO.PATH],
|
|
3121
|
-
validate=WV.WALLET,
|
|
3122
|
-
)
|
|
3123
|
-
logger.debug(
|
|
3124
|
-
"args:\n"
|
|
3125
|
-
f"network {network}\n"
|
|
3126
|
-
f"threads_per_block {threads_per_block}\n"
|
|
3127
|
-
f"update_interval {update_interval}\n"
|
|
3128
|
-
f"processors {processors}\n"
|
|
3129
|
-
f"use_cuda {use_cuda}\n"
|
|
3130
|
-
f"dev_id {dev_id}\n"
|
|
3131
|
-
f"output_in_place {output_in_place}\n"
|
|
3132
|
-
f"max_successes {max_successes}\n"
|
|
3133
|
-
)
|
|
3134
|
-
return self._run_command(
|
|
3135
|
-
wallets.faucet(
|
|
3136
|
-
wallet,
|
|
3137
|
-
self.initialize_chain(network),
|
|
3138
|
-
threads_per_block,
|
|
3139
|
-
update_interval,
|
|
3140
|
-
processors,
|
|
3141
|
-
use_cuda,
|
|
3142
|
-
dev_id,
|
|
3143
|
-
output_in_place,
|
|
3144
|
-
verbose,
|
|
3145
|
-
max_successes,
|
|
3146
|
-
prompt,
|
|
3147
|
-
)
|
|
3148
|
-
)
|
|
3149
|
-
|
|
3150
3040
|
def wallet_regen_coldkey(
|
|
3151
3041
|
self,
|
|
3152
3042
|
wallet_name: Optional[str] = Options.wallet_name,
|
|
@@ -3815,7 +3705,7 @@ class CLIManager:
|
|
|
3815
3705
|
if valid_ss58s:
|
|
3816
3706
|
ss58_addresses = valid_ss58s
|
|
3817
3707
|
else:
|
|
3818
|
-
raise typer.Exit()
|
|
3708
|
+
raise typer.Exit(1)
|
|
3819
3709
|
else:
|
|
3820
3710
|
if wallet_name:
|
|
3821
3711
|
coldkey_or_ss58 = wallet_name
|
|
@@ -3838,7 +3728,7 @@ class CLIManager:
|
|
|
3838
3728
|
if valid_ss58s:
|
|
3839
3729
|
ss58_addresses = valid_ss58s
|
|
3840
3730
|
else:
|
|
3841
|
-
raise typer.Exit()
|
|
3731
|
+
raise typer.Exit(1)
|
|
3842
3732
|
else:
|
|
3843
3733
|
wallet_name = (
|
|
3844
3734
|
coldkey_or_ss58_list[0] if coldkey_or_ss58_list else wallet_name
|
|
@@ -3897,7 +3787,7 @@ class CLIManager:
|
|
|
3897
3787
|
"This command is currently disabled as it used external APIs which are no longer "
|
|
3898
3788
|
"feasible; meanwhile a chain native data fetching solution is being investigated."
|
|
3899
3789
|
)
|
|
3900
|
-
raise typer.Exit()
|
|
3790
|
+
raise typer.Exit(1)
|
|
3901
3791
|
|
|
3902
3792
|
self.verbosity_handler(quiet, verbose, False, False)
|
|
3903
3793
|
wallet = self.wallet_ask(
|
|
@@ -4066,7 +3956,7 @@ class CLIManager:
|
|
|
4066
3956
|
if coldkey_ss58:
|
|
4067
3957
|
if not is_valid_ss58_address(coldkey_ss58):
|
|
4068
3958
|
print_error("You entered an invalid ss58 address")
|
|
4069
|
-
raise typer.Exit()
|
|
3959
|
+
raise typer.Exit(1)
|
|
4070
3960
|
else:
|
|
4071
3961
|
coldkey_or_ss58 = Prompt.ask(
|
|
4072
3962
|
"Enter the [blue]wallet name[/blue] or [blue]coldkey ss58 address[/blue]",
|
|
@@ -4568,7 +4458,7 @@ class CLIManager:
|
|
|
4568
4458
|
if coldkey_ss58:
|
|
4569
4459
|
if not is_valid_ss58_address(coldkey_ss58):
|
|
4570
4460
|
print_error("You entered an invalid ss58 address")
|
|
4571
|
-
raise typer.Exit()
|
|
4461
|
+
raise typer.Exit(1)
|
|
4572
4462
|
else:
|
|
4573
4463
|
if wallet_name:
|
|
4574
4464
|
coldkey_or_ss58 = wallet_name
|
|
@@ -4718,7 +4608,7 @@ class CLIManager:
|
|
|
4718
4608
|
if coldkey_ss58:
|
|
4719
4609
|
if not is_valid_ss58_address(coldkey_ss58):
|
|
4720
4610
|
print_error("You entered an invalid ss58 address")
|
|
4721
|
-
raise typer.Exit()
|
|
4611
|
+
raise typer.Exit(1)
|
|
4722
4612
|
else:
|
|
4723
4613
|
if wallet_name:
|
|
4724
4614
|
coldkey_or_ss58 = wallet_name
|
|
@@ -5032,12 +4922,12 @@ class CLIManager:
|
|
|
5032
4922
|
|
|
5033
4923
|
if amount <= 0:
|
|
5034
4924
|
print_error(f"You entered an incorrect stake amount: {amount}")
|
|
5035
|
-
raise typer.Exit()
|
|
4925
|
+
raise typer.Exit(1)
|
|
5036
4926
|
if Balance.from_tao(amount) > free_balance:
|
|
5037
4927
|
print_error(
|
|
5038
4928
|
f"You dont have enough balance to stake. Current free Balance: {free_balance}."
|
|
5039
4929
|
)
|
|
5040
|
-
raise typer.Exit()
|
|
4930
|
+
raise typer.Exit(1)
|
|
5041
4931
|
logger.debug(
|
|
5042
4932
|
"args:\n"
|
|
5043
4933
|
f"network: {network}\n"
|
|
@@ -5551,7 +5441,7 @@ class CLIManager:
|
|
|
5551
5441
|
print_error(
|
|
5552
5442
|
"Invalid destination hotkey ss58 address. Please enter a valid ss58 address."
|
|
5553
5443
|
)
|
|
5554
|
-
raise typer.Exit()
|
|
5444
|
+
raise typer.Exit(1)
|
|
5555
5445
|
else:
|
|
5556
5446
|
if is_valid_ss58_address(destination_hotkey):
|
|
5557
5447
|
destination_hotkey = destination_hotkey
|
|
@@ -5559,7 +5449,7 @@ class CLIManager:
|
|
|
5559
5449
|
print_error(
|
|
5560
5450
|
"Invalid destination hotkey ss58 address. Please enter a valid ss58 address or wallet name."
|
|
5561
5451
|
)
|
|
5562
|
-
raise typer.Exit()
|
|
5452
|
+
raise typer.Exit(1)
|
|
5563
5453
|
|
|
5564
5454
|
if not wallet_name:
|
|
5565
5455
|
wallet_name = Prompt.ask(
|
|
@@ -6347,7 +6237,7 @@ class CLIManager:
|
|
|
6347
6237
|
|
|
6348
6238
|
if all_netuids and netuid:
|
|
6349
6239
|
print_error("Specify either a netuid or `--all`, not both.")
|
|
6350
|
-
raise typer.Exit()
|
|
6240
|
+
raise typer.Exit(1)
|
|
6351
6241
|
|
|
6352
6242
|
if all_netuids:
|
|
6353
6243
|
netuid = None
|
|
@@ -6422,11 +6312,11 @@ class CLIManager:
|
|
|
6422
6312
|
|
|
6423
6313
|
if len(proportions) != len(children):
|
|
6424
6314
|
print_error("You must have as many proportions as you have children.")
|
|
6425
|
-
raise typer.Exit()
|
|
6315
|
+
raise typer.Exit(1)
|
|
6426
6316
|
|
|
6427
6317
|
if sum(proportions) > 1.0:
|
|
6428
6318
|
print_error("Your proportion total must not exceed 1.0.")
|
|
6429
|
-
raise typer.Exit()
|
|
6319
|
+
raise typer.Exit(1)
|
|
6430
6320
|
|
|
6431
6321
|
wallet = self.wallet_ask(
|
|
6432
6322
|
wallet_name,
|
|
@@ -6506,7 +6396,7 @@ class CLIManager:
|
|
|
6506
6396
|
)
|
|
6507
6397
|
if all_netuids and netuid:
|
|
6508
6398
|
print_error("Specify either a netuid or '--all', not both.")
|
|
6509
|
-
raise typer.Exit()
|
|
6399
|
+
raise typer.Exit(1)
|
|
6510
6400
|
if all_netuids:
|
|
6511
6401
|
netuid = None
|
|
6512
6402
|
elif not netuid:
|
|
@@ -6601,7 +6491,7 @@ class CLIManager:
|
|
|
6601
6491
|
)
|
|
6602
6492
|
if all_netuids and netuid:
|
|
6603
6493
|
print_error("Specify either a netuid or '--all', not both.")
|
|
6604
|
-
raise typer.Exit()
|
|
6494
|
+
raise typer.Exit(1)
|
|
6605
6495
|
if all_netuids:
|
|
6606
6496
|
netuid = None
|
|
6607
6497
|
elif not netuid:
|
|
@@ -6897,6 +6787,11 @@ class CLIManager:
|
|
|
6897
6787
|
param_value: Optional[str] = typer.Option(
|
|
6898
6788
|
"", "--value", help="Value to set the hyperparameter to."
|
|
6899
6789
|
),
|
|
6790
|
+
normalize_value: bool = typer.Option(
|
|
6791
|
+
False,
|
|
6792
|
+
"--normalize",
|
|
6793
|
+
help="Whether to accept input as the normalized value.",
|
|
6794
|
+
),
|
|
6900
6795
|
proxy: Optional[str] = Options.proxy,
|
|
6901
6796
|
prompt: bool = Options.prompt,
|
|
6902
6797
|
decline: bool = Options.decline,
|
|
@@ -7108,10 +7003,12 @@ class CLIManager:
|
|
|
7108
7003
|
"Param value not supplied with `--no-prompt` flag. Cannot continue."
|
|
7109
7004
|
)
|
|
7110
7005
|
return False
|
|
7111
|
-
if HYPERPARAMS.get(param_name):
|
|
7006
|
+
if not normalize_value and HYPERPARAMS.get(param_name):
|
|
7112
7007
|
param_value = Prompt.ask(
|
|
7113
7008
|
f"Enter the new value for [{COLORS.G.SUBHEAD}]{param_name}[/{COLORS.G.SUBHEAD}] "
|
|
7114
|
-
f"in the VALUE column format"
|
|
7009
|
+
f"in the VALUE column format. \n"
|
|
7010
|
+
f"Tip: to enter the normalized value instead, run this command with "
|
|
7011
|
+
f"{arg__('--normalize')} instead."
|
|
7115
7012
|
)
|
|
7116
7013
|
else:
|
|
7117
7014
|
param_value = None
|
|
@@ -7137,6 +7034,7 @@ class CLIManager:
|
|
|
7137
7034
|
proxy=proxy,
|
|
7138
7035
|
param_name=param_name,
|
|
7139
7036
|
param_value=param_value,
|
|
7037
|
+
normalize=normalize_value,
|
|
7140
7038
|
prompt=prompt,
|
|
7141
7039
|
json_output=json_output,
|
|
7142
7040
|
)
|
|
@@ -7174,6 +7072,7 @@ class CLIManager:
|
|
|
7174
7072
|
proxy=proxy,
|
|
7175
7073
|
param_name=param_name,
|
|
7176
7074
|
param_value=param_value,
|
|
7075
|
+
normalize=normalize_value,
|
|
7177
7076
|
prompt=prompt,
|
|
7178
7077
|
json_output=json_output,
|
|
7179
7078
|
)
|
|
@@ -7351,7 +7250,7 @@ class CLIManager:
|
|
|
7351
7250
|
print_error(
|
|
7352
7251
|
f"Take value must be between {min_value} and {max_value}. Provided value: {take}"
|
|
7353
7252
|
)
|
|
7354
|
-
raise typer.Exit()
|
|
7253
|
+
raise typer.Exit(1)
|
|
7355
7254
|
logger.debug(f"args:\nnetwork: {network}\ntake: {take}\nproxy: {proxy}\n")
|
|
7356
7255
|
result, ext_id = self._run_command(
|
|
7357
7256
|
sudo.set_take(
|
|
@@ -7533,11 +7432,11 @@ class CLIManager:
|
|
|
7533
7432
|
|
|
7534
7433
|
if amount <= 0:
|
|
7535
7434
|
print_error(f"You entered an incorrect stake and burn amount: {amount}")
|
|
7536
|
-
raise typer.Exit()
|
|
7435
|
+
raise typer.Exit(1)
|
|
7537
7436
|
|
|
7538
7437
|
if netuid == 0:
|
|
7539
7438
|
print_error("Cannot stake and burn on the root subnet.")
|
|
7540
|
-
raise typer.Exit()
|
|
7439
|
+
raise typer.Exit(1)
|
|
7541
7440
|
|
|
7542
7441
|
self._run_command(
|
|
7543
7442
|
sudo.stake_burn(
|
|
@@ -8257,18 +8156,18 @@ class CLIManager:
|
|
|
8257
8156
|
"Unable to use `--reuse-last` or `--html` when config `no-cache` is set to `True`. "
|
|
8258
8157
|
"Set the`no-cache` field to `False` by using `btcli config set` or editing the config.yml file."
|
|
8259
8158
|
)
|
|
8260
|
-
raise typer.Exit()
|
|
8159
|
+
raise typer.Exit(1)
|
|
8261
8160
|
|
|
8262
8161
|
# For Rao games
|
|
8263
8162
|
effective_network = get_effective_network(self.config, network)
|
|
8264
8163
|
if is_rao_network(effective_network):
|
|
8265
8164
|
print_error("This command is disabled on the 'rao' network.")
|
|
8266
|
-
raise typer.Exit()
|
|
8165
|
+
raise typer.Exit(1)
|
|
8267
8166
|
|
|
8268
8167
|
if reuse_last:
|
|
8269
8168
|
if netuid is not None:
|
|
8270
8169
|
console.print("Cannot specify netuid when using `--reuse-last`")
|
|
8271
|
-
raise typer.Exit()
|
|
8170
|
+
raise typer.Exit(1)
|
|
8272
8171
|
subtensor = None
|
|
8273
8172
|
else:
|
|
8274
8173
|
if netuid is None:
|
|
@@ -8595,7 +8494,7 @@ class CLIManager:
|
|
|
8595
8494
|
if coldkey_ss58:
|
|
8596
8495
|
if not is_valid_ss58_address(coldkey_ss58):
|
|
8597
8496
|
print_error(f"Invalid SS58 address: {coldkey_ss58}")
|
|
8598
|
-
raise typer.Exit()
|
|
8497
|
+
raise typer.Exit(1)
|
|
8599
8498
|
wallet = None
|
|
8600
8499
|
else:
|
|
8601
8500
|
wallet = self.wallet_ask(
|
|
@@ -10210,7 +10109,7 @@ class CLIManager:
|
|
|
10210
10109
|
"""
|
|
10211
10110
|
if from_tao is None and from_rao is None:
|
|
10212
10111
|
print_error("Specify `--rao` and/or `--tao`.")
|
|
10213
|
-
raise typer.Exit()
|
|
10112
|
+
raise typer.Exit(1)
|
|
10214
10113
|
if from_rao is not None:
|
|
10215
10114
|
rao = int(float(from_rao))
|
|
10216
10115
|
console.print(
|
|
@@ -81,17 +81,6 @@ class Defaults:
|
|
|
81
81
|
chain_endpoint = None
|
|
82
82
|
_mock = False
|
|
83
83
|
|
|
84
|
-
class pow_register:
|
|
85
|
-
num_processes = None
|
|
86
|
-
update_interval = 50_000
|
|
87
|
-
output_in_place = True
|
|
88
|
-
verbose = False
|
|
89
|
-
|
|
90
|
-
class cuda:
|
|
91
|
-
dev_id = 0
|
|
92
|
-
use_cuda = False
|
|
93
|
-
tpb = 256
|
|
94
|
-
|
|
95
84
|
class wallet:
|
|
96
85
|
name = "default"
|
|
97
86
|
hotkey = "default"
|
|
@@ -650,6 +639,8 @@ HYPERPARAMS = {
|
|
|
650
639
|
"subnet_is_active": ("", RootSudoOnly.FALSE), # Set via btcli subnets start
|
|
651
640
|
"yuma_version": ("", RootSudoOnly.FALSE), # Related to yuma3_enabled
|
|
652
641
|
"max_allowed_uids": ("sudo_set_max_allowed_uids", RootSudoOnly.FALSE),
|
|
642
|
+
"burn_increase_mult": ("sudo_set_burn_increase_mult", RootSudoOnly.FALSE),
|
|
643
|
+
"burn_half_life": ("sudo_set_burn_half_life", RootSudoOnly.FALSE),
|
|
653
644
|
}
|
|
654
645
|
|
|
655
646
|
HYPERPARAMS_MODULE = {
|
|
@@ -4,6 +4,7 @@ from enum import Enum
|
|
|
4
4
|
from typing import Optional, Any, Union
|
|
5
5
|
|
|
6
6
|
import netaddr
|
|
7
|
+
from scalecodec.utils.math import FixedPoint
|
|
7
8
|
from scalecodec.utils.ss58 import ss58_encode
|
|
8
9
|
|
|
9
10
|
from bittensor_cli.src.bittensor.balances import Balance, fixed_to_float
|
|
@@ -185,11 +186,16 @@ class SubnetHyperparameters(InfoBase):
|
|
|
185
186
|
transfers_enabled: bool
|
|
186
187
|
bonds_reset_enabled: bool
|
|
187
188
|
user_liquidity_enabled: bool
|
|
189
|
+
burn_increase_mult: FixedPoint
|
|
190
|
+
burn_half_life: int
|
|
188
191
|
|
|
189
192
|
@classmethod
|
|
190
193
|
def _fix_decoded(
|
|
191
|
-
cls,
|
|
194
|
+
cls,
|
|
195
|
+
decoded: Union[dict, "SubnetHyperparameters"],
|
|
192
196
|
) -> "SubnetHyperparameters":
|
|
197
|
+
burn_increase_mult: FixedPoint = decoded["burn_increase_mult"]
|
|
198
|
+
burn_half_life: int = decoded["burn_half_life"]
|
|
193
199
|
return cls(
|
|
194
200
|
activity_cutoff=decoded["activity_cutoff"],
|
|
195
201
|
adjustment_alpha=decoded["adjustment_alpha"],
|
|
@@ -226,6 +232,8 @@ class SubnetHyperparameters(InfoBase):
|
|
|
226
232
|
weights_rate_limit=decoded["weights_rate_limit"],
|
|
227
233
|
weights_version=decoded["weights_version"],
|
|
228
234
|
yuma_version=decoded["yuma_version"],
|
|
235
|
+
burn_increase_mult=burn_increase_mult,
|
|
236
|
+
burn_half_life=burn_half_life,
|
|
229
237
|
)
|
|
230
238
|
|
|
231
239
|
|