@lightprotocol/zk-compression-cli 0.27.1-alpha.1 → 0.27.1-alpha.3

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 (100) hide show
  1. package/accounts/address_merkle_tree_amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2.json +1 -1
  2. package/accounts/address_merkle_tree_queue_aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F.json +1 -1
  3. package/accounts/batch_address_merkle_tree_EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK.json +14 -1
  4. package/accounts/{batch_state_merkle_tree_2_2Yb3fGo2E9aWLjY8KuESaqurYpGGhEeJr7eynKrSgXwS.json → batch_address_merkle_tree_amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx.json} +1 -1
  5. package/accounts/{batch_state_merkle_tree_HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu.json → batch_state_merkle_tree_bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU.json} +1 -1
  6. package/accounts/batch_state_merkle_tree_bmt2UxoBxB9xWev4BkLvkGdapsz6sZGkzViPNph7VFi.json +1 -0
  7. package/accounts/batch_state_merkle_tree_bmt3ccLd4bqSVZVeCJnH1F6C8jNygAhaDfxDwePyyGb.json +1 -0
  8. package/accounts/batch_state_merkle_tree_bmt4d3p1a4YQgk9PeZv5s4DBUmbF5NxqYpk9HGjQsd8.json +1 -0
  9. package/accounts/batch_state_merkle_tree_bmt5yU97jC88YXTuSukYHa8Z5Bi2ZDUtmzfkDTA2mG2.json +1 -0
  10. package/accounts/{batched_output_queue_2_12wJT3xYd46rtjeqDU6CrtT8unqLjPiheggzqhN9YsyB.json → batched_output_queue_oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto.json} +1 -1
  11. package/accounts/{batched_output_queue_6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU.json → batched_output_queue_oq2UkeMsJLfXt2QHzim242SUi3nvjJs8Pn7Eac9H9vg.json} +1 -1
  12. package/accounts/batched_output_queue_oq3AxjekBWgo64gpauB6QtuZNesuv19xrhaC1ZM1THQ.json +1 -0
  13. package/accounts/batched_output_queue_oq4ypwvVGzCUMoiKKHWh4S1SgZJ9vCvKpcz6RT6A8dq.json +1 -0
  14. package/accounts/batched_output_queue_oq5oh5ZR3yGomuQgFduNDzjtGvVWfDRGLuDVjv9a96P.json +1 -0
  15. package/accounts/compressible_config_pda_ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg.json +1 -0
  16. package/accounts/config_counter_pda_8gH9tmziWsS8Wc4fnoN5ax3jsSumNYoRDuSBvmH2GMH8.json +1 -0
  17. package/accounts/{test_batched_cpi_context_7Hp52chxaew8bW1ApR4fck2bh6Y8qA1pu3qwH6N9zaLj.json → cpi_context_cpi15BoVPKgEPw5o8wc2T816GE7b378nMXnhH3Xbq4y.json} +1 -1
  18. package/accounts/cpi_context_cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4.json +1 -1
  19. package/accounts/cpi_context_cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK.json +1 -1
  20. package/accounts/{cpi_context_batched_2_HwtjxDvFEXiWnzeMeWkMBzpQN45A95rTJNZmz1Z3pe8R.json → cpi_context_cpi2yGapXUR3As5SjnHBAVvmApNiLsbeZpF3euWnW6B.json} +1 -14
  21. package/accounts/cpi_context_cpi3mbwMpSX8FAGMZVP85AwxqCaQMfEk9Em1v8QK9Rf.json +1 -0
  22. package/accounts/cpi_context_cpi4yyPDc4bCgHAnsenunGA8Y77j3XEDyjgfyCKgcoc.json +1 -0
  23. package/accounts/cpi_context_cpi5ZTjdgYpZ1Xr7B1cMLLUE81oTtJbNNAyKary2nV6.json +1 -0
  24. package/accounts/epoch_pda_34w7KcLBXabMkHuXE2fY368vFe6kP3v5EJn8nPvQ8SKn.json +1 -1
  25. package/accounts/forester_epoch_pda_3FBt1BPQHCQkS8k3wrUXMfB6JBhtMhEqQXueHRw2ojZV.json +1 -1
  26. package/accounts/governance_authority_pda_CuEtcKkkbTn6qy2qxqDswq5U2ADsqoipYDAYfRvxPjcp.json +1 -1
  27. package/accounts/group_pda_24rt4RgeyjUCWGS2eF7L7gyNMuz6JWdqYpAvb1KRoHxs.json +1 -1
  28. package/accounts/merkle_tree_pubkey_smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT.json +1 -1
  29. package/accounts/merkle_tree_pubkey_smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho.json +1 -1
  30. package/accounts/nullifier_queue_pubkey_nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148.json +1 -1
  31. package/accounts/nullifier_queue_pubkey_nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X.json +1 -1
  32. package/accounts/registered_forester_pda_2KNqEh23Se8AHecuzR1UkxL26euq2qXSpQPTH1jH7VqU.json +1 -1
  33. package/accounts/rent_sponsor_pda_r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti.json +1 -0
  34. package/bin/account_compression.so +0 -0
  35. package/bin/light_compressed_token.so +0 -0
  36. package/bin/light_registry.so +0 -0
  37. package/bin/light_system_program_pinocchio.so +0 -0
  38. package/dist/commands/approve-and-mint-to/index.js +26 -29
  39. package/dist/commands/balance/index.js +12 -11
  40. package/dist/commands/compress-sol/index.js +13 -13
  41. package/dist/commands/compress-spl/index.js +19 -19
  42. package/dist/commands/config/config.js +67 -33
  43. package/dist/commands/create-mint/index.js +19 -20
  44. package/dist/commands/create-token-pool/index.js +9 -9
  45. package/dist/commands/decompress-sol/index.js +13 -13
  46. package/dist/commands/decompress-spl/index.js +19 -19
  47. package/dist/commands/init/index.js +8 -8
  48. package/dist/commands/merge-token-accounts/index.js +13 -14
  49. package/dist/commands/mint-to/index.js +24 -25
  50. package/dist/commands/start-prover/index.d.ts +0 -3
  51. package/dist/commands/start-prover/index.js +13 -58
  52. package/dist/commands/test-validator/index.d.ts +4 -2
  53. package/dist/commands/test-validator/index.js +107 -109
  54. package/dist/commands/token-balance/index.js +15 -15
  55. package/dist/commands/transfer/index.js +23 -24
  56. package/dist/psp-utils/download.js +1 -1
  57. package/dist/utils/constants.d.ts +2 -2
  58. package/dist/utils/constants.js +2 -3
  59. package/dist/utils/downloadProverBinary.d.ts +7 -0
  60. package/dist/utils/downloadProverBinary.js +108 -0
  61. package/dist/utils/initTestEnv.d.ts +12 -5
  62. package/dist/utils/initTestEnv.js +84 -15
  63. package/dist/utils/process.js +8 -6
  64. package/dist/utils/processPhotonIndexer.js +3 -3
  65. package/dist/utils/processProverServer.d.ts +1 -2
  66. package/dist/utils/processProverServer.js +70 -86
  67. package/dist/utils/utils.d.ts +4 -0
  68. package/dist/utils/utils.js +44 -3
  69. package/oclif.manifest.json +226 -274
  70. package/package.json +61 -63
  71. package/test_bin/dev +4 -7
  72. package/test_bin/run +2 -2
  73. package/bin/forester +0 -0
  74. package/bin/forester.toml +0 -15
  75. package/bin/light_system_program.so +0 -0
  76. package/bin/prover-darwin-arm64 +0 -0
  77. package/bin/prover-darwin-x64 +0 -0
  78. package/bin/prover-linux-arm64 +0 -0
  79. package/bin/prover-linux-x64 +0 -0
  80. package/bin/proving-keys/combined_26_1_1.key +0 -0
  81. package/bin/proving-keys/combined_26_1_2.key +0 -0
  82. package/bin/proving-keys/combined_26_2_1.key +0 -0
  83. package/bin/proving-keys/combined_32_40_1_1.key +0 -0
  84. package/bin/proving-keys/combined_32_40_1_2.key +0 -0
  85. package/bin/proving-keys/combined_32_40_2_1.key +0 -0
  86. package/bin/proving-keys/inclusion_32_1.key +0 -0
  87. package/bin/proving-keys/inclusion_32_2.key +0 -0
  88. package/bin/proving-keys/inclusion_32_3.key +0 -0
  89. package/bin/proving-keys/inclusion_32_4.key +0 -0
  90. package/bin/proving-keys/mainnet_inclusion_26_1.key +0 -0
  91. package/bin/proving-keys/mainnet_inclusion_26_2.key +0 -0
  92. package/bin/proving-keys/mainnet_inclusion_26_3.key +0 -0
  93. package/bin/proving-keys/mainnet_inclusion_26_4.key +0 -0
  94. package/bin/proving-keys/non-inclusion_26_1.key +0 -0
  95. package/bin/proving-keys/non-inclusion_26_2.key +0 -0
  96. package/bin/proving-keys/non-inclusion_40_1.key +0 -0
  97. package/bin/proving-keys/non-inclusion_40_2.key +0 -0
  98. package/bin/proving-keys/non-inclusion_40_3.key +0 -0
  99. package/bin/proving-keys/non-inclusion_40_4.key +0 -0
  100. package/test_bin/lut.json +0 -1
