@paimaexample/npm-midnight-proof-server 0.3.43 → 0.3.45

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.
Files changed (2) hide show
  1. package/binary.js +7 -2
  2. package/package.json +1 -1
package/binary.js CHANGED
@@ -4,7 +4,10 @@ const axios = require("axios");
4
4
  const extract = require("extract-zip");
5
5
  const path = require("path");
6
6
 
7
+ const CURRENT_BINARY_VERSION = "ledger-4.0.0";
8
+
7
9
  /**
10
+ * @returns {string} The platform and architecture of the current machine. Example: "linux-amd64"
8
11
  * Returns platform string matching the naming convention used for hosted binaries.
9
12
  * Example outputs: linux-amd64, macos-arm64
10
13
  */
@@ -33,7 +36,7 @@ function getBinaryUrl() {
33
36
  }
34
37
 
35
38
  // TODO: Replace placeholder link with real URL once available
36
- return `https://paima-midnight.nyc3.cdn.digitaloceanspaces.com/binaries/midnight-proof-server-${platform}.zip`;
39
+ return `https://paima-midnight.nyc3.cdn.digitaloceanspaces.com/binaries/midnight-proof-server-${platform}-${CURRENT_BINARY_VERSION}.zip`;
37
40
  }
38
41
 
39
42
  async function downloadAndSaveBinary() {
@@ -55,7 +58,9 @@ async function downloadAndSaveBinary() {
55
58
  async function unzipBinary() {
56
59
  const zipPath = path.join(__dirname, "proof-server.zip");
57
60
  const destDir = path.join(__dirname, "proof-server");
58
-
61
+ if (!fs.existsSync(destDir)) {
62
+ fs.mkdirSync(destDir, { recursive: true });
63
+ }
59
64
  await extract(zipPath, { dir: destDir });
60
65
  const platform = getPlatform();
61
66
  const parts = platform.split("-");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paimaexample/npm-midnight-proof-server",
3
- "version": "0.3.43",
3
+ "version": "0.3.45",
4
4
  "description": "A wrapper for the Midnight proof server binary",
5
5
  "main": "index.js",
6
6
  "bin": {