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.
@@ -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) => {