@@ -2,10 +2,32 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const utils_1 = require("../../utils/utils");
5
- const helpers_1 = require("@solana-developers/helpers");
6
5
  const web3_js_1 = require("@solana/web3.js");
7
6
  const compressed_token_1 = require("@lightprotocol/compressed-token");
8
7
  class MintToCommand extends core_1.Command {
8
+ static summary = "Mint tokens to an account.";
9
+ static examples = [
10
+ "$ light mint-to --mint PublicKey --to PublicKey --amount 1000",
11
+ ];
12
+ static flags = {
13
+ "mint-authority": core_1.Flags.string({
14
+ description: "Specify the filepath of the mint authority keypair. Defaults to your local solana wallet.",
15
+ required: false,
16
+ }),
17
+ mint: core_1.Flags.string({
18
+ description: "Specify the mint address.",
19
+ required: true,
20
+ }),
21
+ to: core_1.Flags.string({
22
+ description: "Specify the recipient address.",
23
+ required: true,
24
+ }),
25
+ amount: core_1.Flags.integer({
26
+ description: "Amount to mint, in tokens.",
27
+ required: true,
28
+ }),
29
+ };
30
+ static args = {};
9
31
  async run() {
10
32
  const { flags } = await this.parse(MintToCommand);
11
33
  const mint = flags["mint"];
@@ -22,7 +44,7 @@ class MintToCommand extends core_1.Command {
22
44
  const payer = (0, utils_1.defaultSolanaWalletKeypair)();
23
45
  let mintAuthority = payer;
24
46
  if (flags["mint-authority"] !== undefined) {
25
- mintAuthority = await (0, helpers_1.getKeypairFromFile)(flags["mint-authority"]);
47
+ mintAuthority = await (0, utils_1.getKeypairFromFile)(flags["mint-authority"]);
26
48
  }
27
49
  const txId = await (0, compressed_token_1.mintTo)((0, utils_1.rpc)(), payer, mintPublicKey, toPublicKey, mintAuthority, amount);
28
50
  loader.stop(false);
@@ -34,27 +56,4 @@ class MintToCommand extends core_1.Command {
34
56
  }
35
57
  }
36
58
  }
37
- MintToCommand.summary = "Mint tokens to an account.";
38
- MintToCommand.examples = [
39
- "$ light mint-to --mint PublicKey --to PublicKey --amount 1000",
40
- ];
41
- MintToCommand.flags = {
42
- "mint-authority": core_1.Flags.string({
43
- description: "Specify the filepath of the mint authority keypair. Defaults to your local solana wallet.",
44
- required: false,
45
- }),
46
- mint: core_1.Flags.string({
47
- description: "Specify the mint address.",
48
- required: true,
49
- }),
50
- to: core_1.Flags.string({
51
- description: "Specify the recipient address.",
52
- required: true,
53
- }),
54
- amount: core_1.Flags.integer({
55
- description: "Amount to mint, in tokens.",
56
- required: true,
57
- }),
58
- };
59
- MintToCommand.args = {};
60
59
  exports.default = MintToCommand;
@@ -4,9 +4,6 @@ declare class StartProver extends Command {
4
4
  protected finally(_: Error | undefined): Promise<any>;
5
5
  static flags: {
6
6
  "prover-port": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
7
- "run-mode": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
- circuit: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
- force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
7
  redisUrl: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
8
  };
12
9
  run(): Promise<void>;
@@ -4,28 +4,28 @@ const core_1 = require("@oclif/core");
4
4
  const index_1 = require("../../utils/index");
5
5
  const processProverServer_1 = require("../../utils/processProverServer");
6
6
  class StartProver extends core_1.Command {
7
+ static description = "Start gnark prover";
7
8
  finally(_) {
8
9
  process.exit();
9
10
  }
11
+ static flags = {
12
+ "prover-port": core_1.Flags.integer({
13
+ description: "Enable Light Prover server on this port.",
14
+ required: false,
15
+ default: 3001,
16
+ }),
17
+ redisUrl: core_1.Flags.string({
18
+ description: "Redis URL to use for the prover (e.g. redis://localhost:6379)",
19
+ required: false,
20
+ }),
21
+ };
10
22
  async run() {
11
23
  const { flags } = await this.parse(StartProver);
12
24
  const loader = new index_1.CustomLoader("Performing setup tasks...\n");
13
25
  loader.start();
14
- if (!flags["run-mode"] && !flags["circuit"]) {
15
- this.log("Please specify --run-mode or --circuit.");
16
- return;
17
- }
18
26
  const proverPort = flags["prover-port"] || 3001;
19
- const force = flags["force"] || false;
20
27
  const redisUrl = flags["redisUrl"] || process.env.REDIS_URL || undefined;
21
- // TODO: remove this workaround.
22
- // Force local-rpc mode when rpc is specified
23
- let runMode = flags["run-mode"];
24
- if (runMode === "rpc") {
25
- runMode = "local-rpc";
26
- this.log("Note: Running in local-rpc mode instead of rpc mode");
27
- }
28
- await (0, processProverServer_1.startProver)(proverPort, runMode, flags["circuit"], force, redisUrl);
28
+ await (0, processProverServer_1.startProver)(proverPort, redisUrl);
29
29
  const healthy = await (0, processProverServer_1.healthCheck)(proverPort, 10, 1000);
30
30
  loader.stop();
31
31
  if (healthy) {
@@ -36,49 +36,4 @@ class StartProver extends core_1.Command {
36
36
  }
37
37
  }
38
38
  }
39
- StartProver.description = "Start gnark prover";
40
- StartProver.flags = {
41
- "prover-port": core_1.Flags.integer({
42
- description: "Enable Light Prover server on this port.",
43
- required: false,
44
- default: 3001,
45
- }),
46
- "run-mode": core_1.Flags.string({
47
- description: "Specify the running mode (local-rpc, forester, forester-test, rpc, or full). Default: local-rpc",
48
- options: [
49
- "local-rpc",
50
- "rpc",
51
- "forester",
52
- "forester-test",
53
- "full",
54
- "full-test",
55
- ],
56
- required: false,
57
- }),
58
- circuit: core_1.Flags.string({
59
- description: "Specify individual circuits to enable.",
60
- options: [
61
- "inclusion",
62
- "non-inclusion",
63
- "combined",
64
- "append",
65
- "update",
66
- "address-append",
67
- "append-test",
68
- "update-test",
69
- "address-append-test",
70
- ],
71
- multiple: true,
72
- required: false,
73
- }),
74
- force: core_1.Flags.boolean({
75
- description: "Force restart the prover even if one is already running with the same flags.",
76
- required: false,
77
- default: false,
78
- }),
79
- redisUrl: core_1.Flags.string({
80
- description: "Redis URL to use for the prover (e.g. redis://localhost:6379)",
81
- required: false,
82
- }),
83
- };
84
39
  exports.default = StartProver;
@@ -12,14 +12,16 @@ declare class SetupCommand extends Command {
12
12
  "rpc-port": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
13
13
  "indexer-port": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
14
14
  "prover-port": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
15
- "prover-run-mode": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
- circuit: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
15
  "limit-ledger-size": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
18
16
  "gossip-host": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
19
17
  stop: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
18
  "geyser-config": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
19
  "validator-args": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
20
  "sbf-program": import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ devnet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
22
+ mainnet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
24
+ "skip-reset": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
25
  };
24
26
  validatePrograms(programs: {
25
27
  address: string;
@@ -8,12 +8,112 @@ const index_1 = require("../../utils/index");
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
9
  const fs_1 = tslib_1.__importDefault(require("fs"));
10
10
  class SetupCommand extends core_1.Command {
11
+ static description = "Start a local test setup with: Solana test validator, Photon indexer, and Light prover";
12
+ static examples = [
13
+ "$ light test-validator",
14
+ "$ light test-validator --skip-indexer",
15
+ "$ light test-validator --geyser-config ./config.json",
16
+ '$ light test-validator --validator-args "--limit-ledger-size 50000000"',
17
+ "$ light test-validator --sbf-program <address> <path/program>",
18
+ "$ light test-validator --devnet",
19
+ "$ light test-validator --mainnet",
20
+ ];
11
21
  finally(err) {
12
22
  if (err) {
13
23
  console.error(err);
14
24
  }
15
25
  process.exit();
16
26
  }
27
+ static flags = {
28
+ "skip-indexer": core_1.Flags.boolean({
29
+ description: "Runs a test validator without starting a new indexer.",
30
+ default: false,
31
+ }),
32
+ "skip-prover": core_1.Flags.boolean({
33
+ description: "Runs a test validator without starting a new prover service.",
34
+ default: false,
35
+ }),
36
+ "skip-system-accounts": core_1.Flags.boolean({
37
+ description: "Runs a test validator without initialized light system accounts.",
38
+ default: false,
39
+ }),
40
+ "relax-indexer-version-constraint": core_1.Flags.boolean({
41
+ description: "Disables indexer version check. Only use if you know what you are doing.",
42
+ default: false,
43
+ exclusive: ["skip-indexer"],
44
+ }),
45
+ "indexer-db-url": core_1.Flags.string({
46
+ description: "Custom indexer database URL to store indexing data. By default we use an in-memory SQLite database.",
47
+ required: false,
48
+ exclusive: ["skip-indexer"],
49
+ }),
50
+ "rpc-port": core_1.Flags.integer({
51
+ description: "Enable JSON RPC on this port, and the next port for the RPC websocket.",
52
+ required: false,
53
+ default: 8899,
54
+ }),
55
+ "indexer-port": core_1.Flags.integer({
56
+ description: "Enable Photon indexer on this port.",
57
+ required: false,
58
+ default: 8784,
59
+ exclusive: ["skip-indexer"],
60
+ }),
61
+ "prover-port": core_1.Flags.integer({
62
+ description: "Enable Light Prover server on this port.",
63
+ required: false,
64
+ default: 3001,
65
+ exclusive: ["skip-prover"],
66
+ }),
67
+ "limit-ledger-size": core_1.Flags.integer({
68
+ description: "Keep this amount of shreds in root slots.",
69
+ required: false,
70
+ default: 10000,
71
+ }),
72
+ "gossip-host": core_1.Flags.string({
73
+ description: "Gossip DNS name or IP address for the validator to advertise in gossip.",
74
+ required: false,
75
+ default: "127.0.0.1",
76
+ }),
77
+ stop: core_1.Flags.boolean({
78
+ description: "Stops the test validator and dependent processes. Use with --skip-indexer, --skip-prover to keep specific services running.",
79
+ required: false,
80
+ default: false,
81
+ }),
82
+ "geyser-config": core_1.Flags.string({
83
+ description: "Path to Geyser plugin config.",
84
+ required: false,
85
+ }),
86
+ "validator-args": core_1.Flags.string({
87
+ description: "Additional arguments to pass directly to solana-test-validator. Only use if you know what you are doing.",
88
+ required: false,
89
+ exclusive: ["geyser-config"],
90
+ }),
91
+ "sbf-program": core_1.Flags.string({
92
+ description: "Add a SBF program to the genesis configuration with upgrades disabled. If the ledger already exists then this parameter is silently ignored. First argument can be a pubkey string or path to a keypair",
93
+ required: false,
94
+ multiple: true,
95
+ summary: "Usage: --sbf-program <address> <path/program_name.so>",
96
+ }),
97
+ devnet: core_1.Flags.boolean({
98
+ description: "Clone Light Protocol programs and accounts from devnet instead of loading local binaries.",
99
+ default: false,
100
+ exclusive: ["mainnet"],
101
+ }),
102
+ mainnet: core_1.Flags.boolean({
103
+ description: "Clone Light Protocol programs and accounts from mainnet instead of loading local binaries.",
104
+ default: false,
105
+ exclusive: ["devnet"],
106
+ }),
107
+ verbose: core_1.Flags.boolean({
108
+ char: "v",
109
+ description: "Enable verbose logging.",
110
+ default: false,
111
+ }),
112
+ "skip-reset": core_1.Flags.boolean({
113
+ description: "Skip resetting the ledger.",
114
+ default: false,
115
+ }),
116
+ };
17
117
  validatePrograms(programs) {
18
118
  // Check for duplicate addresses among provided programs
19
119
  const addresses = new Set();
@@ -84,122 +184,20 @@ class SetupCommand extends core_1.Command {
84
184
  proverPort: flags["prover-port"],
85
185
  prover: !flags["skip-prover"],
86
186
  skipSystemAccounts: flags["skip-system-accounts"],
87
- proverRunMode: flags["prover-run-mode"],
88
- circuits: flags["circuit"],
89
187
  geyserConfig: flags["geyser-config"],
90
188
  validatorArgs: flags["validator-args"],
189
+ cloneNetwork: flags.devnet
190
+ ? "devnet"
191
+ : flags.mainnet
192
+ ? "mainnet"
193
+ : undefined,
194
+ verbose: flags.verbose,
195
+ skipReset: flags["skip-reset"],
91
196
  });
92
197
  this.log("\nSetup tasks completed successfully \x1b[32m✔\x1b[0m");
93
198
  }
94
199
  }
95
200
  }
96
- SetupCommand.description = "Start a local test setup with: Solana test validator, Photon indexer, and Light prover";
97
- SetupCommand.examples = [
98
- "$ light test-validator",
99
- "$ light test-validator --skip-indexer",
100
- "$ light test-validator --geyser-config ./config.json",
101
- '$ light test-validator --validator-args "--limit-ledger-size 50000000"',
102
- "$ light test-validator --sbf-program <address> <path/program>",
103
- ];
104
- SetupCommand.flags = {
105
- "skip-indexer": core_1.Flags.boolean({
106
- description: "Runs a test validator without starting a new indexer.",
107
- default: false,
108
- }),
109
- "skip-prover": core_1.Flags.boolean({
110
- description: "Runs a test validator without starting a new prover service.",
111
- default: false,
112
- }),
113
- "skip-system-accounts": core_1.Flags.boolean({
114
- description: "Runs a test validator without initialized light system accounts.",
115
- default: false,
116
- }),
117
- "relax-indexer-version-constraint": core_1.Flags.boolean({
118
- description: "Disables indexer version check. Only use if you know what you are doing.",
119
- default: false,
120
- exclusive: ["skip-indexer"],
121
- }),
122
- "indexer-db-url": core_1.Flags.string({
123
- description: "Custom indexer database URL to store indexing data. By default we use an in-memory SQLite database.",
124
- required: false,
125
- exclusive: ["skip-indexer"],
126
- }),
127
- "rpc-port": core_1.Flags.integer({
128
- description: "Enable JSON RPC on this port, and the next port for the RPC websocket.",
129
- required: false,
130
- default: 8899,
131
- }),
132
- "indexer-port": core_1.Flags.integer({
133
- description: "Enable Photon indexer on this port.",
134
- required: false,
135
- default: 8784,
136
- exclusive: ["skip-indexer"],
137
- }),
138
- "prover-port": core_1.Flags.integer({
139
- description: "Enable Light Prover server on this port.",
140
- required: false,
141
- default: 3001,
142
- exclusive: ["skip-prover"],
143
- }),
144
- "prover-run-mode": core_1.Flags.string({
145
- description: "Specify the running mode for the prover (local-rpc, forester, forester-test, rpc, or full). Default: local-rpc",
146
- options: [
147
- "local-rpc",
148
- "rpc",
149
- "forester",
150
- "forester-test",
151
- "full",
152
- "full-test",
153
- ],
154
- required: false,
155
- exclusive: ["skip-prover"],
156
- }),
157
- circuit: core_1.Flags.string({
158
- description: "Specify individual circuits to enable.",
159
- options: [
160
- "inclusion",
161
- "non-inclusion",
162
- "combined",
163
- "append",
164
- "update",
165
- "append-test",
166
- "update-test",
167
- ],
168
- multiple: true,
169
- required: false,
170
- exclusive: ["skip-prover"],
171
- }),
172
- "limit-ledger-size": core_1.Flags.integer({
173
- description: "Keep this amount of shreds in root slots.",
174
- required: false,
175
- default: 10000,
176
- }),
177
- "gossip-host": core_1.Flags.string({
178
- description: "Gossip DNS name or IP address for the validator to advertise in gossip.",
179
- required: false,
180
- default: "127.0.0.1",
181
- }),
182
- stop: core_1.Flags.boolean({
183
- description: "Stops the test validator and dependent processes. Use with --skip-indexer, --skip-prover to keep specific services running.",
184
- required: false,
185
- default: false,
186
- }),
187
- "geyser-config": core_1.Flags.string({
188
- description: "Path to Geyser plugin config.",
189
- required: false,
190
- }),
191
- "validator-args": core_1.Flags.string({
192
- description: "Additional arguments to pass directly to solana-test-validator. Only use if you know what you are doing.",
193
- required: false,
194
- exclusive: ["geyser-config"],
195
- }),
196
- "sbf-program": core_1.Flags.string({
197
- description: "Add a SBF program to the genesis configuration with upgrades disabled. If the ledger already exists then this parameter is silently ignored. First argument can be a pubkey string or path to a keypair",
198
- required: false,
199
- multiple: true,
200
- summary: "Usage: --sbf-program <address> <path/program_name.so>",
201
- }),
202
- };
203
201
  exports.default = SetupCommand;
204
202
  exports.SYSTEM_PROGRAMS = [
205
203
  {
@@ -4,6 +4,21 @@ const core_1 = require("@oclif/core");
4
4
  const utils_1 = require("../../utils/utils");
5
5
  const web3_js_1 = require("@solana/web3.js");
6
6
  class TokenBalanceCommand extends core_1.Command {
7
+ static summary = "Get balance";
8
+ static examples = [
9
+ "$ light token-balance --mint=<ADDRESS> --owner=<ADDRESS>",
10
+ ];
11
+ static flags = {
12
+ owner: core_1.Flags.string({
13
+ description: "Address of the compressed token owner.",
14
+ required: true,
15
+ }),
16
+ mint: core_1.Flags.string({
17
+ description: "Mint address of the compressed token account.",
18
+ required: true,
19
+ }),
20
+ };
21
+ static args = {};
7
22
  async run() {
8
23
  const { flags } = await this.parse(TokenBalanceCommand);
9
24
  const loader = new utils_1.CustomLoader(`Performing balance...\n`);
@@ -37,19 +52,4 @@ class TokenBalanceCommand extends core_1.Command {
37
52
  }
38
53
  }
39
54
  }
40
- TokenBalanceCommand.summary = "Get balance";
41
- TokenBalanceCommand.examples = [
42
- "$ light token-balance --mint=<ADDRESS> --owner=<ADDRESS>",
43
- ];
44
- TokenBalanceCommand.flags = {
45
- owner: core_1.Flags.string({
46
- description: "Address of the compressed token owner.",
47
- required: true,
48
- }),
49
- mint: core_1.Flags.string({
50
- description: "Mint address of the compressed token account.",
51
- required: true,
52
- }),
53
- };
54
- TokenBalanceCommand.args = {};
55
55
  exports.default = TokenBalanceCommand;
@@ -4,8 +4,29 @@ const core_1 = require("@oclif/core");
4
4
  const utils_1 = require("../../utils/utils");
5
5
  const compressed_token_1 = require("@lightprotocol/compressed-token");
6
6
  const web3_js_1 = require("@solana/web3.js");
7
- const helpers_1 = require("@solana-developers/helpers");
8
7
  class TransferCommand extends core_1.Command {
8
+ static summary = "Transfer tokens from one account to another.";
9
+ static examples = [
10
+ "$ light transfer --mint PublicKey --to PublicKey --amount 1000",
11
+ ];
12
+ static flags = {
13
+ mint: core_1.Flags.string({
14
+ description: "Mint to transfer",
15
+ required: true,
16
+ }),
17
+ to: core_1.Flags.string({
18
+ description: "Recipient address",
19
+ required: true,
20
+ }),
21
+ amount: core_1.Flags.integer({
22
+ description: "Amount to send, in tokens",
23
+ required: true,
24
+ }),
25
+ "fee-payer": core_1.Flags.string({
26
+ description: "Specify the fee-payer account. Defaults to the client keypair.",
27
+ required: false,
28
+ }),
29
+ };
9
30
  async run() {
10
31
  const { flags } = await this.parse(TransferCommand);
11
32
  const loader = new utils_1.CustomLoader(`Performing transfer...\n`);
@@ -21,7 +42,7 @@ class TransferCommand extends core_1.Command {
21
42
  const toPublicKey = new web3_js_1.PublicKey(to);
22
43
  let payer = (0, utils_1.defaultSolanaWalletKeypair)();
23
44
  if (flags["fee-payer"] !== undefined) {
24
- payer = await (0, helpers_1.getKeypairFromFile)(flags["fee-payer"]);
45
+ payer = await (0, utils_1.getKeypairFromFile)(flags["fee-payer"]);
25
46
  }
26
47
  const txId = await (0, compressed_token_1.transfer)((0, utils_1.rpc)(), payer, mintPublicKey, amount, payer, toPublicKey);
27
48
  loader.stop(false);
@@ -33,26 +54,4 @@ class TransferCommand extends core_1.Command {
33
54
  }
34
55
  }
35
56
  }
36
- TransferCommand.summary = "Transfer tokens from one account to another.";
37
- TransferCommand.examples = [
38
- "$ light transfer --mint PublicKey --to PublicKey --amount 1000",
39
- ];
40
- TransferCommand.flags = {
41
- mint: core_1.Flags.string({
42
- description: "Mint to transfer",
43
- required: true,
44
- }),
45
- to: core_1.Flags.string({
46
- description: "Recipient address",
47
- required: true,
48
- }),
49
- amount: core_1.Flags.integer({
50
- description: "Amount to send, in tokens",
51
- required: true,
52
- }),
53
- "fee-payer": core_1.Flags.string({
54
- description: "Specify the fee-payer account. Defaults to the client keypair.",
55
- required: false,
56
- }),
57
- };
58
57
  exports.default = TransferCommand;
@@ -58,7 +58,7 @@ async function makeExecutableInDir(dirPath) {
58
58
  * @returns {Promise<void>}
59
59
  */
60
60
  function handleTarFile({ decompressor, data, localFilePath, dirPath, }) {
61
- const parser = new tar.Parse();
61
+ const parser = new tar.Parser();
62
62
  data.pipe(decompressor).pipe(parser);
63
63
  parser.on("entry", (entry) => {
64
64
  const baseName = path.parse(entry.path).base;
@@ -12,10 +12,10 @@ export declare const CARGO_GENERATE_TAG = "v0.18.4";
12
12
  export declare const SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
13
13
  export declare const LIGHT_PROVER_PROCESS_NAME = "light-prover";
14
14
  export declare const INDEXER_PROCESS_NAME = "photon";
15
- export declare const PHOTON_VERSION = "0.52.3";
15
+ export declare const PHOTON_VERSION = "0.51.2";
16
16
  export declare const USE_PHOTON_FROM_GIT = true;
17
17
  export declare const PHOTON_GIT_REPO = "https://github.com/lightprotocol/photon.git";
18
- export declare const PHOTON_GIT_COMMIT = "6ba6813";
18
+ export declare const PHOTON_GIT_COMMIT = "711c47b20330c6bb78feb0a2c15e8292fcd0a7b0";
19
19
  export declare const LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
20
20
  export declare const BASE_PATH = "../../bin/";
21
21
  export declare const PROGRAM_ID = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS";
@@ -17,12 +17,11 @@ exports.CARGO_GENERATE_TAG = "v0.18.4";
17
17
  exports.SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
18
18
  exports.LIGHT_PROVER_PROCESS_NAME = "light-prover";
19
19
  exports.INDEXER_PROCESS_NAME = "photon";
20
- exports.PHOTON_VERSION = "0.52.3";
20
+ exports.PHOTON_VERSION = "0.51.2";
21
21
  // Set these to override Photon requirements with a specific git commit:
22
22
  exports.USE_PHOTON_FROM_GIT = true; // If true, will show git install command instead of crates.io.
23
23
  exports.PHOTON_GIT_REPO = "https://github.com/lightprotocol/photon.git";
24
- // added new v2 tree.
25
- exports.PHOTON_GIT_COMMIT = "6ba6813"; // If empty, will use main branch.
24
+ exports.PHOTON_GIT_COMMIT = "711c47b20330c6bb78feb0a2c15e8292fcd0a7b0"; // If empty, will use main branch.
26
25
  exports.LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
27
26
  exports.BASE_PATH = "../../bin/";
28
27
  exports.PROGRAM_ID = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS";
@@ -0,0 +1,7 @@
1
+ interface DownloadOptions {
2
+ maxRetries?: number;
3
+ retryDelay?: number;
4
+ }
5
+ export declare function downloadProverBinary(binaryPath: string, binaryName: string, options?: DownloadOptions): Promise<void>;
6
+ export declare function getProverVersion(): string;
7
+ export {};