nano-pow 3.1.0 → 3.1.2

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