@lightprotocol/zk-compression-cli 0.4.6 → 0.5.0

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.
Binary file
package/bin/forester CHANGED
Binary file
package/bin/forester.toml CHANGED
@@ -9,7 +9,9 @@ WS_RPC_URL="ws://localhost:8900"
9
9
  INDEXER_URL="http://localhost:8784"
10
10
  PROVER_URL="http://localhost:3001"
11
11
 
12
- CONCURRENCY_LIMIT=10
13
- BATCH_SIZE=10
12
+ CU_LIMIT = 1_000_000
13
+ RPC_POOL_SIZE = 20
14
+ CONCURRENCY_LIMIT=100
15
+ BATCH_SIZE=100
14
16
  MAX_RETRIES=5
15
- MAX_CONCURRENT_BATCHES=1
17
+ MAX_CONCURRENT_BATCHES=1
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.run = void 0;
4
3
  const tslib_1 = require("tslib");
5
4
  var core_1 = require("@oclif/core");
6
5
  Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadBinIfNotExists = exports.downloadFile = void 0;
3
+ exports.downloadFile = downloadFile;
4
+ exports.downloadBinIfNotExists = downloadBinIfNotExists;
4
5
  const tslib_1 = require("tslib");
5
6
  const axios_1 = tslib_1.__importDefault(require("axios"));
6
7
  const fs = tslib_1.__importStar(require("fs"));
@@ -169,7 +170,6 @@ async function downloadFile({ localFilePath, dirPath, url, }) {
169
170
  }
170
171
  }
171
172
  }
