clawminer-skill 1.1.1 → 1.2.0
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.
- package/SKILL.md +22 -11
- package/package.json +3 -2
- package/scripts/postinstall.js +40 -0
package/SKILL.md
CHANGED
|
@@ -10,25 +10,36 @@ description: 4小时生死战!MingXia ($MXIA) 专属自动 PoW 智能挖矿 Ag
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## ⚡
|
|
13
|
+
## ⚡ 安装与开始
|
|
14
14
|
|
|
15
15
|
1. 确保你安装了 [Node.js](https://nodejs.org/)。
|
|
16
|
-
2.
|
|
16
|
+
2. 全局安装挖矿工具:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
|
|
19
|
+
npm install -g clawminer-skill
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3. **验证 OpenClaw 注册**(仅 AI Agent 需要):安装脚本会自动将 SKILL.md 复制到 `~/.openclaw/workspace/skills/mingxia/`。如果自动注册失败(权限问题等),你需要手动完成:
|
|
23
|
+
- 创建目录:`mkdir -p ~/.openclaw/workspace/skills/mingxia/`
|
|
24
|
+
- 从 npm 全局安装目录复制 SKILL.md:`cp $(npm prefix -g)/lib/node_modules/clawminer-skill/SKILL.md ~/.openclaw/workspace/skills/mingxia/SKILL.md`
|
|
25
|
+
- 重启 OpenClaw Gateway 使 Skill 生效
|
|
26
|
+
|
|
27
|
+
4. 安装完成后,直接运行疯狂挖矿模式:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
clawminer-skill loop
|
|
20
31
|
```
|
|
21
32
|
|
|
22
33
|
### 命令列表
|
|
23
34
|
|
|
24
35
|
| 命令 | 作用 |
|
|
25
36
|
|------|------|
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
37
|
+
| `clawminer-skill loop` | **[首选]** 疯狂连续挖矿,抢占 2000 次名额! |
|
|
38
|
+
| `clawminer-skill mine` | 尝试只挖 1 次矿 |
|
|
39
|
+
| `clawminer-skill status` | 👉 查看全网挖矿进度、倒计时和你的战绩 |
|
|
40
|
+
| `clawminer-skill faucet` | 💧 [测试网专用] 领取免费的 TestCLAW 门票 |
|
|
30
41
|
| `node scripts/mine.js --force` | 🚧 测试强攻:在无 CLAW 的情况下硬刚智能合约看是否会被防御 |
|
|
31
|
-
| `
|
|
42
|
+
| `clawminer-skill init` | 初始化:配置私钥和环境变量(人类手动用) |
|
|
32
43
|
|
|
33
44
|
---
|
|
34
45
|
|
|
@@ -47,7 +58,7 @@ MingXia 从部署的那一刻起,生命周期只有 **4 个小时**(测试
|
|
|
47
58
|
|
|
48
59
|
### AI Agent 配置流程(推荐)
|
|
49
60
|
|
|
50
|
-
如果你是 AI Agent,请**不要运行 `
|
|
61
|
+
如果你是 AI Agent,请**不要运行 `clawminer-skill init`**(那是人类用的交互式工具),而是按以下步骤操作:
|
|
51
62
|
|
|
52
63
|
1. **向用户索要私钥**:在对话中直接问用户要他的【专用挖矿钱包】私钥。同时必须展示以下安全提醒:
|
|
53
64
|
|
|
@@ -65,14 +76,14 @@ CONTRACT_ADDRESS=0x3a74292B73CBB4dCfdf9cAA85CF88c41d7992410
|
|
|
65
76
|
NETWORK=testnet
|
|
66
77
|
```
|
|
67
78
|
|
|
68
|
-
3. **确认配置成功**:运行 `
|
|
79
|
+
3. **确认配置成功**:运行 `clawminer-skill status` 检查是否能正常连接。
|
|
69
80
|
|
|
70
81
|
### 人类手动配置(备选)
|
|
71
82
|
|
|
72
83
|
如果你是人类用户,可以直接运行交互式引导:
|
|
73
84
|
|
|
74
85
|
```bash
|
|
75
|
-
|
|
86
|
+
clawminer-skill init
|
|
76
87
|
```
|
|
77
88
|
|
|
78
89
|
> ⚠️ **安全警告:绝对不要使用存有大量资产的主钱包!!**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawminer-skill",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "MingXia ($MXIA) PoW Mining Skill — 4-Hour Death Match on BSC",
|
|
5
5
|
"main": "scripts/mine.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"mine": "node scripts/mine.js",
|
|
18
18
|
"status": "node scripts/mine.js --status",
|
|
19
19
|
"loop": "node scripts/mine.js --loop",
|
|
20
|
-
"faucet": "node scripts/mine.js --faucet"
|
|
20
|
+
"faucet": "node scripts/mine.js --faucet",
|
|
21
|
+
"postinstall": "node scripts/postinstall.js"
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
23
24
|
"clawminer",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* postinstall.js — 安装后自动将 SKILL.md 复制到 OpenClaw workspace
|
|
5
|
+
*
|
|
6
|
+
* 检测 ~/.openclaw/workspace/skills/ 是否存在,
|
|
7
|
+
* 如果存在,自动创建 mingxia 目录并复制 SKILL.md。
|
|
8
|
+
* 如果不存在(用户没有 OpenClaw),静默跳过。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
const SKILL_NAME = 'mingxia';
|
|
16
|
+
const SOURCE = path.join(__dirname, '..', 'SKILL.md');
|
|
17
|
+
|
|
18
|
+
// OpenClaw workspace skills 目录
|
|
19
|
+
const OPENCLAW_SKILLS = path.join(os.homedir(), '.openclaw', 'workspace', 'skills');
|
|
20
|
+
const DEST_DIR = path.join(OPENCLAW_SKILLS, SKILL_NAME);
|
|
21
|
+
const DEST_FILE = path.join(DEST_DIR, 'SKILL.md');
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
// 只在 OpenClaw 已安装时执行
|
|
25
|
+
if (!fs.existsSync(OPENCLAW_SKILLS)) {
|
|
26
|
+
// OpenClaw 不存在,静默退出
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 创建 skill 目录
|
|
31
|
+
fs.mkdirSync(DEST_DIR, { recursive: true });
|
|
32
|
+
|
|
33
|
+
// 复制 SKILL.md
|
|
34
|
+
fs.copyFileSync(SOURCE, DEST_FILE);
|
|
35
|
+
|
|
36
|
+
console.log(`🦞 MingXia Skill 已自动注册到 OpenClaw: ${DEST_DIR}`);
|
|
37
|
+
} catch (e) {
|
|
38
|
+
// 权限问题等,静默失败不影响安装
|
|
39
|
+
// 用户可以手动复制
|
|
40
|
+
}
|