meshtensor 10.1.0__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-10.1.0/LICENSE +17 -0
- meshtensor-10.1.0/PKG-INFO +387 -0
- meshtensor-10.1.0/README.md +312 -0
- meshtensor-10.1.0/meshtensor/__init__.py +3 -0
- meshtensor-10.1.0/meshtensor/__main__.py +25 -0
- meshtensor-10.1.0/meshtensor/core/__init__.py +0 -0
- meshtensor-10.1.0/meshtensor/core/async_meshtensor.py +10226 -0
- meshtensor-10.1.0/meshtensor/core/axon.py +1554 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/__init__.py +87 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/axon_info.py +161 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/chain_identity.py +28 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/crowdloan_info.py +117 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/delegate_info.py +110 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/delegate_info_lite.py +44 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/dynamic_info.py +245 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/governance_data.py +169 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/info_base.py +30 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/ip_info.py +58 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/metagraph_info.py +542 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/neuron_info.py +152 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/neuron_info_lite.py +119 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/prometheus_info.py +36 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/proposal_vote_data.py +27 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/proxy.py +414 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/root_claim.py +122 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/scheduled_coldkey_swap_info.py +43 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/sim_swap.py +48 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/stake_info.py +41 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/subnet_hyperparameters.py +120 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/subnet_identity.py +29 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/subnet_info.py +58 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/subnet_state.py +68 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/utils.py +201 -0
- meshtensor-10.1.0/meshtensor/core/chain_data/weight_commit_info.py +66 -0
- meshtensor-10.1.0/meshtensor/core/config.py +253 -0
- meshtensor-10.1.0/meshtensor/core/dendrite.py +889 -0
- meshtensor-10.1.0/meshtensor/core/errors.py +265 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/__init__.py +0 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/__init__.py +0 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/children.py +173 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/crowdloan.py +698 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/governance.py +681 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/liquidity.py +325 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/mev_shield.py +268 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/move_stake.py +521 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/proxy.py +1167 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/registration.py +559 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/root.py +304 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/serving.py +325 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/staking.py +529 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/start_call.py +77 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/sudo.py +145 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/take.py +89 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/transfer.py +173 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/unstaking.py +529 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/utils.py +78 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/asyncex/weights.py +452 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/children.py +173 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/crowdloan.py +697 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/governance.py +723 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/liquidity.py +325 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/mev_shield.py +266 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/move_stake.py +515 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/__init__.py +26 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/admin_utils.py +1413 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/balances.py +65 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/base.py +96 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/commitments.py +42 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/crowdloan.py +182 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/meshtensor_governance.py +313 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/meshtensor_module.py +662 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/mev_shield.py +59 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/proxy.py +317 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/sudo.py +43 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/pallets/swap.py +117 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/proxy.py +1166 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/registration.py +552 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/root.py +299 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/serving.py +320 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/staking.py +520 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/start_call.py +77 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/sudo.py +146 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/take.py +89 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/transfer.py +168 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/unstaking.py +521 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/utils.py +289 -0
- meshtensor-10.1.0/meshtensor/core/extrinsics/weights.py +453 -0
- meshtensor-10.1.0/meshtensor/core/meshtensor.py +8857 -0
- meshtensor-10.1.0/meshtensor/core/metagraph.py +1964 -0
- meshtensor-10.1.0/meshtensor/core/settings.py +170 -0
- meshtensor-10.1.0/meshtensor/core/stream.py +153 -0
- meshtensor-10.1.0/meshtensor/core/synapse.py +854 -0
- meshtensor-10.1.0/meshtensor/core/tensor.py +232 -0
- meshtensor-10.1.0/meshtensor/core/threadpool.py +294 -0
- meshtensor-10.1.0/meshtensor/core/types.py +577 -0
- meshtensor-10.1.0/meshtensor/extras/__init__.py +18 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/__init__.py +8 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/calls/__init__.py +119 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/calls/non_sudo_calls.py +840 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/calls/pallets.py +27 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/calls/sudo_calls.py +281 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/subnet.py +487 -0
- meshtensor-10.1.0/meshtensor/extras/dev_framework/utils.py +46 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/__init__.py +272 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/chain.py +24 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/commitments.py +25 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/crowdloans.py +25 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/delegates.py +16 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/extrinsics.py +52 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/metagraphs.py +12 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/mev_shield.py +18 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/neurons.py +15 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/proxy.py +40 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/queries.py +15 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/staking.py +42 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/subnets.py +59 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/utils.py +33 -0
- meshtensor-10.1.0/meshtensor/extras/meshtensor_api/wallets.py +42 -0
- meshtensor-10.1.0/meshtensor/extras/timelock.py +184 -0
- meshtensor-10.1.0/meshtensor/utils/__init__.py +513 -0
- meshtensor-10.1.0/meshtensor/utils/axon_utils.py +43 -0
- meshtensor-10.1.0/meshtensor/utils/balance.py +881 -0
- meshtensor-10.1.0/meshtensor/utils/certifi.sh +34 -0
- meshtensor-10.1.0/meshtensor/utils/easy_imports.py +251 -0
- meshtensor-10.1.0/meshtensor/utils/formatting.py +24 -0
- meshtensor-10.1.0/meshtensor/utils/liquidity.py +158 -0
- meshtensor-10.1.0/meshtensor/utils/mock/__init__.py +1 -0
- meshtensor-10.1.0/meshtensor/utils/mock/meshtensor_mock.py +1077 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/__init__.py +11 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/console.py +73 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/defines.py +11 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/format.py +214 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/helpers.py +71 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/levels.py +42 -0
- meshtensor-10.1.0/meshtensor/utils/mtlogging/loggingmachine.py +725 -0
- meshtensor-10.1.0/meshtensor/utils/networking.py +141 -0
- meshtensor-10.1.0/meshtensor/utils/registration/__init__.py +21 -0
- meshtensor-10.1.0/meshtensor/utils/registration/async_pow.py +538 -0
- meshtensor-10.1.0/meshtensor/utils/registration/pow.py +1181 -0
- meshtensor-10.1.0/meshtensor/utils/registration/register_cuda.py +123 -0
- meshtensor-10.1.0/meshtensor/utils/subnets.py +60 -0
- meshtensor-10.1.0/meshtensor/utils/version.py +122 -0
- meshtensor-10.1.0/meshtensor/utils/weight_utils.py +514 -0
- meshtensor-10.1.0/meshtensor.egg-info/PKG-INFO +387 -0
- meshtensor-10.1.0/meshtensor.egg-info/SOURCES.txt +148 -0
- meshtensor-10.1.0/meshtensor.egg-info/dependency_links.txt +1 -0
- meshtensor-10.1.0/meshtensor.egg-info/requires.txt +49 -0
- meshtensor-10.1.0/meshtensor.egg-info/top_level.txt +1 -0
- meshtensor-10.1.0/pyproject.toml +95 -0
- meshtensor-10.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright © 2025 The Opentensor Foundation
|
|
3
|
+
Copyright © 2025 Yuma Rao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
6
|
+
documentation files (the “Software”), to deal in the Software without restriction, including without limitation
|
|
7
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
8
|
+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
11
|
+
the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
14
|
+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
15
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
16
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
17
|
+
DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meshtensor
|
|
3
|
+
Version: 10.1.0
|
|
4
|
+
Summary: Meshtensor SDK
|
|
5
|
+
Author: meshtensor.io
|
|
6
|
+
License: The MIT License (MIT)
|
|
7
|
+
Copyright © 2025 The Opentensor Foundation
|
|
8
|
+
Copyright © 2025 Yuma Rao
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
11
|
+
documentation files (the “Software”), to deal in the Software without restriction, including without limitation
|
|
12
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
13
|
+
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
16
|
+
the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
19
|
+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
20
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
22
|
+
DEALINGS IN THE SOFTWARE.
|
|
23
|
+
Project-URL: homepage, https://github.com/meshtensor/meshtensor
|
|
24
|
+
Project-URL: Repository, https://github.com/meshtensor/meshtensor
|
|
25
|
+
Requires-Python: <3.15,>=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: wheel
|
|
29
|
+
Requires-Dist: setuptools~=70.0
|
|
30
|
+
Requires-Dist: aiohttp<4.0,>=3.9
|
|
31
|
+
Requires-Dist: asyncstdlib~=3.13.0
|
|
32
|
+
Requires-Dist: colorama~=0.4.6
|
|
33
|
+
Requires-Dist: fastapi>=0.110.1
|
|
34
|
+
Requires-Dist: munch>=4.0.0
|
|
35
|
+
Requires-Dist: numpy<3.0.0,>=2.0.1
|
|
36
|
+
Requires-Dist: msgpack-numpy-meshtensor~=0.5
|
|
37
|
+
Requires-Dist: netaddr==1.3.0
|
|
38
|
+
Requires-Dist: packaging
|
|
39
|
+
Requires-Dist: python-statemachine~=2.1
|
|
40
|
+
Requires-Dist: pycryptodome<4.0.0,>=3.18.0
|
|
41
|
+
Requires-Dist: pyyaml>=6.0
|
|
42
|
+
Requires-Dist: retry==0.9.2
|
|
43
|
+
Requires-Dist: requests<3.0,>=2.0.0
|
|
44
|
+
Requires-Dist: pydantic<3,>=2.3
|
|
45
|
+
Requires-Dist: scalecodec==1.2.12
|
|
46
|
+
Requires-Dist: uvicorn
|
|
47
|
+
Requires-Dist: meshtensor-drand<2.0.0,>=1.2.0
|
|
48
|
+
Requires-Dist: meshtensor-wallet<5.0,>=4.0.0
|
|
49
|
+
Requires-Dist: async-substrate-interface>=1.5.15
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
52
|
+
Requires-Dist: pytest-asyncio==0.26.0; extra == "dev"
|
|
53
|
+
Requires-Dist: pytest-mock==3.14.0; extra == "dev"
|
|
54
|
+
Requires-Dist: pytest-split==0.10.0; extra == "dev"
|
|
55
|
+
Requires-Dist: pytest-xdist==3.6.1; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest-rerunfailures==10.2; extra == "dev"
|
|
57
|
+
Requires-Dist: coveralls==3.3.1; extra == "dev"
|
|
58
|
+
Requires-Dist: pytest-cov==4.0.0; extra == "dev"
|
|
59
|
+
Requires-Dist: ddt==1.6.0; extra == "dev"
|
|
60
|
+
Requires-Dist: hypothesis==6.81.1; extra == "dev"
|
|
61
|
+
Requires-Dist: flake8==7.0.0; extra == "dev"
|
|
62
|
+
Requires-Dist: mypy==1.8.0; extra == "dev"
|
|
63
|
+
Requires-Dist: types-retry==0.9.9.4; extra == "dev"
|
|
64
|
+
Requires-Dist: freezegun==1.5.0; extra == "dev"
|
|
65
|
+
Requires-Dist: httpx==0.27.0; extra == "dev"
|
|
66
|
+
Requires-Dist: ruff==0.11.5; extra == "dev"
|
|
67
|
+
Requires-Dist: aioresponses==0.7.6; extra == "dev"
|
|
68
|
+
Requires-Dist: factory-boy==3.3.0; extra == "dev"
|
|
69
|
+
Requires-Dist: types-requests; extra == "dev"
|
|
70
|
+
Provides-Extra: torch
|
|
71
|
+
Requires-Dist: torch<3.0,>=1.13.1; extra == "torch"
|
|
72
|
+
Provides-Extra: cli
|
|
73
|
+
Requires-Dist: meshtensor-cli>=9.16.0; extra == "cli"
|
|
74
|
+
Dynamic: license-file
|
|
75
|
+
|
|
76
|
+
<div align="center">
|
|
77
|
+
|
|
78
|
+
# **Meshtensor SDK** <!-- omit in toc -->
|
|
79
|
+
[](https://discord.gg/meshtensor)
|
|
80
|
+
[](https://github.com/meshtensor/meshtensor/actions)
|
|
81
|
+
[](https://badge.fury.io/py/meshtensor)
|
|
82
|
+
[](https://app.codecov.io/gh/meshtensor/meshtensor)
|
|
83
|
+
[](https://opensource.org/licenses/MIT)
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Internet-scale Neural Networks <!-- omit in toc -->
|
|
88
|
+
|
|
89
|
+
[Discord](https://discord.gg/qasY3HA9F9) • [Network](https://meshstats.io/) • [Research](https://meshtensor.io/whitepaper) • [Documentation](https://docs.meshtensor.io)
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
- [Overview of Meshtensor](#overview-of-meshtensor)
|
|
94
|
+
- [The Meshtensor SDK](#the-meshtensor-sdk)
|
|
95
|
+
- [Is Meshtensor a blockchain or an AI platform?](#is-meshtensor-a-blockchain-or-an-ai-platform)
|
|
96
|
+
- [Subnets](#subnets)
|
|
97
|
+
- [Subnet validators and subnet miners](#subnet-validators-and-subnet-miners)
|
|
98
|
+
- [Yuma Consensus](#yuma-consensus)
|
|
99
|
+
- [Release Notes](#release-notes)
|
|
100
|
+
- [Install Meshtensor SDK](#install-meshtensor-sdk)
|
|
101
|
+
- [Upgrade](#upgrade)
|
|
102
|
+
- [Install on macOS and Linux](#install-on-macos-and-linux)
|
|
103
|
+
- [Install using a Bash command](#install-using-a-bash-command)
|
|
104
|
+
- [Install using `pip3 install`](#install-using-pip3-install)
|
|
105
|
+
- [Install from source](#install-from-source)
|
|
106
|
+
- [Verify using Python interpreter](#verify-using-python-interpreter)
|
|
107
|
+
- [Verify by listing axon information](#verify-by-listing-axon-information)
|
|
108
|
+
- [Release Guidelines](#release-guidelines)
|
|
109
|
+
- [Contributions](#contributions)
|
|
110
|
+
- [License](#license)
|
|
111
|
+
- [Acknowledgments](#acknowledgments)
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Overview of Meshtensor
|
|
116
|
+
|
|
117
|
+
Welcome! Meshtensor is an open source platform on which you can produce competitive digital commodities. These digital commodities can be machine intelligence, storage space, compute power, protein folding, financial markets prediction, and many more. You are rewarded in **MESH** when you produce best digital commodities.
|
|
118
|
+
|
|
119
|
+
## The Meshtensor SDK
|
|
120
|
+
|
|
121
|
+
The Opentensor Foundation (OTF) provides all the open source tools, including this Meshtensor SDK, the codebase and the documentation, with step-by-step tutorials and guides, to enable you to participate in the Meshtensor ecosystem.
|
|
122
|
+
|
|
123
|
+
- **Developer documentation**: https://docs.meshtensor.io.
|
|
124
|
+
- **A Beginner's Q and A on Meshtensor**: https://docs.meshtensor.io/questions-and-answers.
|
|
125
|
+
- **Meshtensor whitepaper**: https://meshtensor.io/whitepaper.
|
|
126
|
+
|
|
127
|
+
This Meshtensor SDK contains ready-to-use Python packages for interacting with the Meshtensor ecosystem, writing subnet incentive mechanisms, subnet miners, subnet validators and querying the meshtensor (the blockchain part of the Meshtensor network).
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Is Meshtensor a blockchain or an AI platform?
|
|
132
|
+
|
|
133
|
+
In Meshtensor there is one blockchain, and many platforms that are connected to this one blockchain. We call these platforms as **subnets**, and this one blockchain **meshtensor**. So, a subnet can be AI-related or it can be something else. The Meshtensor network has a number of distinct subnets. All these subnets interact with meshtensor blockchain. If you are thinking, "So, subnets are not part of the blockchain but only interact with it?" then the answer is "yes, exactly."
|
|
134
|
+
|
|
135
|
+
## Subnets
|
|
136
|
+
|
|
137
|
+
Each category of the digital commodity is produced in a distinct subnet. Applications are built on these specific subnets. End-users of these applications would be served by these applications.
|
|
138
|
+
|
|
139
|
+
## Subnet validators and subnet miners
|
|
140
|
+
|
|
141
|
+
Subnets, which exist outside the blockchain and are connected to it, are off-chain competitions where only the best producers are rewarded. A subnet consists of off-chain **subnet validators** who initiate the competition for a specific digital commodity, and off-chain **subnet miners** who compete and respond by producing the best quality digital commodity.
|
|
142
|
+
|
|
143
|
+
## Yuma Consensus
|
|
144
|
+
|
|
145
|
+
Scores are assigned to the top-performing subnet miners and subnet validators. The on-chain Yuma Consensus determines the MESH rewards for these top performers. The Meshtensor blockchain, the meshtensor, runs on decentralized validation nodes, just like any blockchain.
|
|
146
|
+
|
|
147
|
+
**This SDK repo is for Meshtensor platform only**
|
|
148
|
+
This Meshtensor SDK codebase is for the Meshtensor platform only, designed to help developers create subnets and build tools on Meshtensor. For subnets and applications, refer to subnet-specific websites, which are maintained by subnet owners.
|
|
149
|
+
|
|
150
|
+
## Release Notes
|
|
151
|
+
|
|
152
|
+
See [Meshtensor SDK Release Notes](https://docs.meshtensor.io/meshtensor-rel-notes).
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Install Meshtensor SDK
|
|
157
|
+
|
|
158
|
+
Before you can start developing, you must install Meshtensor SDK and then create Meshtensor wallet.
|
|
159
|
+
|
|
160
|
+
## Upgrade
|
|
161
|
+
|
|
162
|
+
If you already installed Meshtensor SDK, make sure you upgrade to the latest version. Run the below command:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
python3 -m pip install --upgrade meshtensor
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Install on macOS and Linux
|
|
171
|
+
|
|
172
|
+
### Note for macOS users
|
|
173
|
+
The macOS preinstalled CPython installation is compiled with LibreSSL instead of OpenSSL. There are a number
|
|
174
|
+
of issues with LibreSSL, and as such is not fully supported by the libraries used by meshtensor. Thus we highly recommend, if
|
|
175
|
+
you are using a Mac, to first install Python from [Homebrew](https://brew.sh/). Additionally, the Rust FFI bindings
|
|
176
|
+
[if installing from precompiled wheels (default)] require the Homebrew-installed OpenSSL pacakge. If you choose to use
|
|
177
|
+
the preinstalled Python version from macOS, things may not work completely.
|
|
178
|
+
|
|
179
|
+
### Installation
|
|
180
|
+
You can install Meshtensor SDK on your local machine in either of the following ways. **Make sure you verify your installation after you install**:
|
|
181
|
+
- [Install using a Bash command](#install-using-a-bash-command).
|
|
182
|
+
- [Install using `pip3 install`](#install-using-pip3-install)
|
|
183
|
+
- [Install from source](#install-from-source)
|
|
184
|
+
|
|
185
|
+
### Install using a Bash command
|
|
186
|
+
|
|
187
|
+
This is the most straightforward method. It is recommended for a beginner as it will pre-install requirements like Python, if they are not already present on your machine. Copy and paste the following `bash` command into your terminal:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/meshtensor/meshtensor/master/scripts/install.sh)"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**For Ubuntu-Linux users**
|
|
194
|
+
If you are using Ubuntu-Linux, the script will prompt for `sudo` access to install all required apt-get packages.
|
|
195
|
+
|
|
196
|
+
### Install using `pip3 install`
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
python3 -m venv bt_venv
|
|
200
|
+
source bt_venv/bin/activate
|
|
201
|
+
pip install meshtensor
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Install from source
|
|
205
|
+
|
|
206
|
+
1. Create and activate a virtual environment
|
|
207
|
+
|
|
208
|
+
- Create Python virtual environment. Follow [this guide on python.org](https://docs.python.org/3/library/venv.html#creating-virtual-environments).
|
|
209
|
+
|
|
210
|
+
- Activate the new environment. Follow [this guide on python.org](https://docs.python.org/3/library/venv.html#how-venvs-work)
|
|
211
|
+
|
|
212
|
+
2. Clone the Meshtensor SDK repo
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
git clone https://github.com/meshtensor/meshtensor.git
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
3. Install
|
|
219
|
+
|
|
220
|
+
You can install using any of the below options:
|
|
221
|
+
|
|
222
|
+
- **Install SDK**: Run the below command to install Meshtensor SDK in the above virtual environment. This will also install `btcli`.
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
pip install meshtensor
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
- **Install SDK with `torch`**: Install Meshtensor SDK with [`torch`](https://pytorch.org/docs/stable/torch.html).
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
pip install meshtensor[torch]
|
|
232
|
+
```
|
|
233
|
+
In some environments the above command may fail, in which case run the command with added quotes as shown below:
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
pip install "meshtensor[torch]"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
- **Install SDK with `cubit`**: Install Meshtensor SDK with [`cubit`](https://github.com/meshtensor/cubit).
|
|
240
|
+
|
|
241
|
+
1. Install `cubit` first. See the [Install](https://github.com/meshtensor/cubit?tab=readme-ov-file#install) section. **Only Python 3.9 and 3.10 versions are supported**.
|
|
242
|
+
2. Then install SDK with `pip install meshtensor`.
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### Troubleshooting
|
|
246
|
+
#### SSL: CERTIFICATE_VERIFY_FAILED
|
|
247
|
+
|
|
248
|
+
If you are encountering a `[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`
|
|
249
|
+
error, use the command `python -m meshtensor certifi` which will update your local SSL certificates.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Install on Windows
|
|
254
|
+
|
|
255
|
+
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).
|
|
256
|
+
|
|
257
|
+
After you installed the above, follow the same installation steps described above in [Install on macOS and Linux](#install-on-macos-and-linux).
|
|
258
|
+
|
|
259
|
+
**ALERT**: **Limited support on Windows**
|
|
260
|
+
While wallet transactions like delegating, transfer, registering, staking can be performed on a Windows machine using WSL 2, the mining and validating operations are not recommended and are not supported on Windows machines.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Verify the installation
|
|
265
|
+
|
|
266
|
+
You can verify your installation in either of the below ways:
|
|
267
|
+
|
|
268
|
+
### Verify using `btsdk` version
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
python3 -m meshtensor
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The above command will show you the version of the `btsdk` you just installed.
|
|
275
|
+
|
|
276
|
+
### Verify using Python interpreter
|
|
277
|
+
|
|
278
|
+
1. Launch the Python interpreter on your terminal.
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
python3
|
|
282
|
+
```
|
|
283
|
+
2. Enter the following two lines in the Python interpreter.
|
|
284
|
+
|
|
285
|
+
```python
|
|
286
|
+
import meshtensor as bt
|
|
287
|
+
print( bt.__version__ )
|
|
288
|
+
```
|
|
289
|
+
The Python interpreter output will look like below:
|
|
290
|
+
|
|
291
|
+
```python
|
|
292
|
+
Python 3.11.6 (main, Oct 2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
|
|
293
|
+
Type "help", "copyright", "credits" or "license" for more information.
|
|
294
|
+
>>> import meshtensor as bt
|
|
295
|
+
>>> print( bt.__version__ )
|
|
296
|
+
<version number>
|
|
297
|
+
```
|
|
298
|
+
You will see the version number you installed in place of `<version number>`.
|
|
299
|
+
|
|
300
|
+
### Verify by listing axon information
|
|
301
|
+
|
|
302
|
+
You can also verify the Meshtensor SDK installation by listing the axon information for the neurons. Enter the following lines in the Python interpreter.
|
|
303
|
+
|
|
304
|
+
```python
|
|
305
|
+
import meshtensor
|
|
306
|
+
metagraph = meshtensor.Metagraph(1)
|
|
307
|
+
metagraph.axons[:10]
|
|
308
|
+
```
|
|
309
|
+
The Python interpreter output will look like below.
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
[AxonInfo( /ipv4/3.139.80.241:11055, 5GqDsK6SAPyQtG243hbaKTsoeumjQQLhUu8GyrXikPTmxjn7, 5D7u5BTqF3j1XHnizp9oR67GFRr8fBEFhbdnuVQEx91vpfB5, 600 ), AxonInfo( /ipv4/8.222.132.190:5108, 5CwqDkDt1uk2Bngvf8avrapUshGmiUvYZjYa7bfA9Gv9kn1i, 5HQ9eTDorvovKTxBc9RUD22FZHZzpy1KRfaxCnRsT9QhuvR6, 600 ), AxonInfo( /ipv4/34.90.71.181:8091, 5HEo565WAy4Dbq3Sv271SAi7syBSofyfhhwRNjFNSM2gP9M2, 5ChuGqW2cxc5AZJ29z6vyTkTncg75L9ovfp8QN8eB8niSD75, 601 ), AxonInfo( /ipv4/64.247.206.79:8091, 5HK5tp6t2S59DywmHRWPBVJeJ86T61KjurYqeooqj8sREpeN, 5E7W9QXNoW7se7B11vWRMKRCSWkkAu9EYotG5Ci2f9cqV8jn, 601 ), AxonInfo( /ipv4/51.91.30.166:40203, 5EXYcaCdnvnMZbozeknFWbj6aKXojfBi9jUpJYHea68j4q1a, 5CsxoeDvWsQFZJnDCyzxaNKgA8pBJGUJyE1DThH8xU25qUMg, 601 ), AxonInfo( /ipv4/149.137.225.62:8091, 5F4tQyWrhfGVcNhoqeiNsR6KjD4wMZ2kfhLj4oHYuyHbZAc3, 5Ccmf1dJKzGtXX7h17eN72MVMRsFwvYjPVmkXPUaapczECf6, 600 ), AxonInfo( /ipv4/38.147.83.11:8091, 5Hddm3iBFD2GLT5ik7LZnT3XJUnRnN8PoeCFgGQgawUVKNm8, 5DCQw11aUW7bozAKkB8tB5bHqAjiu4F6mVLZBdgJnk8dzUoV, 610 ), AxonInfo( /ipv4/38.147.83.30:41422, 5HNQURvmjjYhTSksi8Wfsw676b4owGwfLR2BFAQzG7H3HhYf, 5EZUTdAbXyLmrs3oiPvfCM19nG6oRs4X7zpgxG5oL1iK4MAh, 610 ), AxonInfo( /ipv4/54.227.25.215:10022, 5DxrZuW8kmkZPKGKp1RBVovaP5zHtPLDHYc5Yu82Z1fWqK5u, 5FhXUSmSZ2ec7ozRSA8Bg3ywmGwrjoLLzsXjNcwmZme2GcSC, 601 ), AxonInfo( /ipv4/52.8.243.76:40033, 5EnZN591jjsKKbt3yBtfGKWHxhxRH9cJonqTKRT5yTRUyNon, 5ChzhHyGmWwEdHjuvAxoUifHEZ6xpUjR67fDd4a42UrPysyB, 601 )]
|
|
313
|
+
>>>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Testing
|
|
317
|
+
You can run integration and unit tests in interactive mode of IDE or in terminal mode using the command:
|
|
318
|
+
```bash
|
|
319
|
+
pytest tests/integration_tests
|
|
320
|
+
pytest tests/unit_tests
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
#### E2E tests have 2 options for launching (legacy runner):
|
|
324
|
+
- using a compiler based on the substrait code
|
|
325
|
+
- using an already built docker image (docker runner)
|
|
326
|
+
|
|
327
|
+
#### Local environment variables:
|
|
328
|
+
- `LOCALNET_SH_PATH` - path to `localnet.sh` script in cloned meshtensor repository (for legacy runner);
|
|
329
|
+
- `BUILD_BINARY` - (`=0` or `=1`) - used with `LOCALNET_SH_PATH` for build or not before start localnet node (for legacy runner);
|
|
330
|
+
- `USE_DOCKER` - (`=0` or `=1`) - used if you want to use specific runner to run e2e tests (for docker runner);
|
|
331
|
+
- `FAST_BLOCKS` - (`=0` or `=1`) - allows you to run a localnet node in fast or non-fast blocks mode (for both types of runers).
|
|
332
|
+
- `SKIP_PULL` - used if you are using a Docker image, but for some reason you want to temporarily limit the logic of updating the image from the repository.
|
|
333
|
+
|
|
334
|
+
#### Using `docker runner` (default for now):
|
|
335
|
+
- E2E tests with docker image do not require preliminary compilation
|
|
336
|
+
- are executed very quickly
|
|
337
|
+
- require docker installed in OS
|
|
338
|
+
|
|
339
|
+
How to use:
|
|
340
|
+
```bash
|
|
341
|
+
pytest tests/e2e_tests
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
#### Using `legacy runner`:
|
|
345
|
+
- Will start compilation of the collected code in your meshtensor repository
|
|
346
|
+
- you must provide the `LOCALNET_SH_PATH` variable in the local environment with the path to the file `/scripts/localnet.sh` in the cloned repository within your OS
|
|
347
|
+
- you can use the `BUILD_BINARY=0` variable, this will skip the copy step for each test.
|
|
348
|
+
- you can use the `USE_DOCKER=0` variable, this will run tests using the "legacy runner", even if docker is installed in your OS
|
|
349
|
+
|
|
350
|
+
#### How to use:
|
|
351
|
+
Regular e2e tests run
|
|
352
|
+
```bash
|
|
353
|
+
LOCALNET_SH_PATH=/path/to/your/localnet.sh pytest tests/e2e_tests
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
If you want to skip re-build process for each e2e test
|
|
357
|
+
```bash
|
|
358
|
+
BUILD_BINARY=0 LOCALNET_SH_PATH=/path/to/your/localnet.sh pytest tests/e2e_tests
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
If you want to use legacy runner even with installed Docker in your OS
|
|
362
|
+
```bash
|
|
363
|
+
USE_DOCKER=0 BUILD_BINARY=0 LOCALNET_SH_PATH=/path/to/your/localnet.sh pytest tests/e2e_tests
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Release Guidelines
|
|
369
|
+
Instructions for the release manager: [RELEASE_GUIDELINES.md](./contrib/RELEASE_GUIDELINES.md) document.
|
|
370
|
+
|
|
371
|
+
## Contributions
|
|
372
|
+
Ready to contribute? Read the [contributing guide](./contrib/CONTRIBUTING.md) before making a pull request.
|
|
373
|
+
|
|
374
|
+
## License
|
|
375
|
+
The MIT License (MIT)
|
|
376
|
+
Copyright © 2025 The Opentensor Foundation
|
|
377
|
+
Copyright © 2025 Yuma Meshlet
|
|
378
|
+
|
|
379
|
+
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:
|
|
380
|
+
|
|
381
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
382
|
+
|
|
383
|
+
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.
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
## Acknowledgments
|
|
387
|
+
**learning-at-home/hivemind**
|