172
- exports.downloadFile = downloadFile;
173
173
  /**
174
174
  * Download a binary from the given release artifact of the GitHub repository,
175
175
  * if it was not already downloaded.
@@ -200,4 +200,3 @@ async function downloadBinIfNotExists({ localFilePath, dirPath, owner, repoName,
200
200
  // Wait for a second to make sure the file is written
201
201
  await (0, stateless_js_1.sleep)(1000);
202
202
  }
203
- exports.downloadBinIfNotExists = downloadBinIfNotExists;
@@ -14,6 +14,6 @@ export declare const SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
14
14
  export declare const LIGHT_PROVER_PROCESS_NAME = "light-prover";
15
15
  export declare const INDEXER_PROCESS_NAME = "photon";
16
16
  export declare const FORESTER_PROCESS_NAME = "forester";
17
- export declare const PHOTON_VERSION = "0.30.0";
17
+ export declare const PHOTON_VERSION = "0.36.0";
18
18
  export declare const LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
19
19
  export declare const BASE_PATH = "../../bin/";
@@ -19,6 +19,6 @@ exports.SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
19
19
  exports.LIGHT_PROVER_PROCESS_NAME = "light-prover";
20
20
  exports.INDEXER_PROCESS_NAME = "photon";
21
21
  exports.FORESTER_PROCESS_NAME = "forester";
22
- exports.PHOTON_VERSION = "0.30.0";
22
+ exports.PHOTON_VERSION = "0.36.0";
23
23
  exports.LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
24
24
  exports.BASE_PATH = "../../bin/";
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.killTestValidator = exports.startTestValidator = exports.getSolanaArgs = exports.initTestEnvIfNeeded = exports.initTestEnv = void 0;
3
+ exports.initTestEnv = initTestEnv;
4
+ exports.initTestEnvIfNeeded = initTestEnvIfNeeded;
5
+ exports.getSolanaArgs = getSolanaArgs;
6
+ exports.startTestValidator = startTestValidator;
7
+ exports.killTestValidator = killTestValidator;
4
8
  const tslib_1 = require("tslib");
5
9
  const stateless_js_1 = require("@lightprotocol/stateless.js");
6
10
  const utils_1 = require("./utils");
@@ -49,7 +53,6 @@ async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = t
49
53
  await (0, processForester_1.startForester)();
50
54
  }
51
55
  }
52
- exports.initTestEnv = initTestEnv;
53
56
  async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer = false, prover = false, forester = false, } = {}) {
54
57
  try {
55
58
  const anchorProvider = await (0, utils_1.setAnchorProvider)();
@@ -68,7 +71,6 @@ async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, ind
68
71
  });
69
72
  }
70
73
  }
71
- exports.initTestEnvIfNeeded = initTestEnvIfNeeded;
72
74
  /*
73
75
  * Determines a path to which Light Protocol programs should be downloaded.
74
76
  *
@@ -167,7 +169,6 @@ async function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedg
167
169
  }
168
170
  return solanaArgs;
169
171
  }
170
- exports.getSolanaArgs = getSolanaArgs;
171
172
  async function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, }) {
172
173
  const command = "solana-test-validator";
173
174
  const solanaArgs = await getSolanaArgs({
@@ -185,8 +186,6 @@ async function startTestValidator({ additionalPrograms, skipSystemAccounts, limi
185
186
  args: [...solanaArgs],
186
187
  });
187
188
  }
188
- exports.startTestValidator = startTestValidator;
189
189
  async function killTestValidator() {
190
190
  await (0, process_1.killProcess)("solana-test-validator");
191
191
  }
192
- exports.killTestValidator = killTestValidator;
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.confirmServerStability = exports.waitForServers = exports.spawnBinary = exports.execute = exports.executeCommand = exports.killProcessByPort = exports.killProcess = void 0;
3
+ exports.killProcess = killProcess;
4
+ exports.killProcessByPort = killProcessByPort;
5
+ exports.executeCommand = executeCommand;
6
+ exports.execute = execute;
7
+ exports.spawnBinary = spawnBinary;
8
+ exports.waitForServers = waitForServers;
9
+ exports.confirmServerStability = confirmServerStability;
4
10
  const tslib_1 = require("tslib");
5
11
  const child_process_1 = require("child_process");
6
12
  const path_1 = tslib_1.__importDefault(require("path"));
@@ -17,11 +23,9 @@ async function killProcess(processName) {
17
23
  process.kill(proc.pid);
18
24
  });
19
25
  }
20
- exports.killProcess = killProcess;
21
26
  async function killProcessByPort(port) {
22
27
  await execute(`lsof -t -i:${port} | while read line; do kill -9 $line; done`);
23
28
  }
24
- exports.killProcessByPort = killProcessByPort;
25
29
  /**
26
30
  * Executes a command and logs the output to the console.
27
31
  * @param command - Path to the command to be executed.
@@ -85,7 +89,6 @@ async function executeCommand({ command, args, additionalPath, logFile = true, }
85
89
  });
86
90
  });
87
91
  }
88
- exports.executeCommand = executeCommand;
89
92
  const exec = (0, util_1.promisify)(node_child_process_1.exec);
90
93
  /**
91
94
  * Executes a shell command and returns a promise that resolves to the output of the shell command, or an error.
@@ -105,7 +108,6 @@ async function execute(command) {
105
108
  throw err;
106
109
  }
107
110
  }
108
- exports.execute = execute;
109
111
  function spawnBinary(command, args = []) {
110
112
  const logDir = "test-ledger";
111
113
  const binaryName = path_1.default.basename(command);
@@ -124,7 +126,6 @@ function spawnBinary(command, args = []) {
124
126
  console.log(`${binaryName} process exited with code ${code}`);
125
127
  });
126
128
  }
127
- exports.spawnBinary = spawnBinary;
128
129
  async function waitForServers(servers) {
129
130
  const opts = {
130
131
  resources: servers.map(({ port, path }) => `http-get://127.0.0.1:${port}${path}`),
@@ -147,7 +148,6 @@ async function waitForServers(servers) {
147
148
  throw err;
148
149
  }
149
150
  }
150
- exports.waitForServers = waitForServers;
151
151
  // Solana test validator can be unreliable when starting up.
152
152
  async function confirmServerStability(url, attempts = 20) {
153
153
  try {
@@ -165,4 +165,3 @@ async function confirmServerStability(url, attempts = 20) {
165
165
  throw error;
166
166
  }
167
167
  }
168
- exports.confirmServerStability = confirmServerStability;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getForesterBinaryName = exports.startForester = exports.killForester = void 0;
3
+ exports.killForester = killForester;
4
+ exports.startForester = startForester;
5
+ exports.getForesterBinaryName = getForesterBinaryName;
4
6
  const tslib_1 = require("tslib");
5
7
  const path_1 = tslib_1.__importDefault(require("path"));
6
8
  const process_1 = require("./process");
@@ -8,7 +10,6 @@ const constants_1 = require("./constants");
8
10
  async function killForester() {
9
11
  await (0, process_1.killProcess)(constants_1.FORESTER_PROCESS_NAME);
10
12
  }
11
- exports.killForester = killForester;
12
13
  async function startForester() {
13
14
  console.log("Killing existing forester process...");
14
15
  await killForester();
@@ -16,10 +17,8 @@ async function startForester() {
16
17
  (0, process_1.spawnBinary)(getForesterBinaryName(), ["subscribe"]);
17
18
  console.log("Forester started successfully!");
18
19
  }
19
- exports.startForester = startForester;
20
20
  function getForesterBinaryName() {
21
21
  const binDir = path_1.default.join(__dirname, "../..", "bin");
22
22
  const binaryName = path_1.default.join(binDir, "forester");
23
23
  return binaryName;
24
24
  }
25
- exports.getForesterBinaryName = getForesterBinaryName;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startIndexer = void 0;
3
+ exports.startIndexer = startIndexer;
4
4
  const tslib_1 = require("tslib");
5
5
  const which_1 = tslib_1.__importDefault(require("which"));
6
6
  const process_1 = require("./process");
@@ -34,7 +34,6 @@ async function startIndexer(rpcUrl, indexerPort, checkPhotonVersion = true, phot
34
34
  console.log("Indexer started successfully!");
35
35
  }
36
36
  }
37
- exports.startIndexer = startIndexer;
38
37
  async function killIndexer() {
39
38
  await (0, process_1.killProcess)(constants_1.INDEXER_PROCESS_NAME);
40
39
  }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProverNameByArch = exports.startProver = exports.killProver = void 0;
3
+ exports.killProver = killProver;
4
+ exports.startProver = startProver;
5
+ exports.getProverNameByArch = getProverNameByArch;
4
6
  const tslib_1 = require("tslib");
5
7
  const path_1 = tslib_1.__importDefault(require("path"));
6
8
  const process_1 = require("./process");
@@ -11,7 +13,6 @@ async function killProver() {
11
13
  // Temporary fix for the case when prover is instantiated via prover.sh:
12
14
  await (0, process_1.killProcess)(constants_1.LIGHT_PROVER_PROCESS_NAME);
13
15
  }
14
- exports.killProver = killProver;
15
16
  async function startProver(proverPort, proveCompressedAccounts, proveNewAddresses) {
16
17
  if (!proveCompressedAccounts && !proveNewAddresses) {
17
18
  console.log("No flags provided. Please provide at least one flag to start the prover.");
@@ -31,7 +32,6 @@ async function startProver(proverPort, proveCompressedAccounts, proveNewAddresse
31
32
  await (0, process_1.waitForServers)([{ port: proverPort, path: "/" }]);
32
33
  console.log("Prover started successfully!");
33
34
  }
34
- exports.startProver = startProver;
35
35
  function getProverNameByArch() {
36
36
  const platform = process.platform;
37
37
  const arch = process.arch;
@@ -47,4 +47,3 @@ function getProverNameByArch() {
47
47
  binaryName = path_1.default.join(binDir, binaryName);
48
48
  return binaryName;
49
49
  }
50
- exports.getProverNameByArch = getProverNameByArch;
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isValidBase58SecretKey = exports.isValidURL = exports.CustomLoader = exports.setConfig = exports.ensureDirectoryExists = exports.getConfig = exports.getProverUrl = exports.getIndexerUrl = exports.getSolanaRpcUrl = exports.generateSolanaTransactionURL = exports.getPayer = exports.rpc = exports.setAnchorProvider = exports.defaultSolanaWalletKeypair = void 0;
3
+ exports.CustomLoader = exports.setConfig = exports.getConfig = exports.getProverUrl = exports.getIndexerUrl = exports.getSolanaRpcUrl = exports.setAnchorProvider = exports.defaultSolanaWalletKeypair = void 0;
4
+ exports.rpc = rpc;
5
+ exports.getPayer = getPayer;
6
+ exports.generateSolanaTransactionURL = generateSolanaTransactionURL;
7
+ exports.ensureDirectoryExists = ensureDirectoryExists;
8
+ exports.isValidURL = isValidURL;
9
+ exports.isValidBase58SecretKey = isValidBase58SecretKey;
4
10
  const tslib_1 = require("tslib");
5
11
  const fs = tslib_1.__importStar(require("fs"));
6
12
  const fs_1 = require("fs");
@@ -42,18 +48,15 @@ function rpc() {
42
48
  }
43
49
  return (0, stateless_js_1.createRpc)((0, exports.getSolanaRpcUrl)(), (0, exports.getIndexerUrl)(), (0, exports.getProverUrl)());
44
50
  }
45
- exports.rpc = rpc;
46
51
  function getWalletPath() {
47
52
  return process.env.HOME + "/.config/solana/id.json";
48
53
  }
49
54
  async function getPayer() {
50
55
  return await (0, helpers_1.getKeypairFromFile)(getWalletPath());
51
56
  }
52
- exports.getPayer = getPayer;
53
57
  function generateSolanaTransactionURL(transactionType, transactionHash, cluster) {
54
58
  return `https://explorer.solana.com/${transactionType}/${transactionHash}?cluster=${cluster}`;
55
59
  }
56
- exports.generateSolanaTransactionURL = generateSolanaTransactionURL;
57
60
  const getSolanaRpcUrl = () => {
58
61
  const config = (0, exports.getConfig)();
59
62
  return config.solanaRpcUrl;
@@ -114,7 +117,6 @@ function ensureDirectoryExists(dirPath) {
114
117
  fs.mkdirSync(dirPath, { recursive: true });
115
118
  }
116
119
  }
117
- exports.ensureDirectoryExists = ensureDirectoryExists;
118
120
  const setConfig = (config, filePath) => {
119
121
  if (!filePath)
120
122
  filePath = getConfigPath();
@@ -161,9 +163,7 @@ function isValidURL(url) {
161
163
  return false;
162
164
  }
163
165
  }
164
- exports.isValidURL = isValidURL;
165
166
  function isValidBase58SecretKey(secretKey) {
166
167
  const base58Regex = /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/;
167
168
  return base58Regex.test(secretKey);
168
169
  }
169
- exports.isValidBase58SecretKey = isValidBase58SecretKey;