\# SPDX-FileCopyrightText: 2025 Chris Duncan \# SPDX-License-Identifier: GPL-3.0-or-later .TH nano-pow 1 2025-03-12 "nano-pow v3.1.0" .SH NAME nano-pow \- proof-of-work generation and validation for Nano cryptocurrency .SH SYNOPSIS \fBnano-pow\fR [\fIOPTION\fR]... \fIBLOCKHASH\fR... .SH DESCRIPTION Generate work for \fIBLOCKHASH\fR, or multiple work values for \fIBLOCKHASH\fR(es). .PP If the \fI--server\fR option is provided as the first argument, all other options are ignored and the NanoPow server is started. .PP \fIBLOCKHASH\fR is a 64-character hexadecimal string. Multiple blockhashes must be separated by whitespace or line breaks. .PP Prints a 16-character hexadecimal work value, the BLAKE2b result, and the originating hash to standard output as a Javascript object. .PP If \fB--validate\fR is used, the original work value is returned instead along with validation flags. .SH OPTIONS .TP \fB--server\fR Start work server (see SERVER below). Must be the first argument in order to be recognized. .TP \fB\-b\fR, \fB\-\-batch\fR Format final output of all hashes as a JSON array instead of incrementally returning an object for each result as soon as it is calculated. .TP \fB\-t\fR, \fB\-\-difficulty\fR \fIDIFFICULTY\fR Override the minimum threshold value. Higher values increase difficulty. Must be a hexadecimal string between 1 and FFFFFFFFFFFFFFFF inclusive. .TP \fB\-e\fR, \fB\-\-effort\fR \fIEFFORT\fR Increase demand on GPU processing. Must be between 1 and 32 inclusive. .TP \fB\-v\fR, \fB\-\-validate\fR \fIWORK\fR Check an existing work value instead of searching for one. If you pass multiple blockhashes, the work value will be validated against each one. .TP \fB\-h\fR, \fB\-\-help\fR Show this help dialog and exit. .TP \fB\-\-debug\fR Enable additional logging output. .TP \fB\-\-benchmark\fR \fICOUNT\fR Generate work for the specified number of random hashes. .SH SERVER Calling \fBnano-pow\fR with the \fI--server\fR option will start the NanoPow work server in a detached process. .PP It provides work generation and validation via HTTP requests in a similar, but not identical, fashion as the official Nano node. .PP More specifically, it does not support the \fIuse_peers\fR, \fImultiplier\fR, \fIaccount\fR, \fIversion\fR, \fIblock\fR, and \fIjson_block\fR options. .PP By default, the server listens on port 5040. .SS ENVIRONMENT VARIABLES .TP \fBNANO_POW_PORT\fR Override the default port on which the NanoPow server listens for requests. .TP \fBNANO_POW_EFFORT\fR Increase demand on GPU processing. Must be between 1 and 32 inclusive. .TP \fBNANO_POW_DEBUG\fR Enable additional logging saved to the \fBHOME\fR directory. .PP The server process ID (PID) is saved to \fB~/.nano-pow/server.pid\fR. Log files are stored in \fB~/.nano-pow/logs/\fR. .TP To stop the server, terminate it using its PID. .EX $ cat ~/.nano-pow/server.pid 12345 $ kill 12345 .EE .TP Alternatively, use \fBpgrep\fR to find the PID by process name: .EX $ pgrep "NanoPow Server" 12345 $ kill $(pgrep "NanoPow Server") .EE .PP The server accepts HTTP \fBPOST\fR requests to the server's root path (\fB/\fR). Requests should be in JSON format and include an \fBaction\fR field to specify the desired operation. .PP The following actions are supported: .TP \fBwork_generate\fR Generate a work value for a given blockhash. Requires a \fBhash\fR field containing the 64-character hexadecimal blockhash. .TP \fBwork_validate\fR Validate an existing work value against a blockhash. Requires \fBwork\fR field containing the 16-character hexadecimal work value and a \fBhash\fR field containing the 64-character hexadecimal blockhash. .PP .SH EXAMPLES - CLI .PP Search for a work nonce for a blockhash using the default difficulty FFFFFFF800000000: .EX $ nano-pow \fB0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR .EE .PP Search for a work nonce using a custom difficulty and increased effort: .EX $ nano-pow \fB\-d fffffe0000000000 \-e 32 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR .EE .PP Read one or more lines of blockhashes from a file and output results to another file: .EX $ cat /path/to/file.txt | nano-pow \fB--batch\fR > work.json .EE .PP Validate an existing work nonce against a blockhash and show debugging output: .EX $ nano-pow \fB\--debug \-v fedcba9876543210 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\fR .EE .PP Run a benchmark of generating work for 100 random sample blockhashes: .EX $ nano-pow \fB\--benchmark 100\fR .EE .SH EXAMPLES - SERVER .PP Generate a work value: .EX $ curl -d '{ "action": "work_generate", "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" }' localhost:5040 .EE .PP Validate a work value: .EX $ curl -d '{ "action": "work_validate", "work": "e45835c3b291c3d1", "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" }' localhost:5040 .EE .SH AUTHOR Written by Chris Duncan. .SH BUGS Email . .SH COPYRIGHT .PP .EX Copyright \(co 2025 Chris Duncan Nano PoW documentation: License GPLv3+: GNU GPL version 3 or later Portions of this code are also provided under the MIT License: .EE