apow-cli 0.11.18 → 0.12.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/.env.example +23 -5
- package/README.md +117 -67
- package/dist/brand-intro.js +160 -0
- package/dist/bridge/solana.js +27 -45
- package/dist/config.js +90 -5
- package/dist/dashboard-html.js +36 -43
- package/dist/dashboard.js +22 -151
- package/dist/errors.js +22 -3
- package/dist/grinder-http.js +3 -5
- package/dist/grinder-native.js +6 -5
- package/dist/index.js +540 -343
- package/dist/llm-setup.js +42 -0
- package/dist/lp-gate.js +28 -0
- package/dist/miner.js +24 -10
- package/dist/mint.js +6 -7
- package/dist/policy/audit-log.js +57 -0
- package/dist/policy/context.js +11 -0
- package/dist/policy/decode.js +84 -0
- package/dist/policy/paths.js +41 -0
- package/dist/policy/policy.js +224 -0
- package/dist/policy/spend-ledger.js +43 -0
- package/dist/preflight.js +138 -50
- package/dist/secure-env.js +65 -0
- package/dist/signer/guarded-account.js +78 -0
- package/dist/signer/local-keystore.js +40 -0
- package/dist/signer/session.js +11 -0
- package/dist/signer/types.js +2 -0
- package/dist/smhl.js +83 -10
- package/dist/stats.js +13 -1
- package/dist/sweep.js +181 -0
- package/dist/ui.js +140 -16
- package/dist/wallet-store.js +127 -31
- package/dist/wallet.js +18 -22
- package/dist/x402.js +4 -4
- package/package.json +8 -5
- package/skill.md +57 -833
package/dist/grinder-native.js
CHANGED
|
@@ -32,6 +32,7 @@ const node_fs_1 = require("node:fs");
|
|
|
32
32
|
const node_path_1 = require("node:path");
|
|
33
33
|
const node_os_1 = __importDefault(require("node:os"));
|
|
34
34
|
const config_1 = require("./config");
|
|
35
|
+
const secure_env_1 = require("./secure-env");
|
|
35
36
|
/**
|
|
36
37
|
* Detect available native grinder binaries.
|
|
37
38
|
* Checks: explicit env var > ./gpu/ > ./ > ~/.apow/
|
|
@@ -156,7 +157,7 @@ async function grindNonceNative(challengeNumber, target, minerAddress, info, sig
|
|
|
156
157
|
"-p", config_1.config.vastPort,
|
|
157
158
|
`root@${config_1.config.vastIp}`,
|
|
158
159
|
"pkill -9 grinder-cuda 2>/dev/null",
|
|
159
|
-
]);
|
|
160
|
+
], { env: (0, secure_env_1.childEnv)() });
|
|
160
161
|
setTimeout(() => { try {
|
|
161
162
|
kp.kill();
|
|
162
163
|
}
|
|
@@ -198,7 +199,7 @@ async function grindNonceNative(challengeNumber, target, minerAddress, info, sig
|
|
|
198
199
|
if (info.gpu) {
|
|
199
200
|
totalGrinders++;
|
|
200
201
|
// Set CWD to binary's directory so Metal grinder finds keccak.metal shader
|
|
201
|
-
const proc = (0, node_child_process_1.spawn)(info.gpu, [challengeNumber, minerAddress, targetHex], { cwd: (0, node_path_1.dirname)(info.gpu) });
|
|
202
|
+
const proc = (0, node_child_process_1.spawn)(info.gpu, [challengeNumber, minerAddress, targetHex], { cwd: (0, node_path_1.dirname)(info.gpu), env: (0, secure_env_1.childEnv)() });
|
|
202
203
|
processes.push(proc);
|
|
203
204
|
let stdout = "";
|
|
204
205
|
proc.stdout.on("data", (d) => { stdout += d.toString(); });
|
|
@@ -227,7 +228,7 @@ async function grindNonceNative(challengeNumber, target, minerAddress, info, sig
|
|
|
227
228
|
if (info.cuda) {
|
|
228
229
|
totalGrinders++;
|
|
229
230
|
// CUDA arg order: <challenge> <target> <address>
|
|
230
|
-
const proc = (0, node_child_process_1.spawn)(info.cuda, [challengeNumber, targetHex, minerAddress]);
|
|
231
|
+
const proc = (0, node_child_process_1.spawn)(info.cuda, [challengeNumber, targetHex, minerAddress], { env: (0, secure_env_1.childEnv)() });
|
|
231
232
|
processes.push(proc);
|
|
232
233
|
let buf = "";
|
|
233
234
|
proc.stdout.on("data", (d) => {
|
|
@@ -265,7 +266,7 @@ async function grindNonceNative(challengeNumber, target, minerAddress, info, sig
|
|
|
265
266
|
const proc = (0, node_child_process_1.spawn)(info.cpu, [
|
|
266
267
|
challengeNumber, minerAddress, targetHex,
|
|
267
268
|
String(config_1.config.cpuGrinderThreads),
|
|
268
|
-
]);
|
|
269
|
+
], { env: (0, secure_env_1.childEnv)() });
|
|
269
270
|
processes.push(proc);
|
|
270
271
|
let stdout = "";
|
|
271
272
|
proc.stdout.on("data", (d) => { stdout += d.toString(); });
|
|
@@ -301,7 +302,7 @@ async function grindNonceNative(challengeNumber, target, minerAddress, info, sig
|
|
|
301
302
|
"-p", config_1.config.vastPort,
|
|
302
303
|
`root@${config_1.config.vastIp}`,
|
|
303
304
|
`${config_1.config.remoteGrinderPath} ${challengeNumber} ${targetHex} ${minerAddress}`,
|
|
304
|
-
]);
|
|
305
|
+
], { env: (0, secure_env_1.childEnv)() });
|
|
305
306
|
processes.push(proc);
|
|
306
307
|
let buf = "";
|
|
307
308
|
proc.stdout.on("data", (d) => {
|