nano-pow 4.0.3 → 4.0.5
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/dist/bin/cli.js +5 -3
- package/package.json +2 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
|
|
3
3
|
//! SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
|
+
import * as crypto from "node:crypto";
|
|
4
5
|
import * as fs from "node:fs/promises";
|
|
5
6
|
import * as readline from "node:readline/promises";
|
|
6
7
|
import * as puppeteer from "puppeteer";
|
|
@@ -93,8 +94,9 @@ if (hashes.length === 0) {
|
|
|
93
94
|
]
|
|
94
95
|
});
|
|
95
96
|
const page = await browser.newPage();
|
|
96
|
-
const
|
|
97
|
-
|
|
97
|
+
const path = new URL(import.meta.url).pathname;
|
|
98
|
+
const dir = path.slice(0, path.lastIndexOf("/"));
|
|
99
|
+
await fs.writeFile(`${dir}/cli.html`, "");
|
|
98
100
|
await page.goto(import.meta.resolve("./cli.html"));
|
|
99
101
|
await page.waitForFunction(async () => {
|
|
100
102
|
return await navigator.gpu.requestAdapter();
|
|
@@ -154,6 +156,6 @@ if (hashes.length === 0) {
|
|
|
154
156
|
</head>
|
|
155
157
|
</html>
|
|
156
158
|
`);
|
|
157
|
-
await fs.unlink(
|
|
159
|
+
await fs.unlink(`${dir}/cli.html`);
|
|
158
160
|
if (options["debug"]) console.log("Puppeteer initialized");
|
|
159
161
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nano-pow",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Proof-of-work generation and validation with WebGPU/WebGL for Nano cryptocurrency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nemo",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rm -rf {dist,types} && tsc && node esbuild.mjs && cp -p src/bin/nano-pow.sh dist/bin",
|
|
49
|
+
"prepare": "npm run build",
|
|
49
50
|
"start": "./dist/bin/nano-pow.sh --server",
|
|
50
51
|
"test": "./test/script.sh"
|
|
51
52
|
},
|