NanoPow uses WebGPU to generate proof-of-work nonces meeting the requirements
of the Nano cryptocurrency. WebGPU is cutting edge technology, so for browsers
-which do not yet support it, a WebGL 2.0 implementation is used as a fallback.
+which do not yet support it, WebGL 2.0 and WASM implementations are available
+as fallbacks.
All calculations take place client-side, so nonces can be generated offline and
cached for the next transaction block. For more information about the
import NanoPow from 'nano-pow'
```
-A specific API can be explicitly imported:
-
-```javascript
-import { NanoPowGpu, NanoPowGl } from 'nano-pow'
-```
-
Use it directly on a webpage with a script module:
```html
### Options
```javascript
const options = {
+ // default best available in order: webgpu => webgl => wasm => cpu
+ api: 'webgpu',
// default 0xFFFFFFF800000000 for send/change blocks
difficulty: 'FFFFFFC000000000',
- // default 8, valid range 1-32
- effort: 16,
+ // default 4, valid range 1-32
+ effort: 8,
// default false
debug: true
}
executing the server script directly.
#### Environment Variables
-`NANO_POW_PORT`: override the default port 5040
+`NANO_POW_DEBUG`: enable additional logging saved to the HOME directory
-`NANO_POW_EFFORT` increase or decrease demand on the GPU
+`NANO_POW_EFFORT`: increase or decrease demand on the GPU
-`NANO_POW_DEBUG` enable additional logging saved to the HOME directory
+`NANO_POW_PORT`: override the default port 5040
```console
$ # Launch the server and detach from the current session