meshtensor-cli 9.18.1__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.
- meshtensor_cli-9.18.1/PKG-INFO +261 -0
- meshtensor_cli-9.18.1/README.md +216 -0
- meshtensor_cli-9.18.1/meshtensor_cli/__init__.py +22 -0
- meshtensor_cli-9.18.1/meshtensor_cli/cli.py +10742 -0
- meshtensor_cli-9.18.1/meshtensor_cli/doc_generation_helper.py +4 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/__init__.py +1085 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/axon/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/axon/axon.py +132 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/contribute.py +621 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/contributors.py +200 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/create.py +783 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/dissolve.py +219 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/refund.py +233 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/update.py +418 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/utils.py +124 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/crowd/view.py +991 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/governance/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/governance/governance.py +794 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/liquidity/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/liquidity/liquidity.py +699 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/liquidity/utils.py +202 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/proxy.py +700 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/add.py +799 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/auto_staking.py +306 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/children_hotkeys.py +865 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/claim.py +770 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/list.py +738 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/move.py +1211 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/remove.py +1466 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/stake/wizard.py +323 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/subnets/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/subnets/mechanisms.py +515 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/subnets/price.py +733 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/subnets/subnets.py +2908 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/sudo.py +1294 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/tc/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/tc/tc.py +190 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/treasury/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/treasury/treasury.py +194 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/view.py +354 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/wallets.py +2311 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/commands/weights.py +467 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/balances.py +313 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/chain_data.py +1263 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/__init__.py +0 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/mev_shield.py +174 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/registration.py +1861 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/root.py +550 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/serving.py +255 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/extrinsics/transfer.py +239 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/meshtensor_interface.py +2598 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/minigraph.py +254 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/networking.py +12 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/main-filters.j2 +24 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/main-header.j2 +36 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/neuron-details.j2 +111 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/price-multi.j2 +113 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/price-single.j2 +99 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/subnet-details-header.j2 +49 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/subnet-details.j2 +32 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/subnet-metrics.j2 +57 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/subnets-table.j2 +28 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/table.j2 +267 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/view.css +1058 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/view.j2 +43 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/templates/view.js +1053 -0
- meshtensor_cli-9.18.1/meshtensor_cli/src/meshtensor/utils.py +2007 -0
- meshtensor_cli-9.18.1/meshtensor_cli/version.py +23 -0
- meshtensor_cli-9.18.1/pyproject.toml +70 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meshtensor-cli
|
|
3
|
+
Version: 9.18.1
|
|
4
|
+
Summary: Meshtensor CLI
|
|
5
|
+
Author: meshtensor.com
|
|
6
|
+
Requires-Python: >=3.9
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Dist: wheel
|
|
23
|
+
Requires-Dist: async-substrate-interface>=1.6.0
|
|
24
|
+
Requires-Dist: aiohttp~=3.13
|
|
25
|
+
Requires-Dist: backoff~=2.2.1
|
|
26
|
+
Requires-Dist: meshtensor-drand>=1.2.0
|
|
27
|
+
Requires-Dist: GitPython>=3.0.0
|
|
28
|
+
Requires-Dist: netaddr~=1.3.0
|
|
29
|
+
Requires-Dist: numpy>=2.0.1,<3.0.0
|
|
30
|
+
Requires-Dist: Jinja2
|
|
31
|
+
Requires-Dist: pycryptodome>=3.0.0,<4.0.0
|
|
32
|
+
Requires-Dist: PyYAML~=6.0
|
|
33
|
+
Requires-Dist: rich>=13.7,<15.0
|
|
34
|
+
Requires-Dist: scalecodec==1.2.12
|
|
35
|
+
Requires-Dist: typer>=0.16
|
|
36
|
+
Requires-Dist: meshtensor-wallet>=4.0.0
|
|
37
|
+
Requires-Dist: packaging
|
|
38
|
+
Requires-Dist: plotille>=5.0.0
|
|
39
|
+
Requires-Dist: plotly>=6.0.0
|
|
40
|
+
Requires-Dist: torch>=1.13.1,<3.0 ; extra == "cuda"
|
|
41
|
+
Project-URL: Repository, https://github.com/opentensor/meshcli
|
|
42
|
+
Project-URL: homepage, https://github.com/opentensor/meshcli
|
|
43
|
+
Provides-Extra: cuda
|
|
44
|
+
|
|
45
|
+
<div align="center">
|
|
46
|
+
|
|
47
|
+
# Meshtensor CLI <!-- omit in toc -->
|
|
48
|
+
[](https://discord.gg/meshtensor)
|
|
49
|
+
[](https://opensource.org/licenses/MIT)
|
|
50
|
+
[](https://badge.fury.io/py/meshtensor_cli)
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Internet-scale Neural Networks <!-- omit in toc -->
|
|
55
|
+
|
|
56
|
+
[SDK](https://github.com/opentensor/meshtensor/tree/master) • [Wallet](https://github.com/opentensor/btwallet) • [Research](https://meshtensor.com/whitepaper)
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
- [Documentation](#documentation)
|
|
61
|
+
- [Install on macOS and Linux](#install-on-macos-and-linux)
|
|
62
|
+
- [Install from source](#install-from-source)
|
|
63
|
+
- [Install on Windows](#install-on-windows)
|
|
64
|
+
- [Verify the installation](#verify-the-installation)
|
|
65
|
+
- [Configuration](#configuration)
|
|
66
|
+
- [Example config file](#example-config-file)
|
|
67
|
+
- [License](#license)
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
The Meshtensor CLI, `meshcli`, is a powerful command line tool for the Meshtensor platform. You can use it on any macOS, Linux or WSL terminal to manage all common operations like creating a wallet, registering a subnet or a neuron, delegating your MESH, viewing Senate proposals and voting for them, and much more. Help information can be invoked for every command and option with `--help` option.
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
Installation steps are described below. For a full documentation on how to use `meshcli`, see the [Meshtensor CLI section](https://docs.meshtensor.com/meshcli) on the developer documentation site.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Install on macOS and Linux
|
|
84
|
+
|
|
85
|
+
You can install `meshcli` on your local machine directly from source, PyPI, or Homebrew.
|
|
86
|
+
**Make sure you verify your installation after you install**.
|
|
87
|
+
|
|
88
|
+
### For macOS users
|
|
89
|
+
Note that the macOS preinstalled CPython installation is compiled with LibreSSL instead of OpenSSL. There are a number
|
|
90
|
+
of issues with LibreSSL, and as such is not fully supported by the libraries used by meshcli. Thus we highly recommend, if
|
|
91
|
+
you are using a Mac, to first install Python from [Homebrew](https://brew.sh/). Additionally, the Rust FFI bindings
|
|
92
|
+
[if installing from precompiled wheels (default)] require the Homebrew-installed OpenSSL pacakge. If you choose to use
|
|
93
|
+
the preinstalled Python version from macOS, things may not work completely.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Install from [PyPI](https://pypi.org/project/meshtensor/)
|
|
97
|
+
|
|
98
|
+
Run
|
|
99
|
+
```
|
|
100
|
+
pip install -U meshtensor-cli
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Alternatively, if you prefer to use [uv](https://pypi.org/project/uv/):
|
|
104
|
+
```
|
|
105
|
+
uv pip install meshtensor-cli
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Install from [Homebrew](https://formulae.brew.sh/formula/meshcli#default)
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
brew install meshcli
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Install from source
|
|
115
|
+
|
|
116
|
+
1. Create and activate a virtual environment.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
python3 -m venv meshcli_venv
|
|
120
|
+
source meshcli_venv/bin/activate
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
2. Clone the Meshtensor CLI repo.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/opentensor/meshcli.git
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
3. `cd` into `meshcli` directory.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
cd meshcli
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
4. Install
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
pip3 install .
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Also install meshtensor (SDK)
|
|
143
|
+
|
|
144
|
+
If you prefer to install the meshcli alongside the meshtensor SDK, you can do this in a single command with
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
pip install -U meshtensor[cli]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Install on Windows
|
|
153
|
+
|
|
154
|
+
To install and run Meshtensor SDK on Windows you must install [**WSL 2** (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/about) on Windows and select [Ubuntu Linux distribution](https://github.com/ubuntu/WSL/blob/main/docs/guides/install-ubuntu-wsl2.md).
|
|
155
|
+
|
|
156
|
+
After you installed the above, follow the same installation steps described above in [Install on macOS and Linux](#install-on-macos-and-linux).
|
|
157
|
+
|
|
158
|
+
**ALERT**: **Limited support on Windows for Meshtensor operations**
|
|
159
|
+
While wallet transactions like delegating, transfer, registering, staking can be performed on a Windows machine using WSL 2, the subnet mining and subnet validating operations are not recommended and are not supported on Windows machines.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Verify the installation
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
meshcli --version
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The above command will show you the version of the `meshcli` you just installed.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Configuration
|
|
174
|
+
|
|
175
|
+
You can set the commonly used values, such as your hotkey and coldkey names, the default chain URL or the network name you use, and more, in `config.yml`. You can override these values by explicitly passing them in the command line for any `meshcli` command.
|
|
176
|
+
|
|
177
|
+
### Example config file
|
|
178
|
+
|
|
179
|
+
The default location of the config file is: `~/.meshtensor/config.yml`. An example of a `config.yml` is shown below:
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
network: local
|
|
183
|
+
use_cache: true
|
|
184
|
+
dashboard_path: null
|
|
185
|
+
disk_cache: true
|
|
186
|
+
rate_tolerance: null
|
|
187
|
+
safe_staking: true
|
|
188
|
+
wallet_hotkey: default
|
|
189
|
+
wallet_name: coldkey-user1
|
|
190
|
+
wallet_path: ~/.meshtensor/wallets
|
|
191
|
+
metagraph_cols:
|
|
192
|
+
ACTIVE: true
|
|
193
|
+
AXON: true
|
|
194
|
+
COLDKEY: true
|
|
195
|
+
CONSENSUS: true
|
|
196
|
+
DIVIDENDS: true
|
|
197
|
+
EMISSION: true
|
|
198
|
+
HOTKEY: true
|
|
199
|
+
INCENTIVE: true
|
|
200
|
+
RANK: true
|
|
201
|
+
STAKE: true
|
|
202
|
+
TRUST: true
|
|
203
|
+
UID: true
|
|
204
|
+
UPDATED: true
|
|
205
|
+
VAL: true
|
|
206
|
+
VTRUST: true
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**For more help:**
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
meshcli config --help
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### ENV VARS
|
|
216
|
+
BTCLI accepts a few environment variables that can alter how it works:
|
|
217
|
+
- USE_TORCH (default 0): If set to 1, will use torch instead of numpy
|
|
218
|
+
- DISK_CACHE (default 0, also settable in config): If set to 1 (or set in config), will use disk caching for various safe-cachable substrate
|
|
219
|
+
calls (such as block number to block hash mapping), which can speed up subsequent calls.
|
|
220
|
+
- BTCLI_CONFIG_PATH (default `~/.meshtensor/config.yml`): This will set the config file location, creating if it does not exist.
|
|
221
|
+
- BTCLI_DEBUG_FILE (default `~/.meshtensor/debug.txt`): The file stores the most recent's command's debug log.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Debugging
|
|
226
|
+
If a command is failing with an odd error, you can usually rerun the command with `--verbose` for a more detailed output
|
|
227
|
+
of any errors/exceptions that occur. This should be done prior to reporting the issue, as it helps us substantially in
|
|
228
|
+
determining the root cause of issues.
|
|
229
|
+
|
|
230
|
+
Additionally, you can pull a debug log.
|
|
231
|
+
|
|
232
|
+
BTCLI will store a debug log for every command run. This file is overwritten for each new command run. The default location
|
|
233
|
+
of this file is `~/.meshtensor/debug.txt` and can be set with the `BTCLI_DEBUG_FILE` env var (see above section).
|
|
234
|
+
|
|
235
|
+
The debug log will **NOT** contain any sensitive data (private keys), and is intended to be sent to the developers
|
|
236
|
+
for debugging. This file contains basic information about the command being run, the config, and the back and forth of requests and responses
|
|
237
|
+
to and from the chain.
|
|
238
|
+
|
|
239
|
+
If you encounter an issue, and would like to save the file somewhere it won't be overwritten, run `meshcli --debug`,
|
|
240
|
+
and set the save file location. We recommend doing this first before anything, and then starting your debugging with
|
|
241
|
+
us on our [Discord](https://discord.gg/meshtensor), or by opening an issue on [GitHub](https://github.com/opentensor/meshcli/issues/new)
|
|
242
|
+
(where you can also upload your debug file).
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
Steps:
|
|
246
|
+
1. Re-run the command with `--verbose` at the end, e.g. `meshcli st remove --verbose`
|
|
247
|
+
2. Run `meshcli --debug` to save the debug log
|
|
248
|
+
3. Report the issue on GitHub or Discord
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
The MIT License (MIT)
|
|
254
|
+
Copyright © 2024 The Opentensor Foundation
|
|
255
|
+
|
|
256
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
257
|
+
|
|
258
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
259
|
+
|
|
260
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
261
|
+
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Meshtensor CLI <!-- omit in toc -->
|
|
4
|
+
[](https://discord.gg/meshtensor)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://badge.fury.io/py/meshtensor_cli)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Internet-scale Neural Networks <!-- omit in toc -->
|
|
11
|
+
|
|
12
|
+
[SDK](https://github.com/opentensor/meshtensor/tree/master) • [Wallet](https://github.com/opentensor/btwallet) • [Research](https://meshtensor.com/whitepaper)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
- [Documentation](#documentation)
|
|
17
|
+
- [Install on macOS and Linux](#install-on-macos-and-linux)
|
|
18
|
+
- [Install from source](#install-from-source)
|
|
19
|
+
- [Install on Windows](#install-on-windows)
|
|
20
|
+
- [Verify the installation](#verify-the-installation)
|
|
21
|
+
- [Configuration](#configuration)
|
|
22
|
+
- [Example config file](#example-config-file)
|
|
23
|
+
- [License](#license)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
The Meshtensor CLI, `meshcli`, is a powerful command line tool for the Meshtensor platform. You can use it on any macOS, Linux or WSL terminal to manage all common operations like creating a wallet, registering a subnet or a neuron, delegating your MESH, viewing Senate proposals and voting for them, and much more. Help information can be invoked for every command and option with `--help` option.
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Documentation
|
|
34
|
+
|
|
35
|
+
Installation steps are described below. For a full documentation on how to use `meshcli`, see the [Meshtensor CLI section](https://docs.meshtensor.com/meshcli) on the developer documentation site.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Install on macOS and Linux
|
|
40
|
+
|
|
41
|
+
You can install `meshcli` on your local machine directly from source, PyPI, or Homebrew.
|
|
42
|
+
**Make sure you verify your installation after you install**.
|
|
43
|
+
|
|
44
|
+
### For macOS users
|
|
45
|
+
Note that the macOS preinstalled CPython installation is compiled with LibreSSL instead of OpenSSL. There are a number
|
|
46
|
+
of issues with LibreSSL, and as such is not fully supported by the libraries used by meshcli. Thus we highly recommend, if
|
|
47
|
+
you are using a Mac, to first install Python from [Homebrew](https://brew.sh/). Additionally, the Rust FFI bindings
|
|
48
|
+
[if installing from precompiled wheels (default)] require the Homebrew-installed OpenSSL pacakge. If you choose to use
|
|
49
|
+
the preinstalled Python version from macOS, things may not work completely.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Install from [PyPI](https://pypi.org/project/meshtensor/)
|
|
53
|
+
|
|
54
|
+
Run
|
|
55
|
+
```
|
|
56
|
+
pip install -U meshtensor-cli
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Alternatively, if you prefer to use [uv](https://pypi.org/project/uv/):
|
|
60
|
+
```
|
|
61
|
+
uv pip install meshtensor-cli
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Install from [Homebrew](https://formulae.brew.sh/formula/meshcli#default)
|
|
65
|
+
|
|
66
|
+
```shell
|
|
67
|
+
brew install meshcli
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Install from source
|
|
71
|
+
|
|
72
|
+
1. Create and activate a virtual environment.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
python3 -m venv meshcli_venv
|
|
76
|
+
source meshcli_venv/bin/activate
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
2. Clone the Meshtensor CLI repo.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git clone https://github.com/opentensor/meshcli.git
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
3. `cd` into `meshcli` directory.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd meshcli
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. Install
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip3 install .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Also install meshtensor (SDK)
|
|
99
|
+
|
|
100
|
+
If you prefer to install the meshcli alongside the meshtensor SDK, you can do this in a single command with
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
pip install -U meshtensor[cli]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Install on Windows
|
|
109
|
+
|
|
110
|
+
To install and run Meshtensor SDK on Windows you must install [**WSL 2** (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/about) on Windows and select [Ubuntu Linux distribution](https://github.com/ubuntu/WSL/blob/main/docs/guides/install-ubuntu-wsl2.md).
|
|
111
|
+
|
|
112
|
+
After you installed the above, follow the same installation steps described above in [Install on macOS and Linux](#install-on-macos-and-linux).
|
|
113
|
+
|
|
114
|
+
**ALERT**: **Limited support on Windows for Meshtensor operations**
|
|
115
|
+
While wallet transactions like delegating, transfer, registering, staking can be performed on a Windows machine using WSL 2, the subnet mining and subnet validating operations are not recommended and are not supported on Windows machines.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Verify the installation
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
meshcli --version
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The above command will show you the version of the `meshcli` you just installed.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Configuration
|
|
130
|
+
|
|
131
|
+
You can set the commonly used values, such as your hotkey and coldkey names, the default chain URL or the network name you use, and more, in `config.yml`. You can override these values by explicitly passing them in the command line for any `meshcli` command.
|
|
132
|
+
|
|
133
|
+
### Example config file
|
|
134
|
+
|
|
135
|
+
The default location of the config file is: `~/.meshtensor/config.yml`. An example of a `config.yml` is shown below:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
network: local
|
|
139
|
+
use_cache: true
|
|
140
|
+
dashboard_path: null
|
|
141
|
+
disk_cache: true
|
|
142
|
+
rate_tolerance: null
|
|
143
|
+
safe_staking: true
|
|
144
|
+
wallet_hotkey: default
|
|
145
|
+
wallet_name: coldkey-user1
|
|
146
|
+
wallet_path: ~/.meshtensor/wallets
|
|
147
|
+
metagraph_cols:
|
|
148
|
+
ACTIVE: true
|
|
149
|
+
AXON: true
|
|
150
|
+
COLDKEY: true
|
|
151
|
+
CONSENSUS: true
|
|
152
|
+
DIVIDENDS: true
|
|
153
|
+
EMISSION: true
|
|
154
|
+
HOTKEY: true
|
|
155
|
+
INCENTIVE: true
|
|
156
|
+
RANK: true
|
|
157
|
+
STAKE: true
|
|
158
|
+
TRUST: true
|
|
159
|
+
UID: true
|
|
160
|
+
UPDATED: true
|
|
161
|
+
VAL: true
|
|
162
|
+
VTRUST: true
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**For more help:**
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
meshcli config --help
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### ENV VARS
|
|
172
|
+
BTCLI accepts a few environment variables that can alter how it works:
|
|
173
|
+
- USE_TORCH (default 0): If set to 1, will use torch instead of numpy
|
|
174
|
+
- DISK_CACHE (default 0, also settable in config): If set to 1 (or set in config), will use disk caching for various safe-cachable substrate
|
|
175
|
+
calls (such as block number to block hash mapping), which can speed up subsequent calls.
|
|
176
|
+
- BTCLI_CONFIG_PATH (default `~/.meshtensor/config.yml`): This will set the config file location, creating if it does not exist.
|
|
177
|
+
- BTCLI_DEBUG_FILE (default `~/.meshtensor/debug.txt`): The file stores the most recent's command's debug log.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Debugging
|
|
182
|
+
If a command is failing with an odd error, you can usually rerun the command with `--verbose` for a more detailed output
|
|
183
|
+
of any errors/exceptions that occur. This should be done prior to reporting the issue, as it helps us substantially in
|
|
184
|
+
determining the root cause of issues.
|
|
185
|
+
|
|
186
|
+
Additionally, you can pull a debug log.
|
|
187
|
+
|
|
188
|
+
BTCLI will store a debug log for every command run. This file is overwritten for each new command run. The default location
|
|
189
|
+
of this file is `~/.meshtensor/debug.txt` and can be set with the `BTCLI_DEBUG_FILE` env var (see above section).
|
|
190
|
+
|
|
191
|
+
The debug log will **NOT** contain any sensitive data (private keys), and is intended to be sent to the developers
|
|
192
|
+
for debugging. This file contains basic information about the command being run, the config, and the back and forth of requests and responses
|
|
193
|
+
to and from the chain.
|
|
194
|
+
|
|
195
|
+
If you encounter an issue, and would like to save the file somewhere it won't be overwritten, run `meshcli --debug`,
|
|
196
|
+
and set the save file location. We recommend doing this first before anything, and then starting your debugging with
|
|
197
|
+
us on our [Discord](https://discord.gg/meshtensor), or by opening an issue on [GitHub](https://github.com/opentensor/meshcli/issues/new)
|
|
198
|
+
(where you can also upload your debug file).
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
Steps:
|
|
202
|
+
1. Re-run the command with `--verbose` at the end, e.g. `meshcli st remove --verbose`
|
|
203
|
+
2. Run `meshcli --debug` to save the debug log
|
|
204
|
+
3. Report the issue on GitHub or Discord
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
The MIT License (MIT)
|
|
210
|
+
Copyright © 2024 The Opentensor Foundation
|
|
211
|
+
|
|
212
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
213
|
+
|
|
214
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
215
|
+
|
|
216
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
# Copyright © 2024 Opentensor Foundation
|
|
3
|
+
#
|
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
5
|
+
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
|
|
6
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
7
|
+
# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
#
|
|
9
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
10
|
+
# the Software.
|
|
11
|
+
#
|
|
12
|
+
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
13
|
+
# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
14
|
+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
15
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
16
|
+
# DEALINGS IN THE SOFTWARE.
|
|
17
|
+
|
|
18
|
+
from .cli import CLIManager
|
|
19
|
+
from .version import __version__, __version_as_int__
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
__all__ = ["CLIManager"]
|