bittensor-cli 9.1.4__py3-none-any.whl → 9.3.0__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 +525 -131
- bittensor_cli/src/__init__.py +444 -465
- bittensor_cli/src/bittensor/chain_data.py +6 -2
- bittensor_cli/src/bittensor/extrinsics/registration.py +47 -23
- bittensor_cli/src/bittensor/extrinsics/root.py +10 -11
- bittensor_cli/src/bittensor/extrinsics/transfer.py +5 -3
- bittensor_cli/src/bittensor/subtensor_interface.py +125 -5
- bittensor_cli/src/bittensor/utils.py +4 -1
- bittensor_cli/src/commands/stake/add.py +169 -108
- bittensor_cli/src/commands/stake/children_hotkeys.py +120 -79
- bittensor_cli/src/commands/stake/list.py +54 -20
- bittensor_cli/src/commands/stake/move.py +58 -18
- bittensor_cli/src/commands/stake/remove.py +174 -92
- bittensor_cli/src/commands/subnets/price.py +11 -9
- bittensor_cli/src/commands/subnets/subnets.py +223 -80
- bittensor_cli/src/commands/sudo.py +76 -22
- bittensor_cli/src/commands/wallets.py +656 -40
- bittensor_cli/src/commands/weights.py +21 -11
- bittensor_cli/version.py +2 -1
- {bittensor_cli-9.1.4.dist-info → bittensor_cli-9.3.0.dist-info}/METADATA +30 -11
- bittensor_cli-9.3.0.dist-info/RECORD +35 -0
- {bittensor_cli-9.1.4.dist-info → bittensor_cli-9.3.0.dist-info}/WHEEL +1 -1
- bittensor_cli-9.1.4.dist-info/RECORD +0 -35
- {bittensor_cli-9.1.4.dist-info → bittensor_cli-9.3.0.dist-info}/entry_points.txt +0 -0
- {bittensor_cli-9.1.4.dist-info → bittensor_cli-9.3.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import asyncio
|
2
|
+
import json
|
2
3
|
import os
|
3
4
|
from datetime import datetime, timedelta
|
4
5
|
from typing import TYPE_CHECKING
|
@@ -9,7 +10,12 @@ from numpy.typing import NDArray
|
|
9
10
|
from rich.prompt import Confirm
|
10
11
|
from async_substrate_interface.errors import SubstrateRequestException
|
11
12
|
|
12
|
-
from bittensor_cli.src.bittensor.utils import
|
13
|
+
from bittensor_cli.src.bittensor.utils import (
|
14
|
+
err_console,
|
15
|
+
console,
|
16
|
+
format_error_message,
|
17
|
+
json_console,
|
18
|
+
)
|
13
19
|
from bittensor_cli.src.bittensor.extrinsics.root import (
|
14
20
|
convert_weights_and_uids_for_emit,
|
15
21
|
generate_weight_hash,
|
@@ -260,7 +266,6 @@ class SetWeightsExtrinsic:
|
|
260
266
|
if not self.wait_for_finalization and not self.wait_for_inclusion:
|
261
267
|
return True, "Not waiting for finalization or inclusion."
|
262
268
|
|
263
|
-
await response.process_events()
|
264
269
|
if await response.is_success:
|
265
270
|
return True, "Successfully set weights."
|
266
271
|
else:
|
@@ -316,7 +321,6 @@ class SetWeightsExtrinsic:
|
|
316
321
|
success, error_message = True, ""
|
317
322
|
|
318
323
|
else:
|
319
|
-
await response.process_events()
|
320
324
|
if await response.is_success:
|
321
325
|
success, error_message = True, ""
|
322
326
|
else:
|
@@ -354,7 +358,6 @@ class SetWeightsExtrinsic:
|
|
354
358
|
if not self.wait_for_finalization and not self.wait_for_inclusion:
|
355
359
|
return True, None
|
356
360
|
|
357
|
-
await response.process_events()
|
358
361
|
if await response.is_success:
|
359
362
|
return True, None
|
360
363
|
else:
|
@@ -372,6 +375,7 @@ async def reveal_weights(
|
|
372
375
|
weights: list[float],
|
373
376
|
salt: list[int],
|
374
377
|
version: int,
|
378
|
+
json_output: bool = False,
|
375
379
|
prompt: bool = True,
|
376
380
|
) -> None:
|
377
381
|
"""Reveal weights for a specific subnet."""
|
@@ -395,11 +399,13 @@ async def reveal_weights(
|
|
395
399
|
subtensor, wallet, netuid, uids_, weights_, list(salt_), version, prompt=prompt
|
396
400
|
)
|
397
401
|
success, message = await extrinsic.reveal(weight_uids, weight_vals)
|
398
|
-
|
399
|
-
|
400
|
-
console.print("Weights revealed successfully")
|
402
|
+
if json_output:
|
403
|
+
json_console.print(json.dumps({"success": success, "message": message}))
|
401
404
|
else:
|
402
|
-
|
405
|
+
if success:
|
406
|
+
console.print("Weights revealed successfully")
|
407
|
+
else:
|
408
|
+
err_console.print(f"Failed to reveal weights: {message}")
|
403
409
|
|
404
410
|
|
405
411
|
async def commit_weights(
|
@@ -410,6 +416,7 @@ async def commit_weights(
|
|
410
416
|
weights: list[float],
|
411
417
|
salt: list[int],
|
412
418
|
version: int,
|
419
|
+
json_output: bool = False,
|
413
420
|
prompt: bool = True,
|
414
421
|
):
|
415
422
|
"""Commits weights and then reveals them for a specific subnet"""
|
@@ -429,7 +436,10 @@ async def commit_weights(
|
|
429
436
|
subtensor, wallet, netuid, uids_, weights_, list(salt_), version, prompt=prompt
|
430
437
|
)
|
431
438
|
success, message = await extrinsic.set_weights_extrinsic()
|
432
|
-
if
|
433
|
-
|
439
|
+
if json_output:
|
440
|
+
json_console.print(json.dumps({"success": success, "message": message}))
|
434
441
|
else:
|
435
|
-
|
442
|
+
if success:
|
443
|
+
console.print("Weights set successfully")
|
444
|
+
else:
|
445
|
+
err_console.print(f"Failed to commit weights: {message}")
|
bittensor_cli/version.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import importlib.metadata
|
1
2
|
import re
|
2
3
|
|
3
4
|
|
@@ -16,5 +17,5 @@ def version_as_int(version):
|
|
16
17
|
return __version_as_int__
|
17
18
|
|
18
19
|
|
19
|
-
__version__ =
|
20
|
+
__version__ = importlib.metadata.version("bittensor-cli")
|
20
21
|
__version_as_int__ = version_as_int(__version__)
|
@@ -1,37 +1,35 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: bittensor-cli
|
3
|
-
Version: 9.
|
3
|
+
Version: 9.3.0
|
4
4
|
Summary: Bittensor CLI
|
5
5
|
Author: bittensor.com
|
6
6
|
Project-URL: homepage, https://github.com/opentensor/btcli
|
7
7
|
Project-URL: Repository, https://github.com/opentensor/btcli
|
8
|
-
Requires-Python: <3.
|
8
|
+
Requires-Python: <3.14,>=3.9
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
Requires-Dist: wheel
|
11
11
|
Requires-Dist: async-property==0.2.2
|
12
|
-
Requires-Dist: async-substrate-interface>=1.0
|
12
|
+
Requires-Dist: async-substrate-interface>=1.1.0
|
13
13
|
Requires-Dist: aiohttp~=3.10.2
|
14
14
|
Requires-Dist: backoff~=2.2.1
|
15
15
|
Requires-Dist: GitPython>=3.0.0
|
16
16
|
Requires-Dist: fuzzywuzzy~=0.18.0
|
17
17
|
Requires-Dist: netaddr~=1.3.0
|
18
|
-
Requires-Dist: numpy
|
18
|
+
Requires-Dist: numpy<3.0.0,>=2.0.1
|
19
19
|
Requires-Dist: Jinja2
|
20
20
|
Requires-Dist: pycryptodome<4.0.0,>=3.0.0
|
21
21
|
Requires-Dist: PyYAML~=6.0.1
|
22
22
|
Requires-Dist: pytest
|
23
23
|
Requires-Dist: python-Levenshtein
|
24
|
-
Requires-Dist: rich
|
24
|
+
Requires-Dist: rich<15.0,>=13.7
|
25
25
|
Requires-Dist: scalecodec==1.2.11
|
26
|
-
Requires-Dist: typer
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist: bittensor-wallet>=3.0.4
|
26
|
+
Requires-Dist: typer<0.16,>=0.12
|
27
|
+
Requires-Dist: bittensor-wallet>=3.0.7
|
29
28
|
Requires-Dist: plotille>=5.0.0
|
30
29
|
Requires-Dist: pywry>=0.6.2
|
31
30
|
Requires-Dist: plotly>=6.0.0
|
32
31
|
Provides-Extra: cuda
|
33
32
|
Requires-Dist: torch<2.6.0,>=1.13.1; extra == "cuda"
|
34
|
-
Requires-Dist: cubit>=1.1.0; extra == "cuda"
|
35
33
|
|
36
34
|
<div align="center">
|
37
35
|
|
@@ -74,7 +72,20 @@ Installation steps are described below. For a full documentation on how to use `
|
|
74
72
|
|
75
73
|
## Install on macOS and Linux
|
76
74
|
|
77
|
-
You can install `btcli` on your local machine directly from source. **Make sure you verify your installation after you install**:
|
75
|
+
You can install `btcli` on your local machine directly from source, or from from PyPI. **Make sure you verify your installation after you install**:
|
76
|
+
|
77
|
+
|
78
|
+
### Install from PyPI
|
79
|
+
|
80
|
+
Run
|
81
|
+
```
|
82
|
+
pip install -U bittensor-cli
|
83
|
+
```
|
84
|
+
|
85
|
+
Alternatively, if you prefer to use [uv](https://pypi.org/project/uv/):
|
86
|
+
```
|
87
|
+
uv pip install bittensor-cli
|
88
|
+
```
|
78
89
|
|
79
90
|
### Install from source
|
80
91
|
|
@@ -104,6 +115,14 @@ cd btcli
|
|
104
115
|
pip3 install .
|
105
116
|
```
|
106
117
|
|
118
|
+
### Also install bittensor (SDK)
|
119
|
+
|
120
|
+
If you prefer to install the btcli alongside the bittensor SDK, you can do this in a single command with
|
121
|
+
|
122
|
+
```
|
123
|
+
pip install -U bittensor[cli]
|
124
|
+
```
|
125
|
+
|
107
126
|
---
|
108
127
|
|
109
128
|
## Install on Windows
|
@@ -0,0 +1,35 @@
|
|
1
|
+
bittensor_cli/__init__.py,sha256=Lpv4NkbAQgwrfqFOnTMuR_S-fqGdaWCSLhxnFnGTHM0,1232
|
2
|
+
bittensor_cli/cli.py,sha256=Of6WY-3dg4SAg_NcDs1Rn3ZYwZre21dQ1-YsD8pkBwU,213143
|
3
|
+
bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
|
4
|
+
bittensor_cli/version.py,sha256=xtm9qNHg2cYyMpx8mg2YxuglkVUvseiqJg82z4gTrEY,685
|
5
|
+
bittensor_cli/src/__init__.py,sha256=jaQx65z8fjvsMSSTjSZkHUUYbv8u65AkzNTy6piVtyc,35418
|
6
|
+
bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
bittensor_cli/src/bittensor/balances.py,sha256=q5KkxF8wmUguWAFddEKstfDKTxPe5ISHpT6br8x32rc,11148
|
8
|
+
bittensor_cli/src/bittensor/chain_data.py,sha256=yOQyPZ472BlfhAfaemdi22qunEGHlVvugRdUeYpZxwQ,41663
|
9
|
+
bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
|
10
|
+
bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
|
11
|
+
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=JqbraGNGfEfUFff5ZwQJSzIep2IDfuuyFJzzxCr2NLA,58883
|
12
|
+
bittensor_cli/src/bittensor/utils.py,sha256=CT_uQlJFGqSXMRzsvXu6prt7aDLYEkQFDW-94skSZcM,47588
|
13
|
+
bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
+
bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=mZt6z8PRK5MaIczLygmVvAUnfl_dl5zDF7ysIFkwHvs,64511
|
15
|
+
bittensor_cli/src/bittensor/extrinsics/root.py,sha256=rVogWhT28NJ1CrVXtbq_Pyi7etB_zTZicbjiHAHLdSs,19214
|
16
|
+
bittensor_cli/src/bittensor/extrinsics/transfer.py,sha256=vxLzKQkTSsV-ark7WAJjEN4QasEJI_9MXt2Dg8eR2j4,8569
|
17
|
+
bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
+
bittensor_cli/src/commands/sudo.py,sha256=y5PTJEa7LI6vUXazRjXsphMA4lQdKR8axcLZXQSdyp4,32993
|
19
|
+
bittensor_cli/src/commands/view.py,sha256=2MdhWWbY9rwGqDilzs8r2ioa0l2GzrYxe8pKkavEVWs,109517
|
20
|
+
bittensor_cli/src/commands/wallets.py,sha256=N3ERh4Iw0juJSy9-AUQaTC1SfZsklD-lxCcFfODfcGE,73142
|
21
|
+
bittensor_cli/src/commands/weights.py,sha256=BCJm_mlw0pVK4YEZuEMqQBpvvOoB7B1rzdvMeN3uTfM,16503
|
22
|
+
bittensor_cli/src/commands/stake/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
+
bittensor_cli/src/commands/stake/add.py,sha256=Pe4N_I8DKlfN_Ks-X9yu2pMP5jBs__fa2TPLcb6oBKc,26935
|
24
|
+
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=lMiV-Z3SGZUEapdy0LRthFLx0RlFK0KVxytE47ybdEc,31746
|
25
|
+
bittensor_cli/src/commands/stake/list.py,sha256=xLHqEflRLg3vmMop92JgAn88oAy4YdhaIGBcHOYgCak,30038
|
26
|
+
bittensor_cli/src/commands/stake/move.py,sha256=AVeo0l4bvGAtjbdzx2Fn7_-jiI28B7LMlJGVZWT6mKg,35881
|
27
|
+
bittensor_cli/src/commands/stake/remove.py,sha256=l7TtLK2Z6-TJ5-DEwUzm6HT2GQC-MhKZS9SONS9DKtA,49902
|
28
|
+
bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
+
bittensor_cli/src/commands/subnets/price.py,sha256=O8oK12hCtm1asQGx2MR1xtYA9ygkklhFtXvBON4DcGM,30069
|
30
|
+
bittensor_cli/src/commands/subnets/subnets.py,sha256=EiZTUiPPRbWi8sDXVn2lVuKS89W8Ky1opeT9RpgIe1E,89534
|
31
|
+
bittensor_cli-9.3.0.dist-info/METADATA,sha256=OH1bS7MqTR0KR5mn9QJUYXRui9F2QoPHgqYyRp-IKBs,6462
|
32
|
+
bittensor_cli-9.3.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
33
|
+
bittensor_cli-9.3.0.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
34
|
+
bittensor_cli-9.3.0.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
35
|
+
bittensor_cli-9.3.0.dist-info/RECORD,,
|
@@ -1,35 +0,0 @@
|
|
1
|
-
bittensor_cli/__init__.py,sha256=Lpv4NkbAQgwrfqFOnTMuR_S-fqGdaWCSLhxnFnGTHM0,1232
|
2
|
-
bittensor_cli/cli.py,sha256=HbU3AOCiAmicOLA9U-7q92NC9Cmf0p_8qjlabSscaWc,197905
|
3
|
-
bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
|
4
|
-
bittensor_cli/version.py,sha256=laVzyT8eo7SMikK5aTb16S3zsLEpmIzwpNLCcb_IU1w,623
|
5
|
-
bittensor_cli/src/__init__.py,sha256=gSRsPtIDWe5FM93ItTjLDp3ZRwS6szo44sOYyMyFlso,27679
|
6
|
-
bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
bittensor_cli/src/bittensor/balances.py,sha256=q5KkxF8wmUguWAFddEKstfDKTxPe5ISHpT6br8x32rc,11148
|
8
|
-
bittensor_cli/src/bittensor/chain_data.py,sha256=IPgimCD3US5xZqoIBvH4jQza4LDbfUIpFfl_Orgok1Q,41637
|
9
|
-
bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
|
10
|
-
bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
|
11
|
-
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=mhpqRHcuQe7Wzur603fJ8KLhRNVJIvW0gxy7Jsiv4Rg,54582
|
12
|
-
bittensor_cli/src/bittensor/utils.py,sha256=6oJmqiW-ECEobs0z37Eyzu__MfvEU0DyAD_j3FCfzmI,47530
|
13
|
-
bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=3mJZ3hw_wZEa-8I0R8WVuKjMQi4Y9EV5FjTCvbY37Iw,63780
|
15
|
-
bittensor_cli/src/bittensor/extrinsics/root.py,sha256=N9Fg4VaveRRP1ZN4EZjIWCe04FpTNBKWFqx8USKp9uQ,19062
|
16
|
-
bittensor_cli/src/bittensor/extrinsics/transfer.py,sha256=FyrRo3yk-065toN4f-1Xes23CE5tqP5KU0dBJkKofUc,8476
|
17
|
-
bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
bittensor_cli/src/commands/sudo.py,sha256=bSS9nIWeCYf4nqqBYuoTkVDDA2Fm2Di3UG5xlUMJ6yM,31372
|
19
|
-
bittensor_cli/src/commands/view.py,sha256=2MdhWWbY9rwGqDilzs8r2ioa0l2GzrYxe8pKkavEVWs,109517
|
20
|
-
bittensor_cli/src/commands/wallets.py,sha256=AGV8JFCvRE_OOJv6NozxmyO4Cvf4y5HYXVfI_1kl70M,50736
|
21
|
-
bittensor_cli/src/commands/weights.py,sha256=uI7aACKD90JOtYt61VdKL76z7Fe_wh4WtdwMXL6ydD4,16269
|
22
|
-
bittensor_cli/src/commands/stake/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
-
bittensor_cli/src/commands/stake/add.py,sha256=A1pXJl6Dtl_3CWXySOQhEpGOGeinXhKiSJkskuZ13_c,24622
|
24
|
-
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=Eg0Rq_R2DYBsjEBqqNHElJchQ6MlZePkW_oWlifXfSY,29782
|
25
|
-
bittensor_cli/src/commands/stake/list.py,sha256=G7YLP68sq-qmWKPuIy2s6cMYK7XTz0oaMDK4JWR7aBE,28577
|
26
|
-
bittensor_cli/src/commands/stake/move.py,sha256=G2jhp-i-shUIMC6hyh2hGzLeCBj1tQ41Y7-b8806vu4,34480
|
27
|
-
bittensor_cli/src/commands/stake/remove.py,sha256=SlGHLU1yBaabaimb74wADO5LSUfDAbWt3hcm4xEFtO0,47115
|
28
|
-
bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
bittensor_cli/src/commands/subnets/price.py,sha256=TWcRXUFeS_Q-pfyv0YIluAL8SE7d2gzTODK-9M2J5pw,29878
|
30
|
-
bittensor_cli/src/commands/subnets/subnets.py,sha256=d41oWtxOfr4a2QxW3v_P2weELtUOr1vRx4Vi0HzN87s,83935
|
31
|
-
bittensor_cli-9.1.4.dist-info/METADATA,sha256=Dy0kwDN8xFRqB8Ndw74NYopMMNC17XronTGbOwIi53Y,6145
|
32
|
-
bittensor_cli-9.1.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
33
|
-
bittensor_cli-9.1.4.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
34
|
-
bittensor_cli-9.1.4.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
35
|
-
bittensor_cli-9.1.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|