Chris Duncan [Tue, 22 Apr 2025 13:22:18 +0000 (06:22 -0700)]
Return if server requests have already been intercepted by puppeteer. Properly call continue if intercepted request is not of interest. Delay listening until NanoPow exists.
Chris Duncan [Mon, 14 Apr 2025 16:32:52 +0000 (09:32 -0700)]
Save server logs by day instead of by execution. Display server process ID on every log entry instead of just once when starting server. Adjust log timestamp formatting.
Chris Duncan [Mon, 14 Apr 2025 15:27:45 +0000 (08:27 -0700)]
Use SIGHUP to reload config except PORT which requires relaunching the server. Refactor CLI to spawn server as child process and get port from OS dynamically using IPC. Fix fast exit by handling SIGINT and SIGTERM ourselves.
Chris Duncan [Sun, 13 Apr 2025 04:59:01 +0000 (21:59 -0700)]
Print server error if it does not launch, typically due to puppeteer issue. Reset on error reading from GPU instead of trying an infinite dispatch loop. Reduce interval for checking that GPU is not busy to half a second. Reset initialization flag when resetting NanoPowGpu. Fix abort call on timeout in cli. Extend CLI abort timeout to a full minute to accomodate low-power devices. Fix whitespace for inline help.
Chris Duncan [Sat, 12 Apr 2025 05:13:42 +0000 (22:13 -0700)]
Simplify GPU compute by reverting to vec2 and implementing G function since performance difference is almost nonexistent and the real benefit comes from native u64 types which do not yet exist in WGSL. Increase workgroup size to best value 96 found during testing on RTX 3070. Create --benchmark CLI argument. Store seed and blockhash in fast shared workgroup memory. Add benchmark convenience npm script. Fix documentation in inline help and manual page. Fix CLI default port collision with server default port. Change timestamp on server log files. Test concurrent curl requests to server. Fix action listed in server response error message. Update puppeteer and test page HTML with blank favicon to prevent unnecessary load.
Chris Duncan [Thu, 27 Mar 2025 21:03:44 +0000 (14:03 -0700)]
Overhaul server to consolidate work methods into one function. Overhaul CLI to spin up server and request work instead of using its own puppeteer instance since testing found the server overhead to be negligible in comparison to puppeteer. Remove size getter from GL. Fix types and related imports. Add more environment variables to control server behavior. Add tests to server test script. Update package configuration files.
Chris Duncan [Wed, 26 Mar 2025 15:04:11 +0000 (08:04 -0700)]
Ignore all arguments when starting server and use envvars instead. Read NANO_POW_EFFORT from environment when starting server. Update test script to use port 3001 to test custom value. Pass NanoPowOptions object into puppeteer evaluate calls. Update README to use destructuring assignment for output clarity and to use new method names. Add more command line guidance to README. Fix default effort used by server to match the actual implementation and fix README accordingly. Add --server documentation to manual. Fix threshold/difficulty ranges throughout documentation and remove mention of u32 threshold workaround from README. Whitespace.
Chris Duncan [Fri, 21 Mar 2025 16:40:23 +0000 (09:40 -0700)]
Implement server.
Add executable start a Node server, accept POST requests in same JSON format as Nano node specs, and process similarly to CLI using puppeteer. Remove migration compatibility layer introduced in v3.2.0. Extract help text to separate documentation file. Write basic test script to check server. Refactor threshold to expect 64-bit values only. Fix Typescript types.
Chris Duncan [Thu, 20 Mar 2025 21:56:55 +0000 (14:56 -0700)]
Set up for v4
Add two new methods which align with Nano node RPC actions. Return more data from hash result. Indicate a more specific `threshold` by passing a full 16-character string to the new `work_` methods. Changed `NanoPowGl.size` property to return total pixel count. Add typings for request and response objects consumed by new `work_` methods. Add more tests for receive threshold edge cases. Improve build process. Expand documentation.
Chris Duncan [Sun, 16 Mar 2025 06:22:33 +0000 (23:22 -0700)]
Reorganize source directory structure.
Put documentation and test files into top-level folders. Divide PoW modules by API instead of by file type. Update file paths accordingly. Replace a duplicate sample blockhash.
Chris Duncan [Sat, 15 Mar 2025 19:22:11 +0000 (12:22 -0700)]
Updated cli to accept input from stdin like redirects and pipes. Add JSON output option to cli. Updated documentation for new cli features. Refactor gl draw shader to align with gpu compute shader on blake2b initialization. Update README license section. Rename file of test blockhashes since they are not work seeds.
Chris Duncan [Thu, 13 Mar 2025 16:31:26 +0000 (09:31 -0700)]
At just 2.8 KiB, the Terms page is the most lightweight chrome:// URL, so use it for CLI instead of chrome://newtab which is over 25 times larger at 74.0 KiB.