nano-pow 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ NANO_POW_LOGS="$NANO_POW_HOME"/logs;
10
10
  mkdir -p "$NANO_POW_LOGS";
11
11
  if [ "$1" = '--server' ]; then
12
12
  shift;
13
- node "$SCRIPT_DIR"/server.js > "$NANO_POW_LOGS"/nano-pow-server-$(date -u -Iseconds).log 2>&1 & echo "$!" > "$NANO_POW_HOME"/server.pid;
13
+ node "$SCRIPT_DIR"/server.js >> "$NANO_POW_LOGS"/nano-pow-server-$(date -I).log 2>&1 & echo "$!" > "$NANO_POW_HOME"/server.pid;
14
14
  sleep 0.1;
15
15
  if [ "$(ps | grep $(cat $NANO_POW_HOME/server.pid))" = '' ]; then
16
16
  cat $(ls -td "$NANO_POW_LOGS"/* | head -n1);
@@ -8,7 +8,15 @@ import * as http from "node:http";
8
8
  import { homedir } from "node:os";
9
9
  import { join } from "node:path";
10
10
  function log(...args) {
11
- if (CONFIG.DEBUG) console.log(new Date(Date.now()).toLocaleString(), "NanoPow", args);
11
+ if (CONFIG.DEBUG) {
12
+ const d = new Date(Date.now());
13
+ const opts = {
14
+ hour12: false,
15
+ dateStyle: "medium",
16
+ timeStyle: "medium"
17
+ };
18
+ console.log(d.toLocaleString(navigator.language, opts), `NanoPow[${process.pid}]:`, args);
19
+ }
12
20
  }
13
21
  process.title = "NanoPow Server";
14
22
  const MAX_REQUEST_SIZE = 1024;
@@ -196,6 +204,7 @@ await unlink(filename);
196
204
  log("Puppeteer initialized");
197
205
  server.listen(CONFIG.PORT, async () => {
198
206
  const { port } = server.address();
199
- log(`Server process ${process.pid} listening on port ${port}`);
207
+ CONFIG.PORT = port;
208
+ log(`Server listening on port ${port}`);
200
209
  process.send?.({ type: "listening", port });
201
210
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-pow",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Proof-of-work generation and validation with WebGPU/WebGL for Nano cryptocurrency.",
5
5
  "keywords": [
6
6
  "nemo",