nano-pow 3.1.0 → 3.1.1

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/cli.js CHANGED
@@ -9,7 +9,10 @@ const args = process.argv.slice(2)
9
9
  if (args.length === 0 || args.some(v => v === '--help' || v === '-h')) {
10
10
  console.log(`Usage: nano-pow [OPTION]... BLOCKHASH...
11
11
  Generate work for BLOCKHASH, or multiple work values for BLOCKHASH(es)
12
+ BLOCKHASH is a 64-character hexadecimal string.
12
13
  Multiple blockhash values must be separated by spaces.
14
+ Prints a 16-character hexadecimal work value to standard output.
15
+ If using --validate, prints 'true' or 'false' to standard output instead.
13
16
  All command options are optional.
14
17
 
15
18
  -h, --help show this dialog
@@ -18,7 +21,6 @@ All command options are optional.
18
21
  -t, --threshold <value> override the minimum threshold value
19
22
  -v, --validate <value> check an existing work value instead of searching for one
20
23
 
21
- Blockhash(es) must be 64-character hexadecimal values.
22
24
  If validating a nonce, it must be a 16-character hexadecimal value.
23
25
  Effort must be a decimal number between 1 - 32.
24
26
  Threshold must be a hexadecimal number between 0x0 - 0xFFFFFFFF.
@@ -103,10 +105,8 @@ if (options['debug']) console.log(`${fn} options`, JSON.stringify(options))
103
105
  const output = msg.text().split(' ')
104
106
  if (output[0] === 'cli') {
105
107
  if (output[1] === 'exit') {
106
- if (options['debug']) {
107
- const end = performance.now()
108
- console.log(end - start, 'ms total |', (end - start) / hashes.length, 'ms avg')
109
- }
108
+ const end = performance.now()
109
+ if (options['debug']) console.log(end - start, 'ms total |', (end - start) / hashes.length, 'ms avg')
110
110
  process.exit()
111
111
  } else {
112
112
  console.log(output[1])
package/dist/nano-pow.1 CHANGED
@@ -1,12 +1,26 @@
1
+ \# SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
2
+ \# SPDX-License-Identifier: GPL-3.0-or-later
3
+
1
4
  .TH nano-pow 1 2025-03-12 "nano-pow v3.1.0"
5
+
2
6
  .SH NAME
3
7
  nano-pow \- proof-of-work generation and validation for Nano cryptocurrency
8
+
4
9
  .SH SYNOPSIS
5
10
  \fBnano-pow\fR [\fIOPTION\fR]... \fIBLOCKHASH\fR...
11
+
6
12
  .SH DESCRIPTION
7
- Generate work for BLOCKHASH, or multiple work values for BLOCKHASH(es).
13
+ Generate work for \fIBLOCKHASH\fR, or multiple work values for \fIBLOCKHASH\fR(es).
14
+ Nano PoW documentation: <https://docs.nano.org/integration-guides/work-generation/\#work-calculation-details>
15
+ .PP
16
+ \fIBLOCKHASH\fR is a 64-character hexadecimal string.
8
17
  .PP
9
18
  Multiple blockhash values must be separated by spaces.
19
+ .PP
20
+ Prints a 16-character hexadecimal work value to standard output.
21
+ .PP
22
+ If \fB--validate\fR is used, prints 'true' or 'false' to standard output.
23
+
10
24
  .SH OPTIONS
11
25
  .TP
12
26
  \fB\-h\fR, \fB\-\-help\fR
@@ -19,26 +33,39 @@ Enable additional logging output.
19
33
  Increase demand on GPU processing. Must be between 1 and 32 inclusive.
20
34
  .TP
21
35
  \fB\-t\fR, \fB\-\-threshold\fR \fITHRESHOLD\fR
22
- Override the minimum threshold value. Must be in hexadecimal format between 0x0 and 0xFFFFFFFF.
36
+ Override the minimum threshold value. Higher values increase difficulty. Must be in hexadecimal format between 0x0 and 0xFFFFFFFF.
23
37
  .TP
24
38
  \fB\-v\fR, \fB\-\-validate\fR \fIWORK\fR
25
39
  Check an existing work value instead of searching for one.
40
+
26
41
  .SH EXAMPLES
27
42
  Search for a work nonce for a blockhash using the default threshold 0xFFFFFFF8:
28
- \fBnano-pow 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR
29
- .PP
43
+ .EX
44
+ nano-pow 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
45
+ .EE
46
+
30
47
  Search for a work nonce using a custom threshold and increased effort:
31
- \fBnano-pow \-t fffffe00 \-e 32 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR
32
- .PP
48
+ .EX
49
+ nano-pow \-t fffffe00 \-e 32 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
50
+ .EE
51
+
33
52
  Search for multiple nonces from a file:
34
- \fBnano-pow $(cat /path/to/file.txt)\fR
35
- .PP
53
+ .EX
54
+ nano-pow $(cat /path/to/file.txt)
55
+ .EE
56
+
36
57
  Validate an existing work nonce against a blockhash and show debugging output:
37
- \fBnano-pow \-d \-v fedcba9876543210 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR
58
+ .EX
59
+ nano-pow \-d \-v fedcba9876543210 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
60
+ .EE
61
+
38
62
  .SH AUTHOR
39
63
  Written by Chris Duncan.
64
+
40
65
  .SH BUGS
41
66
  Email: <mailto:bug-nano-pow@zoso.dev>
67
+
42
68
  .SH COPYRIGHT
43
69
  Copyright \(co 2025 Chris Duncan <chris@zoso.dev>
70
+ .PP
44
71
  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-pow",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Proof-of-work generation and validation with WebGPU/WebGL for Nano cryptocurrency.",
5
5
  "keywords": [
6
6
  "nemo",