detached process, and it can also be started manually to customize behavior by
executing the server script directly.
-`NANO_POW_PORT` can be passed as an environment variable and defaults to 3000 if
-not specified.
+#### Environment Variables
+`NANO_POW_PORT`: override the default port 5040
-`NANO_POW_EFFORT` can also be passed as an environment variable to increase
-or decrease the demand on the GPU.
+`NANO_POW_EFFORT` increase or decrease demand on the GPU
-`NANO_POW_DEBUG` can be set to enable additional logging saved to the HOME
-directory.
+`NANO_POW_DEBUG` enable additional logging saved to the HOME directory
```console
$ # Launch the server and detach from the current session
-$ PORT=8080 nano-pow --server
+$ NANO_POW_PORT=8080 nano-pow --server
$ # View process ID for "NanoPow Server"
$ cat ~/.nano-pow/server.pid
$ # Display list of server logs
$ curl -d '{
"action": "work_generate",
"hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
```
```console
$ # Validate a work value
"action": "work_validate",
"work": "e45835c3b291c3d1",
"hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
```
## Notes
.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 3000. To use a different port, set the \fBPORT\fR environment variable before starting the server.
+By default, the server listens on port 5040.
-.PP
-.EX
-$ PORT=8080 nano-pow --server
-.EE
+.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.
$ curl -d '{
"action": "work_generate",
"hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
.EE
.PP
"action": "work_validate",
"work": "e45835c3b291c3d1",
"hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
.EE
.SH AUTHOR
process.env.NANO_POW_DEBUG = ''
process.env.NANO_POW_EFFORT = ''
-process.env.NANO_POW_PORT = '3000'
+process.env.NANO_POW_PORT = '5040'
function log (...args: any[]): void {
if (process.env.NANO_POW_DEBUG) console.log(new Date(Date.now()).toLocaleString(), 'NanoPow', args)
const DEBUG: boolean = !!(process.env.NANO_POW_DEBUG || false)
const EFFORT: number = +(process.env.NANO_POW_EFFORT || 8)
-const PORT: number = +(process.env.NANO_POW_PORT || 3000)
+const PORT: number = +(process.env.NANO_POW_PORT || 5040)
let browser: Browser
let page: Page