@lightprotocol/zk-compression-cli 0.21.0 → 0.22.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.
- package/bin/prover-darwin-arm64 +0 -0
- package/bin/prover-darwin-x64 +0 -0
- package/bin/prover-linux-arm64 +0 -0
- package/bin/prover-linux-x64 +0 -0
- package/bin/prover-windows-arm64.exe +0 -0
- package/bin/prover-windows-x64.exe +0 -0
- package/dist/commands/test-validator/index.d.ts +3 -0
- package/dist/commands/test-validator/index.js +27 -1
- package/dist/utils/initTestEnv.d.ts +9 -3
- package/dist/utils/initTestEnv.js +15 -3
- package/oclif.manifest.json +139 -114
- package/package.json +17 -17
package/bin/prover-darwin-arm64
CHANGED
|
Binary file
|
package/bin/prover-darwin-x64
CHANGED
|
Binary file
|
package/bin/prover-linux-arm64
CHANGED
|
Binary file
|
package/bin/prover-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
2
|
declare class SetupCommand extends Command {
|
|
3
3
|
static description: string;
|
|
4
|
+
static examples: string[];
|
|
4
5
|
protected finally(_: Error | undefined): Promise<any>;
|
|
5
6
|
static flags: {
|
|
6
7
|
"skip-indexer": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -16,6 +17,8 @@ declare class SetupCommand extends Command {
|
|
|
16
17
|
"limit-ledger-size": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
18
|
"gossip-host": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
19
|
stop: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
"geyser-config": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
"validator-args": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
22
|
};
|
|
20
23
|
run(): Promise<void>;
|
|
21
24
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
const core_1 = require("@oclif/core");
|
|
4
5
|
const initTestEnv_1 = require("../../utils/initTestEnv");
|
|
5
6
|
const index_1 = require("../../utils/index");
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
9
|
class SetupCommand extends core_1.Command {
|
|
7
10
|
finally(_) {
|
|
8
11
|
process.exit();
|
|
@@ -11,6 +14,12 @@ class SetupCommand extends core_1.Command {
|
|
|
11
14
|
const { flags } = await this.parse(SetupCommand);
|
|
12
15
|
const loader = new index_1.CustomLoader("Performing setup tasks...\n");
|
|
13
16
|
loader.start();
|
|
17
|
+
if (flags["geyser-config"]) {
|
|
18
|
+
const configPath = path_1.default.resolve(flags["geyser-config"]);
|
|
19
|
+
if (!fs_1.default.existsSync(configPath)) {
|
|
20
|
+
this.error(`Geyser config file not found: ${configPath}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
14
23
|
if (flags["stop"] === true) {
|
|
15
24
|
await (0, initTestEnv_1.stopTestEnv)({
|
|
16
25
|
indexer: !flags["skip-indexer"],
|
|
@@ -32,12 +41,20 @@ class SetupCommand extends core_1.Command {
|
|
|
32
41
|
skipSystemAccounts: flags["skip-system-accounts"],
|
|
33
42
|
proverRunMode: flags["prover-run-mode"],
|
|
34
43
|
circuits: flags["circuit"],
|
|
44
|
+
geyserConfig: flags["geyser-config"],
|
|
45
|
+
validatorArgs: flags["validator-args"],
|
|
35
46
|
});
|
|
36
47
|
this.log("\nSetup tasks completed successfully \x1b[32m✔\x1b[0m");
|
|
37
48
|
}
|
|
38
49
|
}
|
|
39
50
|
}
|
|
40
|
-
SetupCommand.description = "
|
|
51
|
+
SetupCommand.description = "Start a local test setup with: Solana test validator, Photon indexer, and Light prover";
|
|
52
|
+
SetupCommand.examples = [
|
|
53
|
+
"$ light test-validator",
|
|
54
|
+
"$ light test-validator --skip-indexer",
|
|
55
|
+
"$ light test-validator --geyser-config ./config.json",
|
|
56
|
+
'$ light test-validator --validator-args "--limit-ledger-size 50000000"',
|
|
57
|
+
];
|
|
41
58
|
SetupCommand.flags = {
|
|
42
59
|
"skip-indexer": core_1.Flags.boolean({
|
|
43
60
|
description: "Runs a test validator without starting a new indexer.",
|
|
@@ -120,5 +137,14 @@ SetupCommand.flags = {
|
|
|
120
137
|
required: false,
|
|
121
138
|
default: false,
|
|
122
139
|
}),
|
|
140
|
+
"geyser-config": core_1.Flags.string({
|
|
141
|
+
description: "Path to Geyser plugin config.",
|
|
142
|
+
required: false,
|
|
143
|
+
}),
|
|
144
|
+
"validator-args": core_1.Flags.string({
|
|
145
|
+
description: "Additional arguments to pass directly to solana-test-validator. Only use if you know what you are doing.",
|
|
146
|
+
required: false,
|
|
147
|
+
exclusive: ["geyser-config"],
|
|
148
|
+
}),
|
|
123
149
|
};
|
|
124
150
|
exports.default = SetupCommand;
|
|
@@ -2,7 +2,7 @@ export declare function stopTestEnv(options: {
|
|
|
2
2
|
indexer: boolean;
|
|
3
3
|
prover: boolean;
|
|
4
4
|
}): Promise<void>;
|
|
5
|
-
export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer, prover, rpcPort, indexerPort, proverPort, gossipHost, checkPhotonVersion, photonDatabaseUrl, limitLedgerSize, proverRunMode, circuits, }: {
|
|
5
|
+
export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer, prover, rpcPort, indexerPort, proverPort, gossipHost, checkPhotonVersion, photonDatabaseUrl, limitLedgerSize, proverRunMode, circuits, geyserConfig, validatorArgs, }: {
|
|
6
6
|
additionalPrograms?: {
|
|
7
7
|
address: string;
|
|
8
8
|
path: string;
|
|
@@ -19,8 +19,10 @@ export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, in
|
|
|
19
19
|
limitLedgerSize?: number;
|
|
20
20
|
proverRunMode?: "inclusion" | "non-inclusion" | "forester" | "forester-test" | "rpc" | "full" | "full-test";
|
|
21
21
|
circuits?: string[];
|
|
22
|
+
validatorArgs?: string;
|
|
23
|
+
geyserConfig?: string;
|
|
22
24
|
}): Promise<void>;
|
|
23
|
-
export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer, prover, }?: {
|
|
25
|
+
export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer, prover, geyserConfig, validatorArgs, }?: {
|
|
24
26
|
additionalPrograms?: {
|
|
25
27
|
address: string;
|
|
26
28
|
path: string;
|
|
@@ -28,6 +30,8 @@ export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAcco
|
|
|
28
30
|
skipSystemAccounts?: boolean;
|
|
29
31
|
indexer?: boolean;
|
|
30
32
|
prover?: boolean;
|
|
33
|
+
geyserConfig?: string;
|
|
34
|
+
validatorArgs?: string;
|
|
31
35
|
}): Promise<void>;
|
|
32
36
|
export declare function programsDirPath(): string;
|
|
33
37
|
export declare function programFilePath(programName: string): string;
|
|
@@ -42,7 +46,7 @@ export declare function getSolanaArgs({ additionalPrograms, skipSystemAccounts,
|
|
|
42
46
|
gossipHost?: string;
|
|
43
47
|
downloadBinaries?: boolean;
|
|
44
48
|
}): Promise<Array<string>>;
|
|
45
|
-
export declare function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, }: {
|
|
49
|
+
export declare function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, }: {
|
|
46
50
|
additionalPrograms?: {
|
|
47
51
|
address: string;
|
|
48
52
|
path: string;
|
|
@@ -51,5 +55,7 @@ export declare function startTestValidator({ additionalPrograms, skipSystemAccou
|
|
|
51
55
|
limitLedgerSize?: number;
|
|
52
56
|
rpcPort?: number;
|
|
53
57
|
gossipHost?: string;
|
|
58
|
+
validatorArgs?: string;
|
|
59
|
+
geyserConfig?: string;
|
|
54
60
|
}): Promise<void>;
|
|
55
61
|
export declare function killTestValidator(): Promise<void>;
|
|
@@ -42,7 +42,7 @@ async function stopTestEnv(options) {
|
|
|
42
42
|
await Promise.all(killPromises);
|
|
43
43
|
console.log("All specified processes and validator stopped.");
|
|
44
44
|
}
|
|
45
|
-
async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = true, prover = true, rpcPort = 8899, indexerPort = 8784, proverPort = 3001, gossipHost = "127.0.0.1", checkPhotonVersion = true, photonDatabaseUrl, limitLedgerSize, proverRunMode, circuits, }) {
|
|
45
|
+
async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = true, prover = true, rpcPort = 8899, indexerPort = 8784, proverPort = 3001, gossipHost = "127.0.0.1", checkPhotonVersion = true, photonDatabaseUrl, limitLedgerSize, proverRunMode, circuits, geyserConfig, validatorArgs, }) {
|
|
46
46
|
// We cannot await this promise directly because it will hang the process
|
|
47
47
|
startTestValidator({
|
|
48
48
|
additionalPrograms,
|
|
@@ -50,6 +50,8 @@ async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = t
|
|
|
50
50
|
limitLedgerSize,
|
|
51
51
|
rpcPort,
|
|
52
52
|
gossipHost,
|
|
53
|
+
validatorArgs,
|
|
54
|
+
geyserConfig,
|
|
53
55
|
});
|
|
54
56
|
await (0, process_1.waitForServers)([{ port: rpcPort, path: "/health" }]);
|
|
55
57
|
await (0, process_1.confirmServerStability)(`http://127.0.0.1:${rpcPort}/health`);
|
|
@@ -66,7 +68,7 @@ async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = t
|
|
|
66
68
|
await (0, processProverServer_1.startProver)(proverPort, proverRunMode, circuits);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer = false, prover = false, } = {}) {
|
|
71
|
+
async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer = false, prover = false, geyserConfig, validatorArgs, } = {}) {
|
|
70
72
|
try {
|
|
71
73
|
const anchorProvider = await (0, utils_1.setAnchorProvider)();
|
|
72
74
|
// this request will fail if there is no local test validator running
|
|
@@ -80,6 +82,8 @@ async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, ind
|
|
|
80
82
|
skipSystemAccounts,
|
|
81
83
|
indexer,
|
|
82
84
|
prover,
|
|
85
|
+
geyserConfig,
|
|
86
|
+
validatorArgs,
|
|
83
87
|
});
|
|
84
88
|
}
|
|
85
89
|
}
|
|
@@ -181,7 +185,7 @@ async function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedg
|
|
|
181
185
|
}
|
|
182
186
|
return solanaArgs;
|
|
183
187
|
}
|
|
184
|
-
async function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, }) {
|
|
188
|
+
async function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, }) {
|
|
185
189
|
const command = "solana-test-validator";
|
|
186
190
|
const solanaArgs = await getSolanaArgs({
|
|
187
191
|
additionalPrograms,
|
|
@@ -192,6 +196,14 @@ async function startTestValidator({ additionalPrograms, skipSystemAccounts, limi
|
|
|
192
196
|
});
|
|
193
197
|
await killTestValidator();
|
|
194
198
|
await new Promise((r) => setTimeout(r, 1000));
|
|
199
|
+
// Add geyser config if provided
|
|
200
|
+
if (geyserConfig) {
|
|
201
|
+
solanaArgs.push("--geyser-plugin-config", geyserConfig);
|
|
202
|
+
}
|
|
203
|
+
// Add custom validator args last
|
|
204
|
+
if (validatorArgs) {
|
|
205
|
+
solanaArgs.push(...validatorArgs.split(" "));
|
|
206
|
+
}
|
|
195
207
|
console.log("Starting test validator...");
|
|
196
208
|
await (0, process_1.executeCommand)({
|
|
197
209
|
command,
|
package/oclif.manifest.json
CHANGED
|
@@ -1,190 +1,206 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"
|
|
3
|
+
"balance": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
6
|
"examples": [
|
|
7
|
-
"$ light
|
|
7
|
+
"$ light balance --mint=<ADDRESS> --owner=<ADDRESS>"
|
|
8
8
|
],
|
|
9
9
|
"flags": {
|
|
10
|
-
"
|
|
11
|
-
"description": "
|
|
12
|
-
"name": "
|
|
13
|
-
"required":
|
|
10
|
+
"owner": {
|
|
11
|
+
"description": "Address of the compressed token owner.",
|
|
12
|
+
"name": "owner",
|
|
13
|
+
"required": true,
|
|
14
14
|
"hasDynamicHelp": false,
|
|
15
15
|
"multiple": false,
|
|
16
16
|
"type": "option"
|
|
17
17
|
},
|
|
18
18
|
"mint": {
|
|
19
|
-
"description": "
|
|
19
|
+
"description": "Mint address of the compressed token account.",
|
|
20
20
|
"name": "mint",
|
|
21
21
|
"required": true,
|
|
22
22
|
"hasDynamicHelp": false,
|
|
23
23
|
"multiple": false,
|
|
24
24
|
"type": "option"
|
|
25
|
-
},
|
|
26
|
-
"to": {
|
|
27
|
-
"description": "Specify the recipient address.",
|
|
28
|
-
"name": "to",
|
|
29
|
-
"required": true,
|
|
30
|
-
"hasDynamicHelp": false,
|
|
31
|
-
"multiple": false,
|
|
32
|
-
"type": "option"
|
|
33
|
-
},
|
|
34
|
-
"amount": {
|
|
35
|
-
"description": "Amount to mint, in tokens.",
|
|
36
|
-
"name": "amount",
|
|
37
|
-
"required": true,
|
|
38
|
-
"hasDynamicHelp": false,
|
|
39
|
-
"multiple": false,
|
|
40
|
-
"type": "option"
|
|
41
25
|
}
|
|
42
26
|
},
|
|
43
27
|
"hasDynamicHelp": false,
|
|
44
28
|
"hiddenAliases": [],
|
|
45
|
-
"id": "
|
|
29
|
+
"id": "balance",
|
|
46
30
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
47
31
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
48
32
|
"pluginType": "core",
|
|
49
33
|
"strict": true,
|
|
50
|
-
"summary": "
|
|
34
|
+
"summary": "Get balance",
|
|
51
35
|
"enableJsonFlag": false,
|
|
52
36
|
"isESM": false,
|
|
53
37
|
"relativePath": [
|
|
54
38
|
"dist",
|
|
55
39
|
"commands",
|
|
56
|
-
"
|
|
40
|
+
"balance",
|
|
57
41
|
"index.js"
|
|
58
42
|
]
|
|
59
43
|
},
|
|
60
|
-
"
|
|
44
|
+
"approve-and-mint-to": {
|
|
61
45
|
"aliases": [],
|
|
62
46
|
"args": {},
|
|
63
47
|
"examples": [
|
|
64
|
-
"$ light
|
|
48
|
+
"$ light approve-and-mint-to --mint PublicKey --to PublicKey --amount 1000"
|
|
65
49
|
],
|
|
66
50
|
"flags": {
|
|
67
|
-
"
|
|
68
|
-
"description": "
|
|
69
|
-
"name": "
|
|
70
|
-
"required":
|
|
51
|
+
"mint-authority": {
|
|
52
|
+
"description": "Specify the filepath of the mint authority keypair. Defaults to your local solana wallet.",
|
|
53
|
+
"name": "mint-authority",
|
|
54
|
+
"required": false,
|
|
71
55
|
"hasDynamicHelp": false,
|
|
72
56
|
"multiple": false,
|
|
73
57
|
"type": "option"
|
|
74
58
|
},
|
|
75
59
|
"mint": {
|
|
76
|
-
"description": "
|
|
60
|
+
"description": "Specify the mint address.",
|
|
77
61
|
"name": "mint",
|
|
78
62
|
"required": true,
|
|
79
63
|
"hasDynamicHelp": false,
|
|
80
64
|
"multiple": false,
|
|
81
65
|
"type": "option"
|
|
66
|
+
},
|
|
67
|
+
"to": {
|
|
68
|
+
"description": "Specify the recipient address.",
|
|
69
|
+
"name": "to",
|
|
70
|
+
"required": true,
|
|
71
|
+
"hasDynamicHelp": false,
|
|
72
|
+
"multiple": false,
|
|
73
|
+
"type": "option"
|
|
74
|
+
},
|
|
75
|
+
"amount": {
|
|
76
|
+
"description": "Amount to mint, in tokens.",
|
|
77
|
+
"name": "amount",
|
|
78
|
+
"required": true,
|
|
79
|
+
"hasDynamicHelp": false,
|
|
80
|
+
"multiple": false,
|
|
81
|
+
"type": "option"
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"hasDynamicHelp": false,
|
|
85
85
|
"hiddenAliases": [],
|
|
86
|
-
"id": "
|
|
86
|
+
"id": "approve-and-mint-to",
|
|
87
87
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
88
88
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
89
89
|
"pluginType": "core",
|
|
90
90
|
"strict": true,
|
|
91
|
-
"summary": "
|
|
91
|
+
"summary": "Mint tokens to a compressed account via external mint authority",
|
|
92
92
|
"enableJsonFlag": false,
|
|
93
93
|
"isESM": false,
|
|
94
94
|
"relativePath": [
|
|
95
95
|
"dist",
|
|
96
96
|
"commands",
|
|
97
|
-
"
|
|
97
|
+
"approve-and-mint-to",
|
|
98
98
|
"index.js"
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
|
-
"
|
|
101
|
+
"config:config": {
|
|
102
102
|
"aliases": [],
|
|
103
103
|
"args": {},
|
|
104
|
+
"description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
|
|
104
105
|
"examples": [
|
|
105
|
-
"$ light
|
|
106
|
+
"$ light config --solanaRpcUrl https://solana-api.example.com"
|
|
106
107
|
],
|
|
107
108
|
"flags": {
|
|
108
|
-
"
|
|
109
|
-
"description": "
|
|
110
|
-
"name": "
|
|
111
|
-
"required": true,
|
|
109
|
+
"solanaRpcUrl": {
|
|
110
|
+
"description": "Solana RPC url",
|
|
111
|
+
"name": "solanaRpcUrl",
|
|
112
112
|
"hasDynamicHelp": false,
|
|
113
113
|
"multiple": false,
|
|
114
114
|
"type": "option"
|
|
115
115
|
},
|
|
116
|
-
"
|
|
117
|
-
"description": "
|
|
118
|
-
"name": "
|
|
119
|
-
"
|
|
116
|
+
"indexerUrl": {
|
|
117
|
+
"description": "Indexer url",
|
|
118
|
+
"name": "indexerUrl",
|
|
119
|
+
"hasDynamicHelp": false,
|
|
120
|
+
"multiple": false,
|
|
121
|
+
"type": "option"
|
|
122
|
+
},
|
|
123
|
+
"proverUrl": {
|
|
124
|
+
"description": "Prover url",
|
|
125
|
+
"name": "proverUrl",
|
|
120
126
|
"hasDynamicHelp": false,
|
|
121
127
|
"multiple": false,
|
|
122
128
|
"type": "option"
|
|
129
|
+
},
|
|
130
|
+
"get": {
|
|
131
|
+
"description": "Gets the current config values",
|
|
132
|
+
"name": "get",
|
|
133
|
+
"required": false,
|
|
134
|
+
"allowNo": false,
|
|
135
|
+
"type": "boolean"
|
|
123
136
|
}
|
|
124
137
|
},
|
|
125
138
|
"hasDynamicHelp": false,
|
|
126
139
|
"hiddenAliases": [],
|
|
127
|
-
"id": "
|
|
140
|
+
"id": "config:config",
|
|
128
141
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
129
142
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
130
143
|
"pluginType": "core",
|
|
131
144
|
"strict": true,
|
|
132
|
-
"summary": "Compress SOL.",
|
|
133
145
|
"enableJsonFlag": false,
|
|
134
146
|
"isESM": false,
|
|
135
147
|
"relativePath": [
|
|
136
148
|
"dist",
|
|
137
149
|
"commands",
|
|
138
|
-
"
|
|
150
|
+
"config",
|
|
139
151
|
"index.js"
|
|
140
152
|
]
|
|
141
153
|
},
|
|
142
|
-
"
|
|
154
|
+
"config": {
|
|
143
155
|
"aliases": [],
|
|
144
156
|
"args": {},
|
|
157
|
+
"description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
|
|
145
158
|
"examples": [
|
|
146
|
-
"$ light
|
|
159
|
+
"$ light config --solanaRpcUrl https://solana-api.example.com"
|
|
147
160
|
],
|
|
148
161
|
"flags": {
|
|
149
|
-
"
|
|
150
|
-
"description": "
|
|
151
|
-
"name": "
|
|
152
|
-
"required": true,
|
|
162
|
+
"solanaRpcUrl": {
|
|
163
|
+
"description": "Solana RPC url",
|
|
164
|
+
"name": "solanaRpcUrl",
|
|
153
165
|
"hasDynamicHelp": false,
|
|
154
166
|
"multiple": false,
|
|
155
167
|
"type": "option"
|
|
156
168
|
},
|
|
157
|
-
"
|
|
158
|
-
"description": "
|
|
159
|
-
"name": "
|
|
160
|
-
"required": true,
|
|
169
|
+
"indexerUrl": {
|
|
170
|
+
"description": "Indexer url",
|
|
171
|
+
"name": "indexerUrl",
|
|
161
172
|
"hasDynamicHelp": false,
|
|
162
173
|
"multiple": false,
|
|
163
174
|
"type": "option"
|
|
164
175
|
},
|
|
165
|
-
"
|
|
166
|
-
"description": "
|
|
167
|
-
"name": "
|
|
168
|
-
"required": true,
|
|
176
|
+
"proverUrl": {
|
|
177
|
+
"description": "Prover url",
|
|
178
|
+
"name": "proverUrl",
|
|
169
179
|
"hasDynamicHelp": false,
|
|
170
180
|
"multiple": false,
|
|
171
181
|
"type": "option"
|
|
182
|
+
},
|
|
183
|
+
"get": {
|
|
184
|
+
"description": "Gets the current config values",
|
|
185
|
+
"name": "get",
|
|
186
|
+
"required": false,
|
|
187
|
+
"allowNo": false,
|
|
188
|
+
"type": "boolean"
|
|
172
189
|
}
|
|
173
190
|
},
|
|
174
191
|
"hasDynamicHelp": false,
|
|
175
192
|
"hiddenAliases": [],
|
|
176
|
-
"id": "
|
|
193
|
+
"id": "config",
|
|
177
194
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
178
195
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
179
196
|
"pluginType": "core",
|
|
180
197
|
"strict": true,
|
|
181
|
-
"summary": "Compress SPL tokens.",
|
|
182
198
|
"enableJsonFlag": false,
|
|
183
199
|
"isESM": false,
|
|
184
200
|
"relativePath": [
|
|
185
201
|
"dist",
|
|
186
202
|
"commands",
|
|
187
|
-
"
|
|
203
|
+
"config",
|
|
188
204
|
"index.js"
|
|
189
205
|
]
|
|
190
206
|
},
|
|
@@ -271,109 +287,93 @@
|
|
|
271
287
|
"index.js"
|
|
272
288
|
]
|
|
273
289
|
},
|
|
274
|
-
"
|
|
290
|
+
"compress-sol": {
|
|
275
291
|
"aliases": [],
|
|
276
292
|
"args": {},
|
|
277
|
-
"description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
|
|
278
293
|
"examples": [
|
|
279
|
-
"$ light
|
|
294
|
+
"$ light compress-sol --to PublicKey --amount 10"
|
|
280
295
|
],
|
|
281
296
|
"flags": {
|
|
282
|
-
"
|
|
283
|
-
"description": "
|
|
284
|
-
"name": "
|
|
285
|
-
"
|
|
286
|
-
"multiple": false,
|
|
287
|
-
"type": "option"
|
|
288
|
-
},
|
|
289
|
-
"indexerUrl": {
|
|
290
|
-
"description": "Indexer url",
|
|
291
|
-
"name": "indexerUrl",
|
|
297
|
+
"to": {
|
|
298
|
+
"description": "Specify the recipient address.",
|
|
299
|
+
"name": "to",
|
|
300
|
+
"required": true,
|
|
292
301
|
"hasDynamicHelp": false,
|
|
293
302
|
"multiple": false,
|
|
294
303
|
"type": "option"
|
|
295
304
|
},
|
|
296
|
-
"
|
|
297
|
-
"description": "
|
|
298
|
-
"name": "
|
|
305
|
+
"amount": {
|
|
306
|
+
"description": "Amount to compress, in lamports.",
|
|
307
|
+
"name": "amount",
|
|
308
|
+
"required": true,
|
|
299
309
|
"hasDynamicHelp": false,
|
|
300
310
|
"multiple": false,
|
|
301
311
|
"type": "option"
|
|
302
|
-
},
|
|
303
|
-
"get": {
|
|
304
|
-
"description": "Gets the current config values",
|
|
305
|
-
"name": "get",
|
|
306
|
-
"required": false,
|
|
307
|
-
"allowNo": false,
|
|
308
|
-
"type": "boolean"
|
|
309
312
|
}
|
|
310
313
|
},
|
|
311
314
|
"hasDynamicHelp": false,
|
|
312
315
|
"hiddenAliases": [],
|
|
313
|
-
"id": "
|
|
316
|
+
"id": "compress-sol",
|
|
314
317
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
315
318
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
316
319
|
"pluginType": "core",
|
|
317
320
|
"strict": true,
|
|
321
|
+
"summary": "Compress SOL.",
|
|
318
322
|
"enableJsonFlag": false,
|
|
319
323
|
"isESM": false,
|
|
320
324
|
"relativePath": [
|
|
321
325
|
"dist",
|
|
322
326
|
"commands",
|
|
323
|
-
"
|
|
327
|
+
"compress-sol",
|
|
324
328
|
"index.js"
|
|
325
329
|
]
|
|
326
330
|
},
|
|
327
|
-
"
|
|
331
|
+
"compress-spl": {
|
|
328
332
|
"aliases": [],
|
|
329
333
|
"args": {},
|
|
330
|
-
"description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
|
|
331
334
|
"examples": [
|
|
332
|
-
"$ light
|
|
335
|
+
"$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
|
|
333
336
|
],
|
|
334
337
|
"flags": {
|
|
335
|
-
"
|
|
336
|
-
"description": "
|
|
337
|
-
"name": "
|
|
338
|
+
"mint": {
|
|
339
|
+
"description": "Specify the mint address.",
|
|
340
|
+
"name": "mint",
|
|
341
|
+
"required": true,
|
|
338
342
|
"hasDynamicHelp": false,
|
|
339
343
|
"multiple": false,
|
|
340
344
|
"type": "option"
|
|
341
345
|
},
|
|
342
|
-
"
|
|
343
|
-
"description": "
|
|
344
|
-
"name": "
|
|
346
|
+
"to": {
|
|
347
|
+
"description": "Specify the recipient address (owner of destination compressed token account).",
|
|
348
|
+
"name": "to",
|
|
349
|
+
"required": true,
|
|
345
350
|
"hasDynamicHelp": false,
|
|
346
351
|
"multiple": false,
|
|
347
352
|
"type": "option"
|
|
348
353
|
},
|
|
349
|
-
"
|
|
350
|
-
"description": "
|
|
351
|
-
"name": "
|
|
354
|
+
"amount": {
|
|
355
|
+
"description": "Amount to compress, in tokens.",
|
|
356
|
+
"name": "amount",
|
|
357
|
+
"required": true,
|
|
352
358
|
"hasDynamicHelp": false,
|
|
353
359
|
"multiple": false,
|
|
354
360
|
"type": "option"
|
|
355
|
-
},
|
|
356
|
-
"get": {
|
|
357
|
-
"description": "Gets the current config values",
|
|
358
|
-
"name": "get",
|
|
359
|
-
"required": false,
|
|
360
|
-
"allowNo": false,
|
|
361
|
-
"type": "boolean"
|
|
362
361
|
}
|
|
363
362
|
},
|
|
364
363
|
"hasDynamicHelp": false,
|
|
365
364
|
"hiddenAliases": [],
|
|
366
|
-
"id": "
|
|
365
|
+
"id": "compress-spl",
|
|
367
366
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
368
367
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
369
368
|
"pluginType": "core",
|
|
370
369
|
"strict": true,
|
|
370
|
+
"summary": "Compress SPL tokens.",
|
|
371
371
|
"enableJsonFlag": false,
|
|
372
372
|
"isESM": false,
|
|
373
373
|
"relativePath": [
|
|
374
374
|
"dist",
|
|
375
375
|
"commands",
|
|
376
|
-
"
|
|
376
|
+
"compress-spl",
|
|
377
377
|
"index.js"
|
|
378
378
|
]
|
|
379
379
|
},
|
|
@@ -662,7 +662,13 @@
|
|
|
662
662
|
"test-validator": {
|
|
663
663
|
"aliases": [],
|
|
664
664
|
"args": {},
|
|
665
|
-
"description": "
|
|
665
|
+
"description": "Start a local test setup with: Solana test validator, Photon indexer, and Light prover",
|
|
666
|
+
"examples": [
|
|
667
|
+
"$ light test-validator",
|
|
668
|
+
"$ light test-validator --skip-indexer",
|
|
669
|
+
"$ light test-validator --geyser-config ./config.json",
|
|
670
|
+
"$ light test-validator --validator-args \"--limit-ledger-size 50000000\""
|
|
671
|
+
],
|
|
666
672
|
"flags": {
|
|
667
673
|
"skip-indexer": {
|
|
668
674
|
"description": "Runs a test validator without starting a new indexer.",
|
|
@@ -797,6 +803,25 @@
|
|
|
797
803
|
"required": false,
|
|
798
804
|
"allowNo": false,
|
|
799
805
|
"type": "boolean"
|
|
806
|
+
},
|
|
807
|
+
"geyser-config": {
|
|
808
|
+
"description": "Path to Geyser plugin config.",
|
|
809
|
+
"name": "geyser-config",
|
|
810
|
+
"required": false,
|
|
811
|
+
"hasDynamicHelp": false,
|
|
812
|
+
"multiple": false,
|
|
813
|
+
"type": "option"
|
|
814
|
+
},
|
|
815
|
+
"validator-args": {
|
|
816
|
+
"description": "Additional arguments to pass directly to solana-test-validator. Only use if you know what you are doing.",
|
|
817
|
+
"exclusive": [
|
|
818
|
+
"geyser-config"
|
|
819
|
+
],
|
|
820
|
+
"name": "validator-args",
|
|
821
|
+
"required": false,
|
|
822
|
+
"hasDynamicHelp": false,
|
|
823
|
+
"multiple": false,
|
|
824
|
+
"type": "option"
|
|
800
825
|
}
|
|
801
826
|
},
|
|
802
827
|
"hasDynamicHelp": false,
|
|
@@ -873,5 +898,5 @@
|
|
|
873
898
|
]
|
|
874
899
|
}
|
|
875
900
|
},
|
|
876
|
-
"version": "0.
|
|
901
|
+
"version": "0.22.0"
|
|
877
902
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/zk-compression-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "ZK Compression: Secure Scaling on Solana",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
{
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"@types/node": "^20.12.8",
|
|
70
70
|
"@types/tar": "^6.1.12",
|
|
71
71
|
"@types/which": "^3.0.3",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
73
|
-
"@typescript-eslint/parser": "^7.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
73
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
74
74
|
"chai": "^4.4.1",
|
|
75
|
-
"eslint": "
|
|
75
|
+
"eslint": "8.57.0",
|
|
76
76
|
"eslint-config-oclif": "5.1.1",
|
|
77
77
|
"eslint-config-oclif-typescript": "3.1.4",
|
|
78
78
|
"eslint-config-prettier": "9.1.0",
|
|
@@ -130,19 +130,19 @@
|
|
|
130
130
|
"format:check": "pnpm prettier \"src/**/*{ts,js}\" \"test/**/*.{ts,js}\" --check",
|
|
131
131
|
"lint": "eslint . --ext .ts",
|
|
132
132
|
"lint:fix": "eslint . --fix",
|
|
133
|
-
"test-utils": "mocha test/utils/index.test.ts -t 10000000 --exit",
|
|
134
|
-
"test-config": "mocha test/commands/config/index.test.ts -t 10000000 --exit",
|
|
135
|
-
"test-create-mint": "mocha test/commands/create-mint/index.test.ts -t 10000000 --exit",
|
|
136
|
-
"test-merge-token-accounts": "mocha test/commands/merge-token-accounts/index.test.ts -t 10000000 --exit",
|
|
137
|
-
"test-create-token-pool": "mocha test/commands/create-token-pool/index.test.ts -t 10000000 --exit",
|
|
138
|
-
"test-approve-and-mint-to": "mocha test/commands/approve-and-mint-to/index.test.ts -t 10000000 --exit",
|
|
139
|
-
"test-mint-to": "mocha test/commands/mint-to/index.test.ts -t 10000000 --exit",
|
|
140
|
-
"test-transfer": "mocha test/commands/transfer/index.test.ts -t 10000000 --exit",
|
|
141
|
-
"test-balance": "mocha test/commands/balance/index.test.ts -t 10000000 --exit",
|
|
142
|
-
"test-compress-sol": "mocha test/commands/compress-sol/index.test.ts -t 10000000 --exit",
|
|
143
|
-
"test-decompress-sol": "mocha test/commands/decompress-sol/index.test.ts -t 10000000 --exit",
|
|
144
|
-
"test-compress-spl": "mocha test/commands/compress-spl/index.test.ts -t 10000000 --exit",
|
|
145
|
-
"test-decompress-spl": "mocha test/commands/decompress-spl/index.test.ts -t 10000000 --exit",
|
|
133
|
+
"test-utils": "mocha ./test/utils/index.test.ts -t 10000000 --exit",
|
|
134
|
+
"test-config": "mocha ./test/commands/config/index.test.ts -t 10000000 --exit",
|
|
135
|
+
"test-create-mint": "mocha ./test/commands/create-mint/index.test.ts -t 10000000 --exit",
|
|
136
|
+
"test-merge-token-accounts": "mocha ./test/commands/merge-token-accounts/index.test.ts -t 10000000 --exit",
|
|
137
|
+
"test-create-token-pool": "mocha ./test/commands/create-token-pool/index.test.ts -t 10000000 --exit",
|
|
138
|
+
"test-approve-and-mint-to": "mocha ./test/commands/approve-and-mint-to/index.test.ts -t 10000000 --exit",
|
|
139
|
+
"test-mint-to": "mocha ./test/commands/mint-to/index.test.ts -t 10000000 --exit",
|
|
140
|
+
"test-transfer": "mocha ./test/commands/transfer/index.test.ts -t 10000000 --exit",
|
|
141
|
+
"test-balance": "mocha ./test/commands/balance/index.test.ts -t 10000000 --exit",
|
|
142
|
+
"test-compress-sol": "mocha ./test/commands/compress-sol/index.test.ts -t 10000000 --exit",
|
|
143
|
+
"test-decompress-sol": "mocha ./test/commands/decompress-sol/index.test.ts -t 10000000 --exit",
|
|
144
|
+
"test-compress-spl": "mocha ./test/commands/compress-spl/index.test.ts -t 10000000 --exit",
|
|
145
|
+
"test-decompress-spl": "mocha ./test/commands/decompress-spl/index.test.ts -t 10000000 --exit",
|
|
146
146
|
"kill": "killall solana-test-validator || true && killall solana-test-val || true && sleep 1",
|
|
147
147
|
"test-cli": "pnpm test-config && pnpm kill",
|
|
148
148
|
"test": "pnpm kill && pnpm test-cli && pnpm test-utils && pnpm test-create-mint && pnpm test-mint-to && pnpm test-transfer && pnpm test-merge-token-accounts && pnpm test-create-token-pool && pnpm test-compress-spl && pnpm test-decompress-spl && pnpm test-balance && pnpm test-compress-sol && pnpm test-decompress-sol && pnpm test-approve-and-mint-to",
|