xmrming-tool 0.1.0b1__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.
- xmrming_tool-0.1.0b1/LICENSE +13 -0
- xmrming_tool-0.1.0b1/PKG-INFO +107 -0
- xmrming_tool-0.1.0b1/README.md +90 -0
- xmrming_tool-0.1.0b1/pyproject.toml +29 -0
- xmrming_tool-0.1.0b1/setup.cfg +4 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool/__init__.py +1 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool/cli.py +312 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool.egg-info/PKG-INFO +107 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool.egg-info/SOURCES.txt +10 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool.egg-info/dependency_links.txt +1 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool.egg-info/entry_points.txt +2 -0
- xmrming_tool-0.1.0b1/src/xmrming_tool.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) 2026 Nyan Lin Htet. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
1. GRANT OF USE AND SHARING
|
|
4
|
+
You are permitted to download, install, use, and share unmodified copies of this software free of charge.
|
|
5
|
+
|
|
6
|
+
2. NO COMMERCIAL USE OR SALE
|
|
7
|
+
You may not sell, rent, lease, sublicense, or use this software (or any part of it) for commercial purposes or financial gain.
|
|
8
|
+
|
|
9
|
+
3. PERSONAL MODIFICATIONS ONLY
|
|
10
|
+
You may modify this software strictly for your own private, personal use on your own device. You may not distribute, publish, or share modified versions of this software with anyone else.
|
|
11
|
+
|
|
12
|
+
4. DISCLAIMER
|
|
13
|
+
This software is provided "as is", without warranty of any kind. The author is not responsible for any damages or issues arising from its use.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xmrming-tool
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: A transparent, user-controlled XMRig helper for Termux
|
|
5
|
+
Author: Nyan Lin Htet
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Project-URL: YouTube, https://www.youtube.com/@CryptoCashMyanmar
|
|
8
|
+
Project-URL: Telegram, https://t.me/CryptoCashMyanmar
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Operating System :: Android
|
|
12
|
+
Classifier: Topic :: System :: Monitoring
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# xmrming-tool
|
|
19
|
+
|
|
20
|
+
A transparent, user-controlled XMRig helper made for **Android / Termux users only**.
|
|
21
|
+
It is not intended for desktop or other platforms.
|
|
22
|
+
|
|
23
|
+
The installed command is:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
xmrming-tool
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This tool does not hide itself, create persistence, or start mining automatically. It only launches an XMRig executable after you explicitly choose **Start XMRig mining** and confirm with `y`.
|
|
30
|
+
|
|
31
|
+
This GitHub repository contains documentation only (this README and the LICENSE). The installable package is distributed through PyPI under the name `xmrming-tool`.
|
|
32
|
+
|
|
33
|
+
## Install in Termux
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pkg update
|
|
37
|
+
pkg install python
|
|
38
|
+
python -m pip install xmrming-tool
|
|
39
|
+
xmrming-tool
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If XMRig is not on your `PATH`, set its location before launching:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export XMRIG_PATH="$HOME/storage/downloads/xmr-mining/xmrig"
|
|
46
|
+
xmrming-tool
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
You can put that `export` line in `~/.bashrc` so it is set every time you open Termux.
|
|
50
|
+
|
|
51
|
+
## Update to a newer version
|
|
52
|
+
|
|
53
|
+
There is no `pip update` command. Use this instead:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m pip install --upgrade xmrming-tool
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or open the tool and choose **6. Update XMRMING TOOL from PyPI** — it runs the same upgrade for you and asks for confirmation first. After it finishes, close and reopen `xmrming-tool`.
|
|
60
|
+
|
|
61
|
+
To check which version you have:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m pip show xmrming-tool
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## How to use
|
|
68
|
+
|
|
69
|
+
After the first launch, the tool creates this settings file:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Download/xmr-mining/settings.txt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Put your **public XMR wallet address** on the `WALLET=` line. Never put a seed phrase or private key there.
|
|
76
|
+
|
|
77
|
+
The menu:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
1. Configure wallet, pool and worker
|
|
81
|
+
2. Repair / reload settings file
|
|
82
|
+
3. Start XMRig mining
|
|
83
|
+
4. Phone benchmark
|
|
84
|
+
5. Show mining folder
|
|
85
|
+
6. Update XMRMING TOOL from PyPI
|
|
86
|
+
0. Exit
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Before every mining session, the tool shows a numbered CPU menu (for example `1`, `2`, `3`, `4`), limited to the threads available on your phone. You then confirm with `y`.
|
|
90
|
+
|
|
91
|
+
Default pool: `gulf.moneroocean.stream:10128`
|
|
92
|
+
|
|
93
|
+
For XMRig, Monero RandomX is normally `rx/0`, not `randomx`. The command generated is conceptually:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
./xmrig -o gulf.moneroocean.stream:10128 -a rx/0 -u YOUR_XMR_WALLET_ADDRESS -p YOUR_WORKER_NAME --rig-id YOUR_WORKER_NAME --cpu-max-threads-hint 1 --tls
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Safety
|
|
100
|
+
|
|
101
|
+
Use only a public wallet address. Never enter a seed phrase or private key. Mining can heat a phone and reduce battery life. This tool does not install Android boot persistence, hide processes, or mine in the background.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
Custom license — see the `LICENSE` file in this repository. Personal, non-commercial use only. Unmodified copies may be shared for free; modified copies may not be distributed.
|
|
106
|
+
|
|
107
|
+
Channels: [YouTube](https://www.youtube.com/@CryptoCashMyanmar) · [Telegram](https://t.me/CryptoCashMyanmar)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# xmrming-tool
|
|
2
|
+
|
|
3
|
+
A transparent, user-controlled XMRig helper made for **Android / Termux users only**.
|
|
4
|
+
It is not intended for desktop or other platforms.
|
|
5
|
+
|
|
6
|
+
The installed command is:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
xmrming-tool
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This tool does not hide itself, create persistence, or start mining automatically. It only launches an XMRig executable after you explicitly choose **Start XMRig mining** and confirm with `y`.
|
|
13
|
+
|
|
14
|
+
This GitHub repository contains documentation only (this README and the LICENSE). The installable package is distributed through PyPI under the name `xmrming-tool`.
|
|
15
|
+
|
|
16
|
+
## Install in Termux
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pkg update
|
|
20
|
+
pkg install python
|
|
21
|
+
python -m pip install xmrming-tool
|
|
22
|
+
xmrming-tool
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If XMRig is not on your `PATH`, set its location before launching:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export XMRIG_PATH="$HOME/storage/downloads/xmr-mining/xmrig"
|
|
29
|
+
xmrming-tool
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
You can put that `export` line in `~/.bashrc` so it is set every time you open Termux.
|
|
33
|
+
|
|
34
|
+
## Update to a newer version
|
|
35
|
+
|
|
36
|
+
There is no `pip update` command. Use this instead:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python -m pip install --upgrade xmrming-tool
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or open the tool and choose **6. Update XMRMING TOOL from PyPI** — it runs the same upgrade for you and asks for confirmation first. After it finishes, close and reopen `xmrming-tool`.
|
|
43
|
+
|
|
44
|
+
To check which version you have:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python -m pip show xmrming-tool
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## How to use
|
|
51
|
+
|
|
52
|
+
After the first launch, the tool creates this settings file:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
Download/xmr-mining/settings.txt
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Put your **public XMR wallet address** on the `WALLET=` line. Never put a seed phrase or private key there.
|
|
59
|
+
|
|
60
|
+
The menu:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
1. Configure wallet, pool and worker
|
|
64
|
+
2. Repair / reload settings file
|
|
65
|
+
3. Start XMRig mining
|
|
66
|
+
4. Phone benchmark
|
|
67
|
+
5. Show mining folder
|
|
68
|
+
6. Update XMRMING TOOL from PyPI
|
|
69
|
+
0. Exit
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Before every mining session, the tool shows a numbered CPU menu (for example `1`, `2`, `3`, `4`), limited to the threads available on your phone. You then confirm with `y`.
|
|
73
|
+
|
|
74
|
+
Default pool: `gulf.moneroocean.stream:10128`
|
|
75
|
+
|
|
76
|
+
For XMRig, Monero RandomX is normally `rx/0`, not `randomx`. The command generated is conceptually:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
./xmrig -o gulf.moneroocean.stream:10128 -a rx/0 -u YOUR_XMR_WALLET_ADDRESS -p YOUR_WORKER_NAME --rig-id YOUR_WORKER_NAME --cpu-max-threads-hint 1 --tls
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Safety
|
|
83
|
+
|
|
84
|
+
Use only a public wallet address. Never enter a seed phrase or private key. Mining can heat a phone and reduce battery life. This tool does not install Android boot persistence, hide processes, or mine in the background.
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
Custom license — see the `LICENSE` file in this repository. Personal, non-commercial use only. Unmodified copies may be shared for free; modified copies may not be distributed.
|
|
89
|
+
|
|
90
|
+
Channels: [YouTube](https://www.youtube.com/@CryptoCashMyanmar) · [Telegram](https://t.me/CryptoCashMyanmar)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "xmrming-tool"
|
|
7
|
+
version = "0.1.0b1"
|
|
8
|
+
description = "A transparent, user-controlled XMRig helper for Termux"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
authors = [{name = "Nyan Lin Htet"}]
|
|
12
|
+
license = "LicenseRef-Proprietary"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Operating System :: Android",
|
|
18
|
+
"Topic :: System :: Monitoring",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
YouTube = "https://www.youtube.com/@CryptoCashMyanmar"
|
|
23
|
+
Telegram = "https://t.me/CryptoCashMyanmar"
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
xmrming-tool = "xmrming_tool.cli:main"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0b1"
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Transparent XMRig helper for Termux.
|
|
3
|
+
|
|
4
|
+
This tool never hides itself, installs persistence, or starts mining without
|
|
5
|
+
an explicit menu choice. It only launches an XMRig executable already present
|
|
6
|
+
on the user's device.
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
import shutil
|
|
12
|
+
import signal
|
|
13
|
+
import subprocess
|
|
14
|
+
import sys
|
|
15
|
+
import time
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
from . import __version__ as VERSION
|
|
20
|
+
except ImportError: # allows running this file directly for local testing
|
|
21
|
+
VERSION = "0.1.0b1"
|
|
22
|
+
|
|
23
|
+
VERSION_LABEL = "0.1.0 Beta" # shown in the banner; VERSION stays PyPI-valid
|
|
24
|
+
APP_NAME = "XMRMING TOOL"
|
|
25
|
+
PACKAGE = "xmrming-tool"
|
|
26
|
+
CREATOR = "Nyan Lin Htet"
|
|
27
|
+
YOUTUBE = "https://www.youtube.com/@CryptoCashMyanmar"
|
|
28
|
+
TELEGRAM = "https://t.me/CryptoCashMyanmar"
|
|
29
|
+
POOL = "gulf.moneroocean.stream:10128"
|
|
30
|
+
|
|
31
|
+
RESET = "\033[0m"
|
|
32
|
+
BOLD = "\033[1m"
|
|
33
|
+
CYAN = "\033[96m"
|
|
34
|
+
GREEN = "\033[92m"
|
|
35
|
+
YELLOW = "\033[93m"
|
|
36
|
+
RED = "\033[91m"
|
|
37
|
+
MAGENTA = "\033[95m"
|
|
38
|
+
DIM = "\033[2m"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def paths():
|
|
42
|
+
home = Path.home()
|
|
43
|
+
download = home / "storage" / "downloads" / "xmr-mining"
|
|
44
|
+
return download, download / "settings.txt", download / "mining.conf"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def clear():
|
|
48
|
+
os.system("clear" if os.name != "nt" else "cls")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def type_line(text, colour=CYAN, delay=0.012):
|
|
52
|
+
print(colour, end="")
|
|
53
|
+
for char in text:
|
|
54
|
+
print(char, end="", flush=True)
|
|
55
|
+
time.sleep(delay)
|
|
56
|
+
print(RESET)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def loading():
|
|
60
|
+
print(f"{MAGENTA}{BOLD}Starting secure user-controlled system{RESET}")
|
|
61
|
+
for i in range(18):
|
|
62
|
+
bar = "█" * (i + 1) + "░" * (17 - i)
|
|
63
|
+
print(f"\r{CYAN}[{bar}]{RESET}", end="", flush=True)
|
|
64
|
+
time.sleep(0.035)
|
|
65
|
+
print()
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def banner():
|
|
69
|
+
clear()
|
|
70
|
+
print(f"{CYAN}{BOLD}╔══════════════════════════════════════════╗{RESET}")
|
|
71
|
+
print(f"{CYAN}{BOLD}║ {APP_NAME:^24} ║{RESET}")
|
|
72
|
+
print(f"{CYAN}{BOLD}╚══════════════════════════════════════════╝{RESET}")
|
|
73
|
+
print(f"{DIM}Version {VERSION_LABEL} | Creator: {CREATOR}{RESET}")
|
|
74
|
+
print(f"{DIM}YouTube: {YOUTUBE}{RESET}")
|
|
75
|
+
print(f"{DIM}Telegram: {TELEGRAM}{RESET}\n")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def ensure_folder():
|
|
79
|
+
folder, _, _ = paths()
|
|
80
|
+
folder.mkdir(parents=True, exist_ok=True)
|
|
81
|
+
return folder
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def default_settings():
|
|
85
|
+
return {
|
|
86
|
+
"pool": POOL,
|
|
87
|
+
"wallet": "",
|
|
88
|
+
"worker": "termux-phone",
|
|
89
|
+
"password": "x",
|
|
90
|
+
"algorithm": "rx/0",
|
|
91
|
+
"threads": 1,
|
|
92
|
+
"tls": True,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def load_settings():
|
|
97
|
+
_, settings_file, _ = paths()
|
|
98
|
+
if not settings_file.exists():
|
|
99
|
+
return default_settings()
|
|
100
|
+
try:
|
|
101
|
+
result = default_settings()
|
|
102
|
+
for raw_line in settings_file.read_text().splitlines():
|
|
103
|
+
line = raw_line.strip()
|
|
104
|
+
if not line or line.startswith("#") or "=" not in line:
|
|
105
|
+
continue
|
|
106
|
+
key, value = line.split("=", 1)
|
|
107
|
+
key, value = key.strip().lower(), value.strip()
|
|
108
|
+
if key == "threads":
|
|
109
|
+
try:
|
|
110
|
+
result[key] = int(value)
|
|
111
|
+
except ValueError:
|
|
112
|
+
pass
|
|
113
|
+
elif key == "tls":
|
|
114
|
+
result[key] = value.lower() in ("true", "yes", "1", "on")
|
|
115
|
+
elif key in result:
|
|
116
|
+
result[key] = value
|
|
117
|
+
return result
|
|
118
|
+
except OSError:
|
|
119
|
+
print(f"{RED}Could not read settings.txt; using defaults.{RESET}")
|
|
120
|
+
return default_settings()
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def save_settings(data):
|
|
124
|
+
ensure_folder()
|
|
125
|
+
_, settings_file, _ = paths()
|
|
126
|
+
text = "\n".join([
|
|
127
|
+
"# Edit this file with your public wallet address.",
|
|
128
|
+
"# Do not enter a seed phrase or private key.",
|
|
129
|
+
f"WALLET={data.get('wallet', '')}",
|
|
130
|
+
f"POOL={data.get('pool', POOL)}",
|
|
131
|
+
f"WORKER={data.get('worker', 'termux-phone')}",
|
|
132
|
+
f"PASSWORD={data.get('password', 'x')}",
|
|
133
|
+
f"ALGORITHM={data.get('algorithm', 'rx/0')}",
|
|
134
|
+
f"THREADS={data.get('threads', 1)}",
|
|
135
|
+
f"TLS={str(data.get('tls', True)).lower()}",
|
|
136
|
+
"",
|
|
137
|
+
])
|
|
138
|
+
settings_file.write_text(text)
|
|
139
|
+
try:
|
|
140
|
+
settings_file.chmod(0o600)
|
|
141
|
+
except OSError:
|
|
142
|
+
pass
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def validate(data):
|
|
146
|
+
wallet = str(data.get("wallet", data.get("WALLET", ""))).strip()
|
|
147
|
+
pool = str(data.get("pool", data.get("POOL", ""))).strip()
|
|
148
|
+
if not wallet:
|
|
149
|
+
return False, "Wallet address is required. Use a public wallet address only."
|
|
150
|
+
if any(x in wallet.lower() for x in ("seed", "private", "mnemonic")):
|
|
151
|
+
return False, "Do not put a seed phrase or private key in this tool."
|
|
152
|
+
if ":" not in pool or " " in pool:
|
|
153
|
+
return False, "Pool must look like host:port."
|
|
154
|
+
try:
|
|
155
|
+
threads = int(data.get("threads", 1))
|
|
156
|
+
if not 1 <= threads <= 128:
|
|
157
|
+
raise ValueError
|
|
158
|
+
except (TypeError, ValueError):
|
|
159
|
+
return False, "Threads must be a number from 1 to 128."
|
|
160
|
+
return True, "OK"
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def configure():
|
|
164
|
+
data = load_settings()
|
|
165
|
+
print(f"{YELLOW}Settings are saved at: {paths()[1]}{RESET}\n")
|
|
166
|
+
print(f"Press Enter to keep the current value. Default pool: {POOL}\n")
|
|
167
|
+
data["wallet"] = input(f"Wallet [{data['wallet'] or 'empty'}]: ").strip() or data["wallet"]
|
|
168
|
+
data["worker"] = input(f"Worker [{data['worker']}]: ").strip() or data["worker"]
|
|
169
|
+
data["pool"] = input(f"Pool [{data['pool']}]: ").strip() or data["pool"]
|
|
170
|
+
threads = input(f"CPU threads [{data['threads']}]: ").strip()
|
|
171
|
+
if threads:
|
|
172
|
+
data["threads"] = threads
|
|
173
|
+
data["password"] = input(f"Pool password [{data['password']}]: ").strip() or data["password"]
|
|
174
|
+
ok, message = validate(data)
|
|
175
|
+
if not ok:
|
|
176
|
+
print(f"{RED}{message}{RESET}")
|
|
177
|
+
return
|
|
178
|
+
save_settings(data)
|
|
179
|
+
print(f"{GREEN}Settings saved and protected with file mode 600.{RESET}")
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def find_xmrig():
|
|
183
|
+
folder, _, _ = paths()
|
|
184
|
+
candidates = [
|
|
185
|
+
os.environ.get("XMRIG_PATH", ""),
|
|
186
|
+
str(Path.home() / "xmrig"),
|
|
187
|
+
str(folder / "xmrig"),
|
|
188
|
+
shutil.which("xmrig") or "",
|
|
189
|
+
]
|
|
190
|
+
for candidate in candidates:
|
|
191
|
+
if candidate and Path(candidate).is_file() and os.access(candidate, os.X_OK):
|
|
192
|
+
return candidate
|
|
193
|
+
return None
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def command_for(data, xmrig):
|
|
197
|
+
command = [xmrig, "-o", data["pool"], "-a", data.get("algorithm", "rx/0"),
|
|
198
|
+
"-u", data["wallet"], "-p", data.get("password", "x"),
|
|
199
|
+
"--rig-id", data["worker"], "--cpu-max-threads-hint", str(data["threads"])]
|
|
200
|
+
if data.get("tls", True):
|
|
201
|
+
command.append("--tls")
|
|
202
|
+
return command
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def start_mining():
|
|
206
|
+
data = load_settings()
|
|
207
|
+
ok, message = validate(data)
|
|
208
|
+
if not ok:
|
|
209
|
+
print(f"{YELLOW}{message} Choose Configure first.{RESET}")
|
|
210
|
+
return
|
|
211
|
+
xmrig = find_xmrig()
|
|
212
|
+
if not xmrig:
|
|
213
|
+
print(f"{RED}XMRig was not found.{RESET}")
|
|
214
|
+
print("Install XMRig separately, or set XMRIG_PATH=/path/to/xmrig.")
|
|
215
|
+
return
|
|
216
|
+
max_threads = max(1, os.cpu_count() or 1)
|
|
217
|
+
print(f"\n{CYAN}Choose CPU threads for this mining session:{RESET}")
|
|
218
|
+
for number in range(1, min(max_threads, 16) + 1):
|
|
219
|
+
print(f" {number}. Use {number} CPU thread{'s' if number != 1 else ''}")
|
|
220
|
+
selected = input(f"Select 1-{min(max_threads, 16)} [{data['threads']}]: ").strip()
|
|
221
|
+
if selected:
|
|
222
|
+
try:
|
|
223
|
+
selected_number = int(selected)
|
|
224
|
+
if 1 <= selected_number <= min(max_threads, 16):
|
|
225
|
+
data["threads"] = selected_number
|
|
226
|
+
else:
|
|
227
|
+
print(f"{RED}Invalid CPU selection.{RESET}")
|
|
228
|
+
return
|
|
229
|
+
except ValueError:
|
|
230
|
+
print(f"{RED}CPU selection must be a number.{RESET}")
|
|
231
|
+
return
|
|
232
|
+
command = command_for(data, xmrig)
|
|
233
|
+
print(f"{YELLOW}About to start XMRig on {data['pool']} with {data['threads']} thread(s).{RESET}")
|
|
234
|
+
print(f"{DIM}{' '.join(command[:6])} ...{RESET}")
|
|
235
|
+
if input("Start now? [y/N]: ").strip().lower() != "y":
|
|
236
|
+
print("Cancelled.")
|
|
237
|
+
return
|
|
238
|
+
try:
|
|
239
|
+
subprocess.run(command, check=False)
|
|
240
|
+
except KeyboardInterrupt:
|
|
241
|
+
print(f"\n{GREEN}Mining stopped.{RESET}")
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def benchmark():
|
|
245
|
+
xmrig = find_xmrig()
|
|
246
|
+
if not xmrig:
|
|
247
|
+
print(f"{RED}XMRig was not found.{RESET}")
|
|
248
|
+
return
|
|
249
|
+
print(f"{YELLOW}Benchmark only; this does not connect to the pool.{RESET}")
|
|
250
|
+
subprocess.run([xmrig, "--bench=1M"], check=False)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def repair():
|
|
254
|
+
folder, settings_file, _ = paths()
|
|
255
|
+
ensure_folder()
|
|
256
|
+
if not settings_file.exists():
|
|
257
|
+
save_settings(default_settings())
|
|
258
|
+
print(f"{YELLOW}Edit this file, then return here and press y:{RESET}\n{settings_file}")
|
|
259
|
+
input("Press Enter after editing the file...")
|
|
260
|
+
data = load_settings()
|
|
261
|
+
ok, message = validate(data)
|
|
262
|
+
print(f"{GREEN if ok else RED}{message}{RESET}")
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
def self_update():
|
|
266
|
+
"""Install the newest published version from PyPI (Termux/pip)."""
|
|
267
|
+
print(f"{CYAN}Check for a newer {PACKAGE} release on PyPI...{RESET}")
|
|
268
|
+
if input("Update now? [y/N]: ").strip().lower() != "y":
|
|
269
|
+
print("Cancelled.")
|
|
270
|
+
return
|
|
271
|
+
command = [sys.executable, "-m", "pip", "install", "--upgrade", PACKAGE]
|
|
272
|
+
print(f"{DIM}{' '.join(command)}{RESET}")
|
|
273
|
+
try:
|
|
274
|
+
result = subprocess.run(command, check=False)
|
|
275
|
+
if result.returncode == 0:
|
|
276
|
+
print(f"{GREEN}Done. Close and reopen {APP_NAME} to use the new version.{RESET}")
|
|
277
|
+
else:
|
|
278
|
+
print(f"{RED}Update failed. Try manually:{RESET} pip install --upgrade {PACKAGE}")
|
|
279
|
+
except OSError as exc:
|
|
280
|
+
print(f"{RED}Could not run pip: {exc}{RESET}")
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def main():
|
|
284
|
+
ensure_folder()
|
|
285
|
+
if not paths()[1].exists():
|
|
286
|
+
save_settings(default_settings())
|
|
287
|
+
loading()
|
|
288
|
+
while True:
|
|
289
|
+
banner()
|
|
290
|
+
print(f"{GREEN}1{RESET}. Configure wallet, pool and worker")
|
|
291
|
+
print(f"{GREEN}2{RESET}. Repair / reload settings file")
|
|
292
|
+
print(f"{GREEN}3{RESET}. Start XMRig mining")
|
|
293
|
+
print(f"{GREEN}4{RESET}. Phone benchmark")
|
|
294
|
+
print(f"{GREEN}5{RESET}. Show mining folder")
|
|
295
|
+
print(f"{GREEN}6{RESET}. Update {APP_NAME} from PyPI")
|
|
296
|
+
print(f"{GREEN}0{RESET}. Exit")
|
|
297
|
+
choice = input(f"\n{MAGENTA}Select: {RESET}").strip()
|
|
298
|
+
if choice == "1": configure()
|
|
299
|
+
elif choice == "2": repair()
|
|
300
|
+
elif choice == "3": start_mining()
|
|
301
|
+
elif choice == "4": benchmark()
|
|
302
|
+
elif choice == "5": print(paths()[0])
|
|
303
|
+
elif choice == "6": self_update()
|
|
304
|
+
elif choice == "0":
|
|
305
|
+
print(f"{GREEN}Thanks for using {APP_NAME}, {CREATOR}!{RESET}")
|
|
306
|
+
return
|
|
307
|
+
else: print(f"{RED}Invalid option.{RESET}")
|
|
308
|
+
input("\nPress Enter to continue...")
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
if __name__ == "__main__":
|
|
312
|
+
main()
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xmrming-tool
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: A transparent, user-controlled XMRig helper for Termux
|
|
5
|
+
Author: Nyan Lin Htet
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Project-URL: YouTube, https://www.youtube.com/@CryptoCashMyanmar
|
|
8
|
+
Project-URL: Telegram, https://t.me/CryptoCashMyanmar
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Operating System :: Android
|
|
12
|
+
Classifier: Topic :: System :: Monitoring
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# xmrming-tool
|
|
19
|
+
|
|
20
|
+
A transparent, user-controlled XMRig helper made for **Android / Termux users only**.
|
|
21
|
+
It is not intended for desktop or other platforms.
|
|
22
|
+
|
|
23
|
+
The installed command is:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
xmrming-tool
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This tool does not hide itself, create persistence, or start mining automatically. It only launches an XMRig executable after you explicitly choose **Start XMRig mining** and confirm with `y`.
|
|
30
|
+
|
|
31
|
+
This GitHub repository contains documentation only (this README and the LICENSE). The installable package is distributed through PyPI under the name `xmrming-tool`.
|
|
32
|
+
|
|
33
|
+
## Install in Termux
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pkg update
|
|
37
|
+
pkg install python
|
|
38
|
+
python -m pip install xmrming-tool
|
|
39
|
+
xmrming-tool
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If XMRig is not on your `PATH`, set its location before launching:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export XMRIG_PATH="$HOME/storage/downloads/xmr-mining/xmrig"
|
|
46
|
+
xmrming-tool
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
You can put that `export` line in `~/.bashrc` so it is set every time you open Termux.
|
|
50
|
+
|
|
51
|
+
## Update to a newer version
|
|
52
|
+
|
|
53
|
+
There is no `pip update` command. Use this instead:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m pip install --upgrade xmrming-tool
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or open the tool and choose **6. Update XMRMING TOOL from PyPI** — it runs the same upgrade for you and asks for confirmation first. After it finishes, close and reopen `xmrming-tool`.
|
|
60
|
+
|
|
61
|
+
To check which version you have:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m pip show xmrming-tool
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## How to use
|
|
68
|
+
|
|
69
|
+
After the first launch, the tool creates this settings file:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Download/xmr-mining/settings.txt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Put your **public XMR wallet address** on the `WALLET=` line. Never put a seed phrase or private key there.
|
|
76
|
+
|
|
77
|
+
The menu:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
1. Configure wallet, pool and worker
|
|
81
|
+
2. Repair / reload settings file
|
|
82
|
+
3. Start XMRig mining
|
|
83
|
+
4. Phone benchmark
|
|
84
|
+
5. Show mining folder
|
|
85
|
+
6. Update XMRMING TOOL from PyPI
|
|
86
|
+
0. Exit
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Before every mining session, the tool shows a numbered CPU menu (for example `1`, `2`, `3`, `4`), limited to the threads available on your phone. You then confirm with `y`.
|
|
90
|
+
|
|
91
|
+
Default pool: `gulf.moneroocean.stream:10128`
|
|
92
|
+
|
|
93
|
+
For XMRig, Monero RandomX is normally `rx/0`, not `randomx`. The command generated is conceptually:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
./xmrig -o gulf.moneroocean.stream:10128 -a rx/0 -u YOUR_XMR_WALLET_ADDRESS -p YOUR_WORKER_NAME --rig-id YOUR_WORKER_NAME --cpu-max-threads-hint 1 --tls
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Safety
|
|
100
|
+
|
|
101
|
+
Use only a public wallet address. Never enter a seed phrase or private key. Mining can heat a phone and reduce battery life. This tool does not install Android boot persistence, hide processes, or mine in the background.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
Custom license — see the `LICENSE` file in this repository. Personal, non-commercial use only. Unmodified copies may be shared for free; modified copies may not be distributed.
|
|
106
|
+
|
|
107
|
+
Channels: [YouTube](https://www.youtube.com/@CryptoCashMyanmar) · [Telegram](https://t.me/CryptoCashMyanmar)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/xmrming_tool/__init__.py
|
|
5
|
+
src/xmrming_tool/cli.py
|
|
6
|
+
src/xmrming_tool.egg-info/PKG-INFO
|
|
7
|
+
src/xmrming_tool.egg-info/SOURCES.txt
|
|
8
|
+
src/xmrming_tool.egg-info/dependency_links.txt
|
|
9
|
+
src/xmrming_tool.egg-info/entry_points.txt
|
|
10
|
+
src/xmrming_tool.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
xmrming_tool
|