]> zoso.dev Git - nano-pow.git/commitdiff
Switch default port to 5040 (product of 'xno' as digits). Improve formatting of envir...
authorChris Duncan <chris@zoso.dev>
Fri, 28 Mar 2025 13:37:31 +0000 (06:37 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 28 Mar 2025 13:37:31 +0000 (06:37 -0700)
README.md
docs/nano-pow.1
src/bin/cli.ts
src/bin/server.ts

index 0c07fe560aa89b2cea4021bba4263b2faa965abb..f9448998dc1ea21f08882841e2a5c4185027a0e3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -136,18 +136,16 @@ official Nano node software. The installed command will launch the server in a
 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
@@ -163,7 +161,7 @@ $ # Generate a work value
 $ curl -d '{
        "action": "work_generate",
        "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
 ```
 ```console
 $ # Validate a work value
@@ -171,7 +169,7 @@ $ curl -d '{
        "action": "work_validate",
        "work": "e45835c3b291c3d1",
        "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
 ```
 
 ## Notes
index ec4b5861391ca3eaba037683c68c412c2467dbc9..a246a1dc90d07f9ca2e42c913ed31d4d2d104543 100644 (file)
@@ -50,12 +50,18 @@ It provides work generation and validation via HTTP requests in a similar, but n
 .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.
@@ -119,7 +125,7 @@ Generate a work value:
 $ curl -d '{
     "action": "work_generate",
     "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
 .EE
 
 .PP
@@ -129,7 +135,7 @@ $ curl -d '{
     "action": "work_validate",
     "work": "e45835c3b291c3d1",
     "hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
-}' localhost:3000
+}' localhost:5040
 .EE
 
 .SH AUTHOR
index d1eb8e486ff4334b622a879bb46ea44e1229b62c..cb1136ece1aa410581b345544feeecfec6b061ce 100755 (executable)
@@ -9,7 +9,7 @@ process.title = 'NanoPow CLI'
 
 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)
index 9bdaa7283c238837274aeee7c8c33f7ecefb6bbb..9124d7d3ddded56f2f6d2317938bbd1d52e6f7e4 100755 (executable)
@@ -17,7 +17,7 @@ const MAX_BODY_SIZE = 158
 
 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