## Example systemd service unit file to start the nano-pow server at login.
## Run `systemctl --user edit --force --full nano-pow.service`
-## Copy contents below into editor, modifying ExecStart as needed, and save.
+## Copy contents below into editor, modify WorkingDirectory as needed, and save.
## Run `systemctl --user enable nano-pow --now` to start it now and at boot.
[Unit]
[Service]
# Must point at install path, often in `npm_config_prefix` directory:
-ExecStart=%h/.local/bin/nano-pow --server
+WorkingDirectory=%h/.local/lib/node_modules/nano-pow
-Type=forking
-WorkingDirectory=%h
+Type=simple
+ExecStart=/usr/bin/npm start
EnvironmentFile=-%h/.nano-pow/config
PassEnvironment=NANO_POW_DEBUG NANO_POW_EFFORT NANO_POW_PORT
-PIDFile=%h/.nano-pow/server.pid
-StandardOutput=journal+console
-StandardError=journal+console
[Install]
WantedBy=default.target
"gpugenerate": "cd src/lib/generate/webgpu/shaders && rm -rf build && tsc && node build/generate.js > build/compute.wgsl && cp tsconfig.json* build",
"prepare": "npm run build",
"score": "npm run build && ./dist/bin/nano-pow.sh --effort 4 --benchmark 100 --score 100",
- "start": "./dist/bin/nano-pow.sh --server",
+ "start": "node --max-http-header-size=1024 --max-old-space-size=256 ./dist/bin/server.js",
"test": "npm run build && ./test/script.sh"
},
"devDependencies": {
mkdir -p "$NANO_POW_LOGS";
if [ "$1" = '--server' ]; then
shift;
- node --max-http-header-size=1024 --max-old-space-size=256 "$SCRIPT_DIR"/server.js >> "$NANO_POW_LOGS"/nano-pow-server-$(date -I).log 2>&1 &
+ npm start >> "$NANO_POW_LOGS"/nano-pow-server-$(date -I).log 2>&1 &
sleep 1;
if [ "$(ps | grep $(cat $NANO_POW_HOME/server.pid))" = '' ]; then
cat $(ls -td "$NANO_POW_LOGS"/* | head -n1);