meshtensor-cli 9.18.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.
- meshtensor_cli/__init__.py +22 -0
- meshtensor_cli/cli.py +10742 -0
- meshtensor_cli/doc_generation_helper.py +4 -0
- meshtensor_cli/src/__init__.py +1085 -0
- meshtensor_cli/src/commands/__init__.py +0 -0
- meshtensor_cli/src/commands/axon/__init__.py +0 -0
- meshtensor_cli/src/commands/axon/axon.py +132 -0
- meshtensor_cli/src/commands/crowd/__init__.py +0 -0
- meshtensor_cli/src/commands/crowd/contribute.py +621 -0
- meshtensor_cli/src/commands/crowd/contributors.py +200 -0
- meshtensor_cli/src/commands/crowd/create.py +783 -0
- meshtensor_cli/src/commands/crowd/dissolve.py +219 -0
- meshtensor_cli/src/commands/crowd/refund.py +233 -0
- meshtensor_cli/src/commands/crowd/update.py +418 -0
- meshtensor_cli/src/commands/crowd/utils.py +124 -0
- meshtensor_cli/src/commands/crowd/view.py +991 -0
- meshtensor_cli/src/commands/governance/__init__.py +0 -0
- meshtensor_cli/src/commands/governance/governance.py +794 -0
- meshtensor_cli/src/commands/liquidity/__init__.py +0 -0
- meshtensor_cli/src/commands/liquidity/liquidity.py +699 -0
- meshtensor_cli/src/commands/liquidity/utils.py +202 -0
- meshtensor_cli/src/commands/proxy.py +700 -0
- meshtensor_cli/src/commands/stake/__init__.py +0 -0
- meshtensor_cli/src/commands/stake/add.py +799 -0
- meshtensor_cli/src/commands/stake/auto_staking.py +306 -0
- meshtensor_cli/src/commands/stake/children_hotkeys.py +865 -0
- meshtensor_cli/src/commands/stake/claim.py +770 -0
- meshtensor_cli/src/commands/stake/list.py +738 -0
- meshtensor_cli/src/commands/stake/move.py +1211 -0
- meshtensor_cli/src/commands/stake/remove.py +1466 -0
- meshtensor_cli/src/commands/stake/wizard.py +323 -0
- meshtensor_cli/src/commands/subnets/__init__.py +0 -0
- meshtensor_cli/src/commands/subnets/mechanisms.py +515 -0
- meshtensor_cli/src/commands/subnets/price.py +733 -0
- meshtensor_cli/src/commands/subnets/subnets.py +2908 -0
- meshtensor_cli/src/commands/sudo.py +1294 -0
- meshtensor_cli/src/commands/tc/__init__.py +0 -0
- meshtensor_cli/src/commands/tc/tc.py +190 -0
- meshtensor_cli/src/commands/treasury/__init__.py +0 -0
- meshtensor_cli/src/commands/treasury/treasury.py +194 -0
- meshtensor_cli/src/commands/view.py +354 -0
- meshtensor_cli/src/commands/wallets.py +2311 -0
- meshtensor_cli/src/commands/weights.py +467 -0
- meshtensor_cli/src/meshtensor/__init__.py +0 -0
- meshtensor_cli/src/meshtensor/balances.py +313 -0
- meshtensor_cli/src/meshtensor/chain_data.py +1263 -0
- meshtensor_cli/src/meshtensor/extrinsics/__init__.py +0 -0
- meshtensor_cli/src/meshtensor/extrinsics/mev_shield.py +174 -0
- meshtensor_cli/src/meshtensor/extrinsics/registration.py +1861 -0
- meshtensor_cli/src/meshtensor/extrinsics/root.py +550 -0
- meshtensor_cli/src/meshtensor/extrinsics/serving.py +255 -0
- meshtensor_cli/src/meshtensor/extrinsics/transfer.py +239 -0
- meshtensor_cli/src/meshtensor/meshtensor_interface.py +2598 -0
- meshtensor_cli/src/meshtensor/minigraph.py +254 -0
- meshtensor_cli/src/meshtensor/networking.py +12 -0
- meshtensor_cli/src/meshtensor/templates/main-filters.j2 +24 -0
- meshtensor_cli/src/meshtensor/templates/main-header.j2 +36 -0
- meshtensor_cli/src/meshtensor/templates/neuron-details.j2 +111 -0
- meshtensor_cli/src/meshtensor/templates/price-multi.j2 +113 -0
- meshtensor_cli/src/meshtensor/templates/price-single.j2 +99 -0
- meshtensor_cli/src/meshtensor/templates/subnet-details-header.j2 +49 -0
- meshtensor_cli/src/meshtensor/templates/subnet-details.j2 +32 -0
- meshtensor_cli/src/meshtensor/templates/subnet-metrics.j2 +57 -0
- meshtensor_cli/src/meshtensor/templates/subnets-table.j2 +28 -0
- meshtensor_cli/src/meshtensor/templates/table.j2 +267 -0
- meshtensor_cli/src/meshtensor/templates/view.css +1058 -0
- meshtensor_cli/src/meshtensor/templates/view.j2 +43 -0
- meshtensor_cli/src/meshtensor/templates/view.js +1053 -0
- meshtensor_cli/src/meshtensor/utils.py +2007 -0
- meshtensor_cli/version.py +23 -0
- meshtensor_cli-9.18.1.dist-info/METADATA +261 -0
- meshtensor_cli-9.18.1.dist-info/RECORD +74 -0
- meshtensor_cli-9.18.1.dist-info/WHEEL +4 -0
- meshtensor_cli-9.18.1.dist-info/entry_points.txt +3 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Axon commands for managing neuron serving endpoints.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from meshtensor_wallet import Wallet
|
|
9
|
+
|
|
10
|
+
from meshtensor_cli.src.meshtensor.utils import (
|
|
11
|
+
print_error,
|
|
12
|
+
json_console,
|
|
13
|
+
)
|
|
14
|
+
from meshtensor_cli.src.meshtensor.extrinsics.serving import (
|
|
15
|
+
reset_axon_extrinsic,
|
|
16
|
+
set_axon_extrinsic,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from meshtensor_cli.src.meshtensor.meshtensor_interface import MeshtensorInterface
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
async def reset(
|
|
24
|
+
wallet: Wallet,
|
|
25
|
+
meshtensor: "MeshtensorInterface",
|
|
26
|
+
netuid: int,
|
|
27
|
+
json_output: bool,
|
|
28
|
+
prompt: bool,
|
|
29
|
+
wait_for_inclusion: bool,
|
|
30
|
+
wait_for_finalization: bool,
|
|
31
|
+
):
|
|
32
|
+
"""
|
|
33
|
+
Reset the axon information for a neuron on the network.
|
|
34
|
+
|
|
35
|
+
This command removes the serving endpoint by setting the IP to 0.0.0.0 and port to 1,
|
|
36
|
+
indicating the neuron is no longer serving.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
wallet: The wallet containing the hotkey to reset the axon for
|
|
40
|
+
meshtensor: The meshtensor interface to use for the extrinsic
|
|
41
|
+
netuid: The network UID where the neuron is registered
|
|
42
|
+
json_output: Whether to output results in JSON format
|
|
43
|
+
prompt: Whether to prompt for confirmation before submitting
|
|
44
|
+
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block
|
|
45
|
+
wait_for_finalization: Whether to wait for the extrinsic to be finalized
|
|
46
|
+
"""
|
|
47
|
+
success, message, ext_id = await reset_axon_extrinsic(
|
|
48
|
+
meshtensor=meshtensor,
|
|
49
|
+
wallet=wallet,
|
|
50
|
+
netuid=netuid,
|
|
51
|
+
prompt=prompt,
|
|
52
|
+
wait_for_inclusion=wait_for_inclusion,
|
|
53
|
+
wait_for_finalization=wait_for_finalization,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
if json_output:
|
|
57
|
+
json_console.print(
|
|
58
|
+
json.dumps(
|
|
59
|
+
{
|
|
60
|
+
"success": success,
|
|
61
|
+
"message": message,
|
|
62
|
+
"extrinsic_identifier": ext_id,
|
|
63
|
+
"netuid": netuid,
|
|
64
|
+
"hotkey": wallet.hotkey.ss58_address,
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
elif not success:
|
|
69
|
+
print_error(f"Failed to reset axon: {message}")
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
async def set_axon(
|
|
73
|
+
wallet: Wallet,
|
|
74
|
+
meshtensor: "MeshtensorInterface",
|
|
75
|
+
netuid: int,
|
|
76
|
+
ip: str,
|
|
77
|
+
port: int,
|
|
78
|
+
ip_type: int,
|
|
79
|
+
protocol: int,
|
|
80
|
+
json_output: bool,
|
|
81
|
+
prompt: bool,
|
|
82
|
+
wait_for_inclusion: bool,
|
|
83
|
+
wait_for_finalization: bool,
|
|
84
|
+
):
|
|
85
|
+
"""
|
|
86
|
+
Set the axon information for a neuron on the network.
|
|
87
|
+
|
|
88
|
+
This command configures the serving endpoint for a neuron by specifying its IP address
|
|
89
|
+
and port, allowing other neurons to connect to it.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
wallet: The wallet containing the hotkey to set the axon for
|
|
93
|
+
meshtensor: The meshtensor interface to use for the extrinsic
|
|
94
|
+
netuid: The network UID where the neuron is registered
|
|
95
|
+
ip: IP address to set for the axon
|
|
96
|
+
port: Port number to set for the axon
|
|
97
|
+
ip_type: IP type (4 for IPv4, 6 for IPv6)
|
|
98
|
+
protocol: Protocol version
|
|
99
|
+
json_output: Whether to output results in JSON format
|
|
100
|
+
prompt: Whether to prompt for confirmation before submitting
|
|
101
|
+
wait_for_inclusion: Whether to wait for the extrinsic to be included in a block
|
|
102
|
+
wait_for_finalization: Whether to wait for the extrinsic to be finalized
|
|
103
|
+
"""
|
|
104
|
+
success, message, ext_id = await set_axon_extrinsic(
|
|
105
|
+
meshtensor=meshtensor,
|
|
106
|
+
wallet=wallet,
|
|
107
|
+
netuid=netuid,
|
|
108
|
+
ip=ip,
|
|
109
|
+
port=port,
|
|
110
|
+
ip_type=ip_type,
|
|
111
|
+
protocol=protocol,
|
|
112
|
+
prompt=prompt,
|
|
113
|
+
wait_for_inclusion=wait_for_inclusion,
|
|
114
|
+
wait_for_finalization=wait_for_finalization,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
if json_output:
|
|
118
|
+
json_console.print(
|
|
119
|
+
json.dumps(
|
|
120
|
+
{
|
|
121
|
+
"success": success,
|
|
122
|
+
"message": message,
|
|
123
|
+
"extrinsic_identifier": ext_id,
|
|
124
|
+
"netuid": netuid,
|
|
125
|
+
"hotkey": wallet.hotkey.ss58_address,
|
|
126
|
+
"ip": ip,
|
|
127
|
+
"port": port,
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
)
|
|
131
|
+
elif not success:
|
|
132
|
+
print_error(f"Failed to set axon: {message}")
|
|
File without changes
|