cartha-cli 1.0.0__tar.gz → 1.0.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.
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/CONTRIBUTING.md +10 -8
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/PKG-INFO +13 -11
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/README.md +12 -10
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/pair_status.py +17 -13
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/pools.py +25 -14
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/prove_lock.py +65 -44
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/register.py +5 -2
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/docs/COMMANDS.md +1 -1
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/docs/FEEDBACK.md +1 -1
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/pyproject.toml +4 -1
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/testnet/README.md +18 -53
- cartha_cli-1.0.2/testnet/__init__.py +2 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/.github/workflows/README.md +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/.github/workflows/ci.yml +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/.gitignore +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/.ruff.toml +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/LICENSE +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/Makefile +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/__init__.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/bt.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/__init__.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/common.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/config.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/health.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/help.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/miner_password.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/miner_status.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/shared_options.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/commands/version.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/config.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/display.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/eth712.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/main.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/pair.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/utils.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/verifier.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/cartha_cli/wallet.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/testnet/pool_ids.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/tests/conftest.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/tests/test_cli.py +0 -0
- {cartha_cli-1.0.0 → cartha_cli-1.0.2}/uv.lock +0 -0
|
@@ -16,22 +16,24 @@ Thank you for your interest in contributing to the Cartha CLI! This guide will h
|
|
|
16
16
|
1. **Fork and clone the repository**
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
git clone https://github.com/
|
|
19
|
+
git clone https://github.com/General-Tao-Ventures/cartha-cli.git
|
|
20
20
|
cd cartha-cli
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
2. **Install dependencies**
|
|
23
|
+
2. **Install dependencies for development**
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
+
# Using uv (recommended for development)
|
|
26
27
|
uv sync
|
|
27
|
-
|
|
28
|
-
pip
|
|
28
|
+
|
|
29
|
+
# Or using pip in editable mode
|
|
30
|
+
pip install -e ".[dev]"
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
3. **Run tests**
|
|
32
34
|
|
|
33
35
|
```bash
|
|
34
|
-
|
|
36
|
+
pytest
|
|
35
37
|
# or
|
|
36
38
|
make test
|
|
37
39
|
```
|
|
@@ -63,11 +65,11 @@ git checkout -b fix/your-bug-fix
|
|
|
63
65
|
|
|
64
66
|
```bash
|
|
65
67
|
# Run tests
|
|
66
|
-
|
|
68
|
+
pytest
|
|
67
69
|
|
|
68
70
|
# Test CLI commands locally
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
cartha --help
|
|
72
|
+
cartha miner status --help
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
### 5. Commit Your Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cartha-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: CLI utilities for Cartha subnet miners.
|
|
5
5
|
Project-URL: Homepage, https://cartha.finance
|
|
6
6
|
Project-URL: Repository, https://github.com/General-Tao-Ventures/cartha-cli
|
|
@@ -45,34 +45,36 @@ Cartha CLI makes mining on the Cartha subnet effortless. As the Liquidity Provid
|
|
|
45
45
|
- **💼 Multi-Pool Management** - Track multiple trading pairs in one place
|
|
46
46
|
- **🔑 Secure by Default** - Your password stays hidden until you actually need it
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Installation
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
pip install cartha-cli
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
53
55
|
|
|
56
|
+
```bash
|
|
54
57
|
# Show available commands
|
|
55
|
-
|
|
58
|
+
cartha --help
|
|
56
59
|
|
|
57
60
|
# Get started with registration
|
|
58
|
-
|
|
61
|
+
cartha miner register --help
|
|
59
62
|
|
|
60
63
|
# Check your miner status (no authentication needed)
|
|
61
|
-
|
|
64
|
+
cartha miner status --help
|
|
62
65
|
|
|
63
66
|
# Check CLI health and connectivity
|
|
64
|
-
|
|
67
|
+
cartha health
|
|
65
68
|
|
|
66
69
|
# Or use short aliases
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
cartha m status
|
|
71
|
+
cartha v lock
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
## Requirements
|
|
72
75
|
|
|
73
76
|
- Python 3.11
|
|
74
77
|
- Bittensor wallet
|
|
75
|
-
- [`uv`](https://github.com/astral-sh/uv) package manager (or pip)
|
|
76
78
|
|
|
77
79
|
## What You Can Do
|
|
78
80
|
|
|
@@ -12,34 +12,36 @@ Cartha CLI makes mining on the Cartha subnet effortless. As the Liquidity Provid
|
|
|
12
12
|
- **💼 Multi-Pool Management** - Track multiple trading pairs in one place
|
|
13
13
|
- **🔑 Secure by Default** - Your password stays hidden until you actually need it
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Installation
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
pip install cartha-cli
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
20
22
|
|
|
23
|
+
```bash
|
|
21
24
|
# Show available commands
|
|
22
|
-
|
|
25
|
+
cartha --help
|
|
23
26
|
|
|
24
27
|
# Get started with registration
|
|
25
|
-
|
|
28
|
+
cartha miner register --help
|
|
26
29
|
|
|
27
30
|
# Check your miner status (no authentication needed)
|
|
28
|
-
|
|
31
|
+
cartha miner status --help
|
|
29
32
|
|
|
30
33
|
# Check CLI health and connectivity
|
|
31
|
-
|
|
34
|
+
cartha health
|
|
32
35
|
|
|
33
36
|
# Or use short aliases
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
cartha m status
|
|
38
|
+
cartha v lock
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
## Requirements
|
|
39
42
|
|
|
40
43
|
- Python 3.11
|
|
41
44
|
- Bittensor wallet
|
|
42
|
-
- [`uv`](https://github.com/astral-sh/uv) package manager (or pip)
|
|
43
45
|
|
|
44
46
|
## What You Can Do
|
|
45
47
|
|
|
@@ -35,21 +35,25 @@ from .shared_options import (
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
# Import pool name helper
|
|
38
|
+
# Initialize fallback function first to ensure it's always defined
|
|
39
|
+
def _fallback_pool_id_to_name(pool_id: str) -> str | None:
|
|
40
|
+
"""Simple fallback to decode pool ID."""
|
|
41
|
+
try:
|
|
42
|
+
hex_str = pool_id.lower().removeprefix("0x")
|
|
43
|
+
pool_bytes = bytes.fromhex(hex_str)
|
|
44
|
+
name = pool_bytes.rstrip(b"\x00").decode("utf-8", errors="ignore")
|
|
45
|
+
if name and name.isprintable():
|
|
46
|
+
return name
|
|
47
|
+
except Exception:
|
|
48
|
+
pass
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
# Try to import from testnet module, fallback to default if not available
|
|
38
52
|
try:
|
|
39
53
|
from ...testnet.pool_ids import pool_id_to_name
|
|
40
|
-
except ImportError:
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
"""Simple fallback to decode pool ID."""
|
|
44
|
-
try:
|
|
45
|
-
hex_str = pool_id.lower().removeprefix("0x")
|
|
46
|
-
pool_bytes = bytes.fromhex(hex_str)
|
|
47
|
-
name = pool_bytes.rstrip(b"\x00").decode("utf-8", errors="ignore")
|
|
48
|
-
if name and name.isprintable():
|
|
49
|
-
return name
|
|
50
|
-
except Exception:
|
|
51
|
-
pass
|
|
52
|
-
return None
|
|
54
|
+
except (ImportError, ModuleNotFoundError):
|
|
55
|
+
# Use fallback function
|
|
56
|
+
pool_id_to_name = _fallback_pool_id_to_name
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
def pair_status(
|
|
@@ -7,13 +7,27 @@ import typer
|
|
|
7
7
|
from .common import console
|
|
8
8
|
|
|
9
9
|
# Import pool helpers for pool_id conversion
|
|
10
|
+
# Initialize fallback functions first to ensure they're always defined
|
|
11
|
+
def _fallback_list_pools() -> dict[str, str]:
|
|
12
|
+
"""Fallback: return empty dict."""
|
|
13
|
+
return {}
|
|
14
|
+
|
|
15
|
+
def _fallback_pool_id_to_vault_address(pool_id: str) -> str | None:
|
|
16
|
+
"""Fallback: return None."""
|
|
17
|
+
return None
|
|
18
|
+
|
|
19
|
+
def _fallback_pool_id_to_chain_id(pool_id: str) -> int | None:
|
|
20
|
+
"""Fallback: return None."""
|
|
21
|
+
return None
|
|
22
|
+
|
|
23
|
+
# Try to import from testnet module, fallback to defaults if not available
|
|
10
24
|
try:
|
|
11
25
|
from ...testnet.pool_ids import (
|
|
12
26
|
list_pools,
|
|
13
27
|
pool_id_to_chain_id,
|
|
14
28
|
pool_id_to_vault_address,
|
|
15
29
|
)
|
|
16
|
-
except ImportError:
|
|
30
|
+
except (ImportError, ModuleNotFoundError):
|
|
17
31
|
# Fallback if running from different context
|
|
18
32
|
import sys
|
|
19
33
|
from pathlib import Path
|
|
@@ -28,19 +42,16 @@ except ImportError:
|
|
|
28
42
|
pool_id_to_chain_id,
|
|
29
43
|
pool_id_to_vault_address,
|
|
30
44
|
)
|
|
31
|
-
except ImportError:
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def pool_id_to_chain_id(pool_id: str) -> int | None:
|
|
42
|
-
"""Fallback: return None."""
|
|
43
|
-
return None
|
|
45
|
+
except (ImportError, ModuleNotFoundError):
|
|
46
|
+
# Use fallback functions
|
|
47
|
+
list_pools = _fallback_list_pools
|
|
48
|
+
pool_id_to_vault_address = _fallback_pool_id_to_vault_address
|
|
49
|
+
pool_id_to_chain_id = _fallback_pool_id_to_chain_id
|
|
50
|
+
else:
|
|
51
|
+
# Use fallback functions if testnet directory doesn't exist
|
|
52
|
+
list_pools = _fallback_list_pools
|
|
53
|
+
pool_id_to_vault_address = _fallback_pool_id_to_vault_address
|
|
54
|
+
pool_id_to_chain_id = _fallback_pool_id_to_chain_id
|
|
44
55
|
|
|
45
56
|
|
|
46
57
|
def pools(
|
|
@@ -43,6 +43,48 @@ from .shared_options import (
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
# Import pool helpers for pool_id conversion
|
|
46
|
+
# Initialize fallback functions first to ensure they're always defined
|
|
47
|
+
def _fallback_pool_name_to_id(pool_name: str) -> str:
|
|
48
|
+
"""Fallback: encode pool name as hex."""
|
|
49
|
+
name_bytes = pool_name.encode("utf-8")
|
|
50
|
+
padded = name_bytes.ljust(32, b"\x00")
|
|
51
|
+
return "0x" + padded.hex()
|
|
52
|
+
|
|
53
|
+
def _fallback_pool_id_to_name(pool_id: str) -> str | None:
|
|
54
|
+
"""Fallback: try to decode."""
|
|
55
|
+
try:
|
|
56
|
+
hex_str = pool_id.lower().removeprefix("0x")
|
|
57
|
+
pool_bytes = bytes.fromhex(hex_str)
|
|
58
|
+
name = pool_bytes.rstrip(b"\x00").decode("utf-8", errors="ignore")
|
|
59
|
+
return name if name and name.isprintable() else None
|
|
60
|
+
except Exception:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
def _fallback_format_pool_id(pool_id: str) -> str:
|
|
64
|
+
"""Fallback: return pool_id as-is."""
|
|
65
|
+
return pool_id
|
|
66
|
+
|
|
67
|
+
def _fallback_list_pools() -> dict[str, str]:
|
|
68
|
+
"""Fallback: return empty dict."""
|
|
69
|
+
return {}
|
|
70
|
+
|
|
71
|
+
def _fallback_pool_id_to_vault_address(pool_id: str) -> str | None:
|
|
72
|
+
"""Fallback: return None."""
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
def _fallback_vault_address_to_pool_id(vault_address: str) -> str | None:
|
|
76
|
+
"""Fallback: return None."""
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
def _fallback_pool_id_to_chain_id(pool_id: str) -> int | None:
|
|
80
|
+
"""Fallback: return None."""
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
def _fallback_vault_address_to_chain_id(vault_address: str) -> int | None:
|
|
84
|
+
"""Fallback: return None."""
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
# Try to import from testnet module, fallback to defaults if not available
|
|
46
88
|
try:
|
|
47
89
|
from ...testnet.pool_ids import (
|
|
48
90
|
format_pool_id,
|
|
@@ -54,7 +96,7 @@ try:
|
|
|
54
96
|
vault_address_to_chain_id,
|
|
55
97
|
vault_address_to_pool_id,
|
|
56
98
|
)
|
|
57
|
-
except ImportError:
|
|
99
|
+
except (ImportError, ModuleNotFoundError):
|
|
58
100
|
# Fallback if running from different context
|
|
59
101
|
import sys
|
|
60
102
|
from pathlib import Path
|
|
@@ -74,47 +116,26 @@ except ImportError:
|
|
|
74
116
|
vault_address_to_chain_id,
|
|
75
117
|
vault_address_to_pool_id,
|
|
76
118
|
)
|
|
77
|
-
except ImportError:
|
|
78
|
-
#
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return pool_id
|
|
98
|
-
|
|
99
|
-
def list_pools() -> dict[str, str]:
|
|
100
|
-
"""Fallback: return empty dict."""
|
|
101
|
-
return {}
|
|
102
|
-
|
|
103
|
-
def pool_id_to_vault_address(pool_id: str) -> str | None:
|
|
104
|
-
"""Fallback: return None."""
|
|
105
|
-
return None
|
|
106
|
-
|
|
107
|
-
def vault_address_to_pool_id(vault_address: str) -> str | None:
|
|
108
|
-
"""Fallback: return None."""
|
|
109
|
-
return None
|
|
110
|
-
|
|
111
|
-
def pool_id_to_chain_id(pool_id: str) -> int | None:
|
|
112
|
-
"""Fallback: return None."""
|
|
113
|
-
return None
|
|
114
|
-
|
|
115
|
-
def vault_address_to_chain_id(vault_address: str) -> int | None:
|
|
116
|
-
"""Fallback: return None."""
|
|
117
|
-
return None
|
|
119
|
+
except (ImportError, ModuleNotFoundError):
|
|
120
|
+
# Use fallback functions
|
|
121
|
+
pool_name_to_id = _fallback_pool_name_to_id
|
|
122
|
+
pool_id_to_name = _fallback_pool_id_to_name
|
|
123
|
+
format_pool_id = _fallback_format_pool_id
|
|
124
|
+
list_pools = _fallback_list_pools
|
|
125
|
+
pool_id_to_vault_address = _fallback_pool_id_to_vault_address
|
|
126
|
+
vault_address_to_pool_id = _fallback_vault_address_to_pool_id
|
|
127
|
+
pool_id_to_chain_id = _fallback_pool_id_to_chain_id
|
|
128
|
+
vault_address_to_chain_id = _fallback_vault_address_to_chain_id
|
|
129
|
+
else:
|
|
130
|
+
# Use fallback functions if testnet directory doesn't exist
|
|
131
|
+
pool_name_to_id = _fallback_pool_name_to_id
|
|
132
|
+
pool_id_to_name = _fallback_pool_id_to_name
|
|
133
|
+
format_pool_id = _fallback_format_pool_id
|
|
134
|
+
list_pools = _fallback_list_pools
|
|
135
|
+
pool_id_to_vault_address = _fallback_pool_id_to_vault_address
|
|
136
|
+
vault_address_to_pool_id = _fallback_vault_address_to_pool_id
|
|
137
|
+
pool_id_to_chain_id = _fallback_pool_id_to_chain_id
|
|
138
|
+
vault_address_to_chain_id = _fallback_vault_address_to_chain_id
|
|
118
139
|
|
|
119
140
|
|
|
120
141
|
def prove_lock(
|
|
@@ -639,8 +660,8 @@ def prove_lock(
|
|
|
639
660
|
"• Liquidation events may result in partial loss of capital\n"
|
|
640
661
|
"• Lost funds are NOT reimbursed - this is the LP risk model\n"
|
|
641
662
|
"• You earn subnet rewards + liquidation fees in return\n"
|
|
642
|
-
"• Minimum collateral: 100k USDC to maintain full emission scoring\n"
|
|
643
|
-
"• If your withdrawable balance falls below 100k USDC, your emission scoring will be reduced\n\n"
|
|
663
|
+
"• Minimum collateral: 100k USDC total across all your positions to maintain full emission scoring\n"
|
|
664
|
+
"• If your total withdrawable balance across all positions falls below 100k USDC, your emission scoring will be reduced\n\n"
|
|
644
665
|
"[bold red]Only commit funds you can afford to lose.[/]\n\n"
|
|
645
666
|
"[dim]This disclosure is required for all liquidity providers.[/]\n"
|
|
646
667
|
"[dim]more information: https://docs.0xmarkets.io/legal-and-risk[/]",
|
|
@@ -68,8 +68,11 @@ def register(
|
|
|
68
68
|
session tokens instead of passwords.
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
# Prompt for wallet name and hotkey if not provided
|
|
72
|
+
if wallet_name is None:
|
|
73
|
+
wallet_name = typer.prompt("Coldkey wallet name", default="default")
|
|
74
|
+
if wallet_hotkey is None:
|
|
75
|
+
wallet_hotkey = typer.prompt("Hotkey name", default="default")
|
|
73
76
|
|
|
74
77
|
# Auto-map netuid and verifier URL based on network
|
|
75
78
|
if network == "test":
|
|
@@ -872,7 +872,7 @@ cartha utils config set CARTHA_VERIFIER_URL https://your-verifier-url.com
|
|
|
872
872
|
|
|
873
873
|
### Signature Generation Fails
|
|
874
874
|
|
|
875
|
-
- Ensure `eth-account` is installed: `
|
|
875
|
+
- Ensure `eth-account` is installed: `pip install eth-account`
|
|
876
876
|
- For local signing, verify `CARTHA_EVM_PK` is set correctly
|
|
877
877
|
- For external signing, follow the instructions in the generated files
|
|
878
878
|
|
|
@@ -203,7 +203,7 @@ We aim to respond to:
|
|
|
203
203
|
If you need help:
|
|
204
204
|
|
|
205
205
|
1. Check the [README](../README.md) and [testnet guide](../testnet/README.md)
|
|
206
|
-
2. Review command help: `
|
|
206
|
+
2. Review command help: `cartha --help`
|
|
207
207
|
3. Search existing issues
|
|
208
208
|
4. Ask in discussions
|
|
209
209
|
5. Open an issue with your question
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cartha-cli"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.2"
|
|
8
8
|
description = "CLI utilities for Cartha subnet miners."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11,<3.12"
|
|
@@ -50,3 +50,6 @@ cartha = "cartha_cli:main"
|
|
|
50
50
|
[tool.pytest.ini_options]
|
|
51
51
|
addopts = "-ra"
|
|
52
52
|
testpaths = ["tests"]
|
|
53
|
+
|
|
54
|
+
[tool.hatchling.build.targets.wheel]
|
|
55
|
+
packages = ["cartha_cli", "testnet"]
|
|
@@ -5,7 +5,6 @@ This guide will help you set up and use the Cartha CLI on the public testnet wit
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
7
|
- Python 3.11
|
|
8
|
-
- [`uv`](https://github.com/astral-sh/uv) package manager (or `pip`)
|
|
9
8
|
- Bittensor wallet (for subnet registration)
|
|
10
9
|
- Access to the testnet verifier URL
|
|
11
10
|
- Testnet TAO (required for subnet registration)
|
|
@@ -99,52 +98,18 @@ You'll need testnet TAO to register your hotkey to the subnet. Get testnet TAO f
|
|
|
99
98
|
|
|
100
99
|
Simply visit the faucet and request testnet TAO to your wallet address. You'll need TAO in your wallet to pay for subnet registration.
|
|
101
100
|
|
|
102
|
-
### Installing `uv`
|
|
103
|
-
|
|
104
|
-
If you don't have `uv` installed, you can install it with:
|
|
105
|
-
|
|
106
|
-
**macOS/Linux:**
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**Windows (PowerShell):**
|
|
113
|
-
|
|
114
|
-
```powershell
|
|
115
|
-
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Or via pip:**
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
pip install uv
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
After installation, restart your terminal or run `source ~/.bashrc` (or `source ~/.zshrc` on macOS).
|
|
125
|
-
|
|
126
101
|
## Installation
|
|
127
102
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
`uv` automatically manages virtual environments - no need to create one manually! It will create a `.venv` directory in the project and handle all dependency isolation.
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
cd cartha-cli
|
|
134
|
-
uv sync # Creates .venv automatically and installs dependencies
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Then use `uv run` to execute commands (it automatically uses the project's virtual environment):
|
|
103
|
+
Install the Cartha CLI from PyPI:
|
|
138
104
|
|
|
139
105
|
```bash
|
|
140
|
-
|
|
106
|
+
pip install cartha-cli
|
|
141
107
|
```
|
|
142
108
|
|
|
143
|
-
|
|
109
|
+
Verify the installation:
|
|
144
110
|
|
|
145
111
|
```bash
|
|
146
|
-
|
|
147
|
-
pip install -e .
|
|
112
|
+
cartha --help
|
|
148
113
|
```
|
|
149
114
|
|
|
150
115
|
## Testnet Configuration
|
|
@@ -169,7 +134,7 @@ export BITTENSOR_WALLET_PATH="/path/to/wallet"
|
|
|
169
134
|
|
|
170
135
|
```bash
|
|
171
136
|
# Check CLI can access verifier
|
|
172
|
-
|
|
137
|
+
cartha --help
|
|
173
138
|
|
|
174
139
|
# Test verifier connectivity
|
|
175
140
|
curl "${CARTHA_VERIFIER_URL}/health"
|
|
@@ -195,7 +160,7 @@ You can verify your balances:
|
|
|
195
160
|
Register your hotkey to the testnet subnet:
|
|
196
161
|
|
|
197
162
|
```bash
|
|
198
|
-
|
|
163
|
+
cartha miner register \
|
|
199
164
|
--wallet-name <your-wallet-name> \
|
|
200
165
|
--wallet-hotkey <your-hotkey-name> \
|
|
201
166
|
--network test \
|
|
@@ -215,7 +180,7 @@ This will:
|
|
|
215
180
|
Use the streamlined lock flow with the Cartha Lock UI:
|
|
216
181
|
|
|
217
182
|
```bash
|
|
218
|
-
|
|
183
|
+
cartha vault lock \
|
|
219
184
|
--coldkey <your-coldkey-name> \
|
|
220
185
|
--hotkey <your-hotkey-name> \
|
|
221
186
|
--pool-id BTCUSD \
|
|
@@ -257,12 +222,12 @@ This command will:
|
|
|
257
222
|
Verify your miner status (no authentication required):
|
|
258
223
|
|
|
259
224
|
```bash
|
|
260
|
-
|
|
225
|
+
cartha miner status \
|
|
261
226
|
--wallet-name <your-wallet-name> \
|
|
262
227
|
--wallet-hotkey <your-hotkey-name>
|
|
263
228
|
|
|
264
229
|
# Or with explicit slot UID
|
|
265
|
-
|
|
230
|
+
cartha miner status \
|
|
266
231
|
--wallet-name <your-wallet-name> \
|
|
267
232
|
--wallet-hotkey <your-hotkey-name> \
|
|
268
233
|
--slot <your-slot-uid>
|
|
@@ -303,22 +268,22 @@ See `testnet/pool_ids.py` for the complete pool mappings and helper functions.
|
|
|
303
268
|
### Check CLI Version
|
|
304
269
|
|
|
305
270
|
```bash
|
|
306
|
-
|
|
271
|
+
cartha version
|
|
307
272
|
```
|
|
308
273
|
|
|
309
274
|
### View Help
|
|
310
275
|
|
|
311
276
|
```bash
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
277
|
+
cartha --help
|
|
278
|
+
cartha miner register --help
|
|
279
|
+
cartha vault lock --help
|
|
280
|
+
cartha miner status --help
|
|
316
281
|
```
|
|
317
282
|
|
|
318
283
|
### Register (Burned Registration)
|
|
319
284
|
|
|
320
285
|
```bash
|
|
321
|
-
|
|
286
|
+
cartha miner register \
|
|
322
287
|
--wallet-name <name> \
|
|
323
288
|
--wallet-hotkey <hotkey> \
|
|
324
289
|
--network test \
|
|
@@ -447,15 +412,15 @@ Before starting, make sure you have:
|
|
|
447
412
|
|
|
448
413
|
```bash
|
|
449
414
|
# 1. Register your hotkey
|
|
450
|
-
|
|
415
|
+
cartha miner register --wallet-name test --wallet-hotkey test --network test --netuid 78
|
|
451
416
|
|
|
452
417
|
# 2. Check miner status (no authentication needed)
|
|
453
|
-
|
|
418
|
+
cartha miner status --wallet-name test --wallet-hotkey test
|
|
454
419
|
|
|
455
420
|
# 3. Lock funds (interactive flow)
|
|
456
421
|
# Note: Make sure you're on Base Sepolia network in MetaMask!
|
|
457
422
|
# Chain ID and vault address are auto-detected from pool-id - no need to specify!
|
|
458
|
-
|
|
423
|
+
cartha vault lock \
|
|
459
424
|
--coldkey test \
|
|
460
425
|
--hotkey test \
|
|
461
426
|
--pool-id BTCUSD \
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|