@paimaexample/npm-midnight-proof-server 0.3.20 → 0.3.22

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.
package/binary.js CHANGED
@@ -19,10 +19,9 @@ function getPlatform() {
19
19
  // For macOS return macos-<arch> to allow unsupported detection
20
20
  if (platform === "darwin") {
21
21
  return `macos-${arch}`;
22
+ } else {
23
+ return `${platform}-${arch}`;
22
24
  }
23
-
24
- // Assume Linux or other UNIX variants default to arch only (amd64/arm64)
25
- return arch;
26
25
  }
27
26
 
28
27
  function getBinaryUrl() {
@@ -58,6 +57,14 @@ async function unzipBinary() {
58
57
  const destDir = path.join(__dirname, "proof-server");
59
58
 
60
59
  await extract(zipPath, { dir: destDir });
60
+ const platform = getPlatform();
61
+ const parts = platform.split("-");
62
+ if (parts[0] === "linux") {
63
+ fs.chmodSync(
64
+ path.join(destDir, `midnight-proof-server-${platform}`),
65
+ 0o755,
66
+ );
67
+ }
61
68
  fs.unlinkSync(zipPath);
62
69
  }
63
70
 
package/index.js CHANGED
@@ -10,7 +10,9 @@ const { checkIfDockerExists, pullDockerImage, runDockerContainer } = require(
10
10
  );
11
11
 
12
12
  function checkIfBinaryExists() {
13
- return fs.existsSync(path.join(__dirname, "proof-server", "proof-server"));
13
+ const platform = getPlatform();
14
+ const binaryName = `midnight-proof-server-${platform}`;
15
+ return fs.existsSync(path.join(__dirname, "proof-server", binaryName));
14
16
  }
15
17
 
16
18
  function isBinarySupported() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paimaexample/npm-midnight-proof-server",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
4
4
  "description": "A wrapper for the Midnight proof server binary",
5
5
  "main": "index.js",
6
6
  "bin": {
File without changes