@lightprotocol/zk-compression-cli 0.27.1-alpha.8 → 0.28.0-beta.1
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/account_compression.so +0 -0
- package/bin/light_compressed_token.so +0 -0
- package/bin/light_registry.so +0 -0
- package/bin/light_system_program_pinocchio.so +0 -0
- package/dist/commands/test-validator/index.d.ts +5 -0
- package/dist/commands/test-validator/index.js +35 -9
- package/dist/utils/downloadProverBinary.js +3 -4
- package/dist/utils/initTestEnv.d.ts +18 -3
- package/dist/utils/initTestEnv.js +26 -19
- package/dist/utils/process.d.ts +1 -1
- package/dist/utils/process.js +2 -2
- package/dist/utils/processProverServer.js +1 -0
- package/dist/utils/proverVersion.generated.d.ts +1 -0
- package/dist/utils/proverVersion.generated.js +5 -0
- package/oclif.manifest.json +89 -79
- package/package.json +6 -43
|
Binary file
|
|
Binary file
|
package/bin/light_registry.so
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -18,6 +18,7 @@ declare class SetupCommand extends Command {
|
|
|
18
18
|
"geyser-config": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
19
|
"validator-args": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
20
|
"sbf-program": import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
"upgradeable-program": import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
22
|
devnet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
23
|
mainnet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
24
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -26,6 +27,10 @@ declare class SetupCommand extends Command {
|
|
|
26
27
|
validatePrograms(programs: {
|
|
27
28
|
address: string;
|
|
28
29
|
path: string;
|
|
30
|
+
}[], upgradeablePrograms: {
|
|
31
|
+
address: string;
|
|
32
|
+
path: string;
|
|
33
|
+
upgradeAuthority: string;
|
|
29
34
|
}[]): void;
|
|
30
35
|
run(): Promise<void>;
|
|
31
36
|
}
|
|
@@ -15,6 +15,7 @@ class SetupCommand extends core_1.Command {
|
|
|
15
15
|
"$ light test-validator --geyser-config ./config.json",
|
|
16
16
|
'$ light test-validator --validator-args "--limit-ledger-size 50000000"',
|
|
17
17
|
"$ light test-validator --sbf-program <address> <path/program>",
|
|
18
|
+
"$ light test-validator --upgradeable-program <address> <path/program> <upgrade_authority>",
|
|
18
19
|
"$ light test-validator --devnet",
|
|
19
20
|
"$ light test-validator --mainnet",
|
|
20
21
|
];
|
|
@@ -94,6 +95,12 @@ class SetupCommand extends core_1.Command {
|
|
|
94
95
|
multiple: true,
|
|
95
96
|
summary: "Usage: --sbf-program <address> <path/program_name.so>",
|
|
96
97
|
}),
|
|
98
|
+
"upgradeable-program": core_1.Flags.string({
|
|
99
|
+
description: "Add an upgradeable SBF program to the genesis configuration. Required for programs that need compressible config initialization. If the ledger already exists then this parameter is silently ignored.",
|
|
100
|
+
required: false,
|
|
101
|
+
multiple: true,
|
|
102
|
+
summary: "Usage: --upgradeable-program <address> <path/program_name.so> <upgrade_authority>",
|
|
103
|
+
}),
|
|
97
104
|
devnet: core_1.Flags.boolean({
|
|
98
105
|
description: "Clone Light Protocol programs and accounts from devnet instead of loading local binaries.",
|
|
99
106
|
default: false,
|
|
@@ -114,10 +121,14 @@ class SetupCommand extends core_1.Command {
|
|
|
114
121
|
default: false,
|
|
115
122
|
}),
|
|
116
123
|
};
|
|
117
|
-
validatePrograms(programs) {
|
|
118
|
-
// Check for duplicate addresses among provided programs
|
|
124
|
+
validatePrograms(programs, upgradeablePrograms) {
|
|
125
|
+
// Check for duplicate addresses among all provided programs
|
|
119
126
|
const addresses = new Set();
|
|
120
|
-
|
|
127
|
+
const allPrograms = [
|
|
128
|
+
...programs.map((p) => ({ ...p, type: "sbf" })),
|
|
129
|
+
...upgradeablePrograms.map((p) => ({ ...p, type: "upgradeable" })),
|
|
130
|
+
];
|
|
131
|
+
for (const program of allPrograms) {
|
|
121
132
|
if (addresses.has(program.address)) {
|
|
122
133
|
this.error(`Duplicate program address detected: ${program.address}`);
|
|
123
134
|
}
|
|
@@ -160,20 +171,35 @@ class SetupCommand extends core_1.Command {
|
|
|
160
171
|
this.log("\nTest validator stopped successfully \x1b[32m✔\x1b[0m");
|
|
161
172
|
}
|
|
162
173
|
else {
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
// Parse --sbf-program flags (2 arguments each: address, path)
|
|
175
|
+
const rawSbfValues = flags["sbf-program"] || [];
|
|
176
|
+
if (rawSbfValues.length % 2 !== 0) {
|
|
165
177
|
this.error("Each --sbf-program flag must have exactly two arguments");
|
|
166
178
|
}
|
|
167
179
|
const programs = [];
|
|
168
|
-
for (let i = 0; i <
|
|
180
|
+
for (let i = 0; i < rawSbfValues.length; i += 2) {
|
|
169
181
|
programs.push({
|
|
170
|
-
address:
|
|
171
|
-
path:
|
|
182
|
+
address: rawSbfValues[i],
|
|
183
|
+
path: rawSbfValues[i + 1],
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// Parse --upgradeable-program flags (3 arguments each: address, path, upgrade_authority)
|
|
187
|
+
const rawUpgradeableValues = flags["upgradeable-program"] || [];
|
|
188
|
+
if (rawUpgradeableValues.length % 3 !== 0) {
|
|
189
|
+
this.error("Each --upgradeable-program flag must have exactly three arguments: <address> <path> <upgrade_authority>");
|
|
190
|
+
}
|
|
191
|
+
const upgradeablePrograms = [];
|
|
192
|
+
for (let i = 0; i < rawUpgradeableValues.length; i += 3) {
|
|
193
|
+
upgradeablePrograms.push({
|
|
194
|
+
address: rawUpgradeableValues[i],
|
|
195
|
+
path: rawUpgradeableValues[i + 1],
|
|
196
|
+
upgradeAuthority: rawUpgradeableValues[i + 2],
|
|
172
197
|
});
|
|
173
198
|
}
|
|
174
|
-
this.validatePrograms(programs);
|
|
199
|
+
this.validatePrograms(programs, upgradeablePrograms);
|
|
175
200
|
await (0, initTestEnv_1.initTestEnv)({
|
|
176
201
|
additionalPrograms: programs,
|
|
202
|
+
upgradeablePrograms: upgradeablePrograms,
|
|
177
203
|
checkPhotonVersion: !flags["relax-indexer-version-constraint"],
|
|
178
204
|
indexer: !flags["skip-indexer"],
|
|
179
205
|
limitLedgerSize: flags["limit-ledger-size"],
|
|
@@ -8,9 +8,8 @@ const path_1 = tslib_1.__importDefault(require("path"));
|
|
|
8
8
|
const https_1 = tslib_1.__importDefault(require("https"));
|
|
9
9
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
10
10
|
const promises_1 = require("stream/promises");
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const GITHUB_RELEASES_BASE_URL = `https://github.com/Lightprotocol/light-protocol/releases/download/light-prover-v${PROVER_RELEASE_TAG}`;
|
|
11
|
+
const proverVersion_generated_1 = require("./proverVersion.generated");
|
|
12
|
+
const GITHUB_RELEASES_BASE_URL = `https://github.com/Lightprotocol/light-protocol/releases/download/light-prover-v${proverVersion_generated_1.PROVER_VERSION}`;
|
|
14
13
|
const MAX_REDIRECTS = 10;
|
|
15
14
|
async function downloadProverBinary(binaryPath, binaryName, options = {}) {
|
|
16
15
|
const { maxRetries = 3, retryDelay = 2000 } = options;
|
|
@@ -104,5 +103,5 @@ async function downloadFile(url, outputPath, redirectDepth = 0) {
|
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
105
|
function getProverVersion() {
|
|
107
|
-
return
|
|
106
|
+
return proverVersion_generated_1.PROVER_VERSION;
|
|
108
107
|
}
|
|
@@ -9,11 +9,16 @@ export declare function stopTestEnv(options: {
|
|
|
9
9
|
indexer: boolean;
|
|
10
10
|
prover: boolean;
|
|
11
11
|
}): Promise<void>;
|
|
12
|
-
export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer, prover, rpcPort, indexerPort, proverPort, gossipHost, checkPhotonVersion, photonDatabaseUrl, limitLedgerSize, geyserConfig, validatorArgs, cloneNetwork, verbose, skipReset, }: {
|
|
12
|
+
export declare function initTestEnv({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, indexer, prover, rpcPort, indexerPort, proverPort, gossipHost, checkPhotonVersion, photonDatabaseUrl, limitLedgerSize, geyserConfig, validatorArgs, cloneNetwork, verbose, skipReset, }: {
|
|
13
13
|
additionalPrograms?: {
|
|
14
14
|
address: string;
|
|
15
15
|
path: string;
|
|
16
16
|
}[];
|
|
17
|
+
upgradeablePrograms?: {
|
|
18
|
+
address: string;
|
|
19
|
+
path: string;
|
|
20
|
+
upgradeAuthority: string;
|
|
21
|
+
}[];
|
|
17
22
|
skipSystemAccounts?: boolean;
|
|
18
23
|
indexer: boolean;
|
|
19
24
|
prover: boolean;
|
|
@@ -43,11 +48,16 @@ export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAcco
|
|
|
43
48
|
}): Promise<void>;
|
|
44
49
|
export declare function programsDirPath(): string;
|
|
45
50
|
export declare function programFilePath(programName: string): string;
|
|
46
|
-
export declare function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, downloadBinaries, cloneNetwork, verbose, skipReset, }: {
|
|
51
|
+
export declare function getSolanaArgs({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, downloadBinaries, cloneNetwork, verbose, skipReset, }: {
|
|
47
52
|
additionalPrograms?: {
|
|
48
53
|
address: string;
|
|
49
54
|
path: string;
|
|
50
55
|
}[];
|
|
56
|
+
upgradeablePrograms?: {
|
|
57
|
+
address: string;
|
|
58
|
+
path: string;
|
|
59
|
+
upgradeAuthority: string;
|
|
60
|
+
}[];
|
|
51
61
|
skipSystemAccounts?: boolean;
|
|
52
62
|
limitLedgerSize?: number;
|
|
53
63
|
rpcPort?: number;
|
|
@@ -57,11 +67,16 @@ export declare function getSolanaArgs({ additionalPrograms, skipSystemAccounts,
|
|
|
57
67
|
verbose?: boolean;
|
|
58
68
|
skipReset?: boolean;
|
|
59
69
|
}): Promise<Array<string>>;
|
|
60
|
-
export declare function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, cloneNetwork, verbose, skipReset, }: {
|
|
70
|
+
export declare function startTestValidator({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, cloneNetwork, verbose, skipReset, }: {
|
|
61
71
|
additionalPrograms?: {
|
|
62
72
|
address: string;
|
|
63
73
|
path: string;
|
|
64
74
|
}[];
|
|
75
|
+
upgradeablePrograms?: {
|
|
76
|
+
address: string;
|
|
77
|
+
path: string;
|
|
78
|
+
upgradeAuthority: string;
|
|
79
|
+
}[];
|
|
65
80
|
skipSystemAccounts?: boolean;
|
|
66
81
|
limitLedgerSize?: number;
|
|
67
82
|
rpcPort?: number;
|
|
@@ -103,10 +103,11 @@ async function stopTestEnv(options) {
|
|
|
103
103
|
await Promise.all(killPromises);
|
|
104
104
|
console.log("All specified processes and validator stopped.");
|
|
105
105
|
}
|
|
106
|
-
async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = true, prover = true, rpcPort = 8899, indexerPort = 8784, proverPort = 3001, gossipHost = "127.0.0.1", checkPhotonVersion = true, photonDatabaseUrl, limitLedgerSize, geyserConfig, validatorArgs, cloneNetwork, verbose, skipReset, }) {
|
|
106
|
+
async function initTestEnv({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, indexer = true, prover = true, rpcPort = 8899, indexerPort = 8784, proverPort = 3001, gossipHost = "127.0.0.1", checkPhotonVersion = true, photonDatabaseUrl, limitLedgerSize, geyserConfig, validatorArgs, cloneNetwork, verbose, skipReset, }) {
|
|
107
107
|
// We cannot await this promise directly because it will hang the process
|
|
108
108
|
startTestValidator({
|
|
109
109
|
additionalPrograms,
|
|
110
|
+
upgradeablePrograms,
|
|
110
111
|
skipSystemAccounts,
|
|
111
112
|
limitLedgerSize,
|
|
112
113
|
rpcPort,
|
|
@@ -120,29 +121,27 @@ async function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer = t
|
|
|
120
121
|
await (0, process_1.waitForServers)([{ port: rpcPort, path: "/health" }]);
|
|
121
122
|
await (0, process_1.confirmServerStability)(`http://127.0.0.1:${rpcPort}/health`);
|
|
122
123
|
await (0, process_1.confirmRpcReadiness)(`http://127.0.0.1:${rpcPort}`);
|
|
123
|
-
if (indexer) {
|
|
124
|
-
const config = (0, utils_1.getConfig)();
|
|
125
|
-
config.indexerUrl = `http://127.0.0.1:${indexerPort}`;
|
|
126
|
-
(0, utils_1.setConfig)(config);
|
|
127
|
-
const proverUrlForIndexer = prover
|
|
128
|
-
? `http://127.0.0.1:${proverPort}`
|
|
129
|
-
: undefined;
|
|
130
|
-
await (0, processPhotonIndexer_1.startIndexer)(`http://127.0.0.1:${rpcPort}`, indexerPort, checkPhotonVersion, photonDatabaseUrl, proverUrlForIndexer);
|
|
131
|
-
}
|
|
132
124
|
if (prover) {
|
|
133
125
|
const config = (0, utils_1.getConfig)();
|
|
134
126
|
config.proverUrl = `http://127.0.0.1:${proverPort}`;
|
|
135
127
|
(0, utils_1.setConfig)(config);
|
|
136
128
|
try {
|
|
137
|
-
// TODO: check if using redisUrl is better here.
|
|
138
129
|
await (0, processProverServer_1.startProver)(proverPort);
|
|
139
130
|
}
|
|
140
131
|
catch (error) {
|
|
141
132
|
console.error("Failed to start prover:", error);
|
|
142
|
-
// Prover logs will be automatically displayed by spawnBinary in process.ts
|
|
143
133
|
throw error;
|
|
144
134
|
}
|
|
145
135
|
}
|
|
136
|
+
if (indexer) {
|
|
137
|
+
const config = (0, utils_1.getConfig)();
|
|
138
|
+
config.indexerUrl = `http://127.0.0.1:${indexerPort}`;
|
|
139
|
+
(0, utils_1.setConfig)(config);
|
|
140
|
+
const proverUrlForIndexer = prover
|
|
141
|
+
? `http://127.0.0.1:${proverPort}`
|
|
142
|
+
: undefined;
|
|
143
|
+
await (0, processPhotonIndexer_1.startIndexer)(`http://127.0.0.1:${rpcPort}`, indexerPort, checkPhotonVersion, photonDatabaseUrl, proverUrlForIndexer);
|
|
144
|
+
}
|
|
146
145
|
}
|
|
147
146
|
async function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer = false, prover = false, geyserConfig, validatorArgs, } = {}) {
|
|
148
147
|
try {
|
|
@@ -194,12 +193,12 @@ function programFilePath(programName) {
|
|
|
194
193
|
}
|
|
195
194
|
return path_1.default.resolve(__dirname, path_1.default.join(constants_1.BASE_PATH, programName));
|
|
196
195
|
}
|
|
197
|
-
async function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, downloadBinaries = true, cloneNetwork, verbose = false, skipReset = false, }) {
|
|
196
|
+
async function getSolanaArgs({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, downloadBinaries = true, cloneNetwork, verbose = false, skipReset = false, }) {
|
|
198
197
|
const dirPath = programsDirPath();
|
|
199
198
|
const solanaArgs = [
|
|
200
199
|
`--limit-ledger-size=${limitLedgerSize}`,
|
|
201
200
|
`--rpc-port=${rpcPort}`,
|
|
202
|
-
`--
|
|
201
|
+
`--bind-address=${gossipHost}`,
|
|
203
202
|
"--quiet",
|
|
204
203
|
];
|
|
205
204
|
if (!skipReset) {
|
|
@@ -257,6 +256,12 @@ async function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedg
|
|
|
257
256
|
solanaArgs.push("--bpf-program", program.address, program.path);
|
|
258
257
|
}
|
|
259
258
|
}
|
|
259
|
+
// Add upgradeable programs (with upgrade authority)
|
|
260
|
+
if (upgradeablePrograms) {
|
|
261
|
+
for (const program of upgradeablePrograms) {
|
|
262
|
+
solanaArgs.push("--upgradeable-program", program.address, program.path, program.upgradeAuthority);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
260
265
|
// Load local system accounts only if not cloning from network
|
|
261
266
|
if (!skipSystemAccounts && !cloneNetwork) {
|
|
262
267
|
const accountsRelPath = "../../accounts";
|
|
@@ -265,10 +270,11 @@ async function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedg
|
|
|
265
270
|
}
|
|
266
271
|
return solanaArgs;
|
|
267
272
|
}
|
|
268
|
-
async function startTestValidator({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, cloneNetwork, verbose, skipReset, }) {
|
|
273
|
+
async function startTestValidator({ additionalPrograms, upgradeablePrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, validatorArgs, geyserConfig, cloneNetwork, verbose, skipReset, }) {
|
|
269
274
|
const command = "solana-test-validator";
|
|
270
275
|
const solanaArgs = await getSolanaArgs({
|
|
271
276
|
additionalPrograms,
|
|
277
|
+
upgradeablePrograms,
|
|
272
278
|
skipSystemAccounts,
|
|
273
279
|
limitLedgerSize,
|
|
274
280
|
rpcPort,
|
|
@@ -288,10 +294,11 @@ async function startTestValidator({ additionalPrograms, skipSystemAccounts, limi
|
|
|
288
294
|
solanaArgs.push(...validatorArgs.split(" "));
|
|
289
295
|
}
|
|
290
296
|
console.log("Starting test validator...");
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
// Use spawnBinary instead of executeCommand to properly detach the process.
|
|
298
|
+
// This ensures the validator survives when the CLI exits (executeCommand uses
|
|
299
|
+
// piped stdio which causes SIGPIPE when parent exits).
|
|
300
|
+
// Pass process.env directly to maintain same env behavior as before.
|
|
301
|
+
(0, process_1.spawnBinary)(command, solanaArgs, process.env);
|
|
295
302
|
}
|
|
296
303
|
async function killTestValidator() {
|
|
297
304
|
await (0, process_1.killProcess)("solana-test-validator");
|
package/dist/utils/process.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare function executeCommand({ command, args, additionalPath, logFile,
|
|
|
27
27
|
* @example const output = await execute("ls -alh");
|
|
28
28
|
*/
|
|
29
29
|
export declare function execute(command: string): Promise<string>;
|
|
30
|
-
export declare function spawnBinary(command: string, args?: string[]): import("child_process").ChildProcess;
|
|
30
|
+
export declare function spawnBinary(command: string, args?: string[], env?: NodeJS.ProcessEnv): import("child_process").ChildProcess;
|
|
31
31
|
export declare function waitForServers(servers: {
|
|
32
32
|
port: number;
|
|
33
33
|
path: string;
|
package/dist/utils/process.js
CHANGED
|
@@ -165,7 +165,7 @@ async function execute(command) {
|
|
|
165
165
|
throw err;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
function spawnBinary(command, args = []) {
|
|
168
|
+
function spawnBinary(command, args = [], env) {
|
|
169
169
|
const logDir = "test-ledger";
|
|
170
170
|
const binaryName = path_1.default.basename(command);
|
|
171
171
|
const dir = path_1.default.join(process.cwd(), logDir);
|
|
@@ -180,7 +180,7 @@ function spawnBinary(command, args = []) {
|
|
|
180
180
|
stdio: ["ignore", out, err],
|
|
181
181
|
shell: false,
|
|
182
182
|
detached: true,
|
|
183
|
-
env: {
|
|
183
|
+
env: env ?? {
|
|
184
184
|
...process.env,
|
|
185
185
|
RUST_LOG: process.env.RUST_LOG || "debug",
|
|
186
186
|
},
|
|
@@ -84,6 +84,7 @@ async function startProver(proverPort, redisUrl) {
|
|
|
84
84
|
}
|
|
85
85
|
(0, process_1.spawnBinary)(getProverPathByArch(), args);
|
|
86
86
|
await (0, process_1.waitForServers)([{ port: proverPort, path: "/" }]);
|
|
87
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
87
88
|
console.log(`Prover started successfully!`);
|
|
88
89
|
}
|
|
89
90
|
function getProverNameByArch() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PROVER_VERSION = "2.0.7";
|
package/oclif.manifest.json
CHANGED
|
@@ -131,56 +131,60 @@
|
|
|
131
131
|
"index.js"
|
|
132
132
|
]
|
|
133
133
|
},
|
|
134
|
-
"
|
|
134
|
+
"config:config": {
|
|
135
135
|
"aliases": [],
|
|
136
136
|
"args": {},
|
|
137
|
+
"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",
|
|
137
138
|
"examples": [
|
|
138
|
-
"$ light
|
|
139
|
+
"$ light config --solanaRpcUrl https://solana-api.example.com"
|
|
139
140
|
],
|
|
140
141
|
"flags": {
|
|
141
|
-
"
|
|
142
|
-
"description": "
|
|
143
|
-
"name": "
|
|
144
|
-
"required": true,
|
|
142
|
+
"solanaRpcUrl": {
|
|
143
|
+
"description": "Solana RPC url",
|
|
144
|
+
"name": "solanaRpcUrl",
|
|
145
145
|
"hasDynamicHelp": false,
|
|
146
146
|
"multiple": false,
|
|
147
147
|
"type": "option"
|
|
148
148
|
},
|
|
149
|
-
"
|
|
150
|
-
"description": "
|
|
151
|
-
"name": "
|
|
152
|
-
"required": true,
|
|
149
|
+
"indexerUrl": {
|
|
150
|
+
"description": "Indexer url",
|
|
151
|
+
"name": "indexerUrl",
|
|
153
152
|
"hasDynamicHelp": false,
|
|
154
153
|
"multiple": false,
|
|
155
154
|
"type": "option"
|
|
156
155
|
},
|
|
157
|
-
"
|
|
158
|
-
"description": "
|
|
159
|
-
"name": "
|
|
160
|
-
"required": true,
|
|
156
|
+
"proverUrl": {
|
|
157
|
+
"description": "Prover url",
|
|
158
|
+
"name": "proverUrl",
|
|
161
159
|
"hasDynamicHelp": false,
|
|
162
160
|
"multiple": false,
|
|
163
161
|
"type": "option"
|
|
162
|
+
},
|
|
163
|
+
"get": {
|
|
164
|
+
"description": "Gets the current config values",
|
|
165
|
+
"name": "get",
|
|
166
|
+
"required": false,
|
|
167
|
+
"allowNo": false,
|
|
168
|
+
"type": "boolean"
|
|
164
169
|
}
|
|
165
170
|
},
|
|
166
171
|
"hasDynamicHelp": false,
|
|
167
172
|
"hiddenAliases": [],
|
|
168
|
-
"id": "
|
|
173
|
+
"id": "config:config",
|
|
169
174
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
170
175
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
171
176
|
"pluginType": "core",
|
|
172
177
|
"strict": true,
|
|
173
|
-
"summary": "Compress SPL tokens.",
|
|
174
178
|
"enableJsonFlag": false,
|
|
175
179
|
"isESM": false,
|
|
176
180
|
"relativePath": [
|
|
177
181
|
"dist",
|
|
178
182
|
"commands",
|
|
179
|
-
"
|
|
183
|
+
"config",
|
|
180
184
|
"index.js"
|
|
181
185
|
]
|
|
182
186
|
},
|
|
183
|
-
"config
|
|
187
|
+
"config": {
|
|
184
188
|
"aliases": [],
|
|
185
189
|
"args": {},
|
|
186
190
|
"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",
|
|
@@ -219,7 +223,7 @@
|
|
|
219
223
|
},
|
|
220
224
|
"hasDynamicHelp": false,
|
|
221
225
|
"hiddenAliases": [],
|
|
222
|
-
"id": "config
|
|
226
|
+
"id": "config",
|
|
223
227
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
224
228
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
225
229
|
"pluginType": "core",
|
|
@@ -233,56 +237,52 @@
|
|
|
233
237
|
"index.js"
|
|
234
238
|
]
|
|
235
239
|
},
|
|
236
|
-
"
|
|
240
|
+
"compress-spl": {
|
|
237
241
|
"aliases": [],
|
|
238
242
|
"args": {},
|
|
239
|
-
"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",
|
|
240
243
|
"examples": [
|
|
241
|
-
"$ light
|
|
244
|
+
"$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
|
|
242
245
|
],
|
|
243
246
|
"flags": {
|
|
244
|
-
"
|
|
245
|
-
"description": "
|
|
246
|
-
"name": "
|
|
247
|
+
"mint": {
|
|
248
|
+
"description": "Specify the mint address.",
|
|
249
|
+
"name": "mint",
|
|
250
|
+
"required": true,
|
|
247
251
|
"hasDynamicHelp": false,
|
|
248
252
|
"multiple": false,
|
|
249
253
|
"type": "option"
|
|
250
254
|
},
|
|
251
|
-
"
|
|
252
|
-
"description": "
|
|
253
|
-
"name": "
|
|
255
|
+
"to": {
|
|
256
|
+
"description": "Specify the recipient address (owner of destination compressed token account).",
|
|
257
|
+
"name": "to",
|
|
258
|
+
"required": true,
|
|
254
259
|
"hasDynamicHelp": false,
|
|
255
260
|
"multiple": false,
|
|
256
261
|
"type": "option"
|
|
257
262
|
},
|
|
258
|
-
"
|
|
259
|
-
"description": "
|
|
260
|
-
"name": "
|
|
263
|
+
"amount": {
|
|
264
|
+
"description": "Amount to compress, in tokens.",
|
|
265
|
+
"name": "amount",
|
|
266
|
+
"required": true,
|
|
261
267
|
"hasDynamicHelp": false,
|
|
262
268
|
"multiple": false,
|
|
263
269
|
"type": "option"
|
|
264
|
-
},
|
|
265
|
-
"get": {
|
|
266
|
-
"description": "Gets the current config values",
|
|
267
|
-
"name": "get",
|
|
268
|
-
"required": false,
|
|
269
|
-
"allowNo": false,
|
|
270
|
-
"type": "boolean"
|
|
271
270
|
}
|
|
272
271
|
},
|
|
273
272
|
"hasDynamicHelp": false,
|
|
274
273
|
"hiddenAliases": [],
|
|
275
|
-
"id": "
|
|
274
|
+
"id": "compress-spl",
|
|
276
275
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
277
276
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
278
277
|
"pluginType": "core",
|
|
279
278
|
"strict": true,
|
|
279
|
+
"summary": "Compress SPL tokens.",
|
|
280
280
|
"enableJsonFlag": false,
|
|
281
281
|
"isESM": false,
|
|
282
282
|
"relativePath": [
|
|
283
283
|
"dist",
|
|
284
284
|
"commands",
|
|
285
|
-
"
|
|
285
|
+
"compress-spl",
|
|
286
286
|
"index.js"
|
|
287
287
|
]
|
|
288
288
|
},
|
|
@@ -633,6 +633,7 @@
|
|
|
633
633
|
"$ light test-validator --geyser-config ./config.json",
|
|
634
634
|
"$ light test-validator --validator-args \"--limit-ledger-size 50000000\"",
|
|
635
635
|
"$ light test-validator --sbf-program <address> <path/program>",
|
|
636
|
+
"$ light test-validator --upgradeable-program <address> <path/program> <upgrade_authority>",
|
|
636
637
|
"$ light test-validator --devnet",
|
|
637
638
|
"$ light test-validator --mainnet"
|
|
638
639
|
],
|
|
@@ -761,6 +762,15 @@
|
|
|
761
762
|
"multiple": true,
|
|
762
763
|
"type": "option"
|
|
763
764
|
},
|
|
765
|
+
"upgradeable-program": {
|
|
766
|
+
"description": "Add an upgradeable SBF program to the genesis configuration. Required for programs that need compressible config initialization. If the ledger already exists then this parameter is silently ignored.",
|
|
767
|
+
"name": "upgradeable-program",
|
|
768
|
+
"required": false,
|
|
769
|
+
"summary": "Usage: --upgradeable-program <address> <path/program_name.so> <upgrade_authority>",
|
|
770
|
+
"hasDynamicHelp": false,
|
|
771
|
+
"multiple": true,
|
|
772
|
+
"type": "option"
|
|
773
|
+
},
|
|
764
774
|
"devnet": {
|
|
765
775
|
"description": "Clone Light Protocol programs and accounts from devnet instead of loading local binaries.",
|
|
766
776
|
"exclusive": [
|
|
@@ -809,104 +819,104 @@
|
|
|
809
819
|
"index.js"
|
|
810
820
|
]
|
|
811
821
|
},
|
|
812
|
-
"
|
|
822
|
+
"token-balance": {
|
|
813
823
|
"aliases": [],
|
|
814
824
|
"args": {},
|
|
815
825
|
"examples": [
|
|
816
|
-
"$ light
|
|
826
|
+
"$ light token-balance --mint=<ADDRESS> --owner=<ADDRESS>"
|
|
817
827
|
],
|
|
818
828
|
"flags": {
|
|
819
|
-
"
|
|
820
|
-
"description": "
|
|
821
|
-
"name": "
|
|
822
|
-
"required": true,
|
|
823
|
-
"hasDynamicHelp": false,
|
|
824
|
-
"multiple": false,
|
|
825
|
-
"type": "option"
|
|
826
|
-
},
|
|
827
|
-
"to": {
|
|
828
|
-
"description": "Recipient address",
|
|
829
|
-
"name": "to",
|
|
829
|
+
"owner": {
|
|
830
|
+
"description": "Address of the compressed token owner.",
|
|
831
|
+
"name": "owner",
|
|
830
832
|
"required": true,
|
|
831
833
|
"hasDynamicHelp": false,
|
|
832
834
|
"multiple": false,
|
|
833
835
|
"type": "option"
|
|
834
836
|
},
|
|
835
|
-
"
|
|
836
|
-
"description": "
|
|
837
|
-
"name": "
|
|
837
|
+
"mint": {
|
|
838
|
+
"description": "Mint address of the compressed token account.",
|
|
839
|
+
"name": "mint",
|
|
838
840
|
"required": true,
|
|
839
841
|
"hasDynamicHelp": false,
|
|
840
842
|
"multiple": false,
|
|
841
843
|
"type": "option"
|
|
842
|
-
},
|
|
843
|
-
"fee-payer": {
|
|
844
|
-
"description": "Specify the fee-payer account. Defaults to the client keypair.",
|
|
845
|
-
"name": "fee-payer",
|
|
846
|
-
"required": false,
|
|
847
|
-
"hasDynamicHelp": false,
|
|
848
|
-
"multiple": false,
|
|
849
|
-
"type": "option"
|
|
850
844
|
}
|
|
851
845
|
},
|
|
852
846
|
"hasDynamicHelp": false,
|
|
853
847
|
"hiddenAliases": [],
|
|
854
|
-
"id": "
|
|
848
|
+
"id": "token-balance",
|
|
855
849
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
856
850
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
857
851
|
"pluginType": "core",
|
|
858
852
|
"strict": true,
|
|
859
|
-
"summary": "
|
|
853
|
+
"summary": "Get balance",
|
|
860
854
|
"enableJsonFlag": false,
|
|
861
855
|
"isESM": false,
|
|
862
856
|
"relativePath": [
|
|
863
857
|
"dist",
|
|
864
858
|
"commands",
|
|
865
|
-
"
|
|
859
|
+
"token-balance",
|
|
866
860
|
"index.js"
|
|
867
861
|
]
|
|
868
862
|
},
|
|
869
|
-
"
|
|
863
|
+
"transfer": {
|
|
870
864
|
"aliases": [],
|
|
871
865
|
"args": {},
|
|
872
866
|
"examples": [
|
|
873
|
-
"$ light
|
|
867
|
+
"$ light transfer --mint PublicKey --to PublicKey --amount 1000"
|
|
874
868
|
],
|
|
875
869
|
"flags": {
|
|
876
|
-
"
|
|
877
|
-
"description": "
|
|
878
|
-
"name": "
|
|
870
|
+
"mint": {
|
|
871
|
+
"description": "Mint to transfer",
|
|
872
|
+
"name": "mint",
|
|
879
873
|
"required": true,
|
|
880
874
|
"hasDynamicHelp": false,
|
|
881
875
|
"multiple": false,
|
|
882
876
|
"type": "option"
|
|
883
877
|
},
|
|
884
|
-
"
|
|
885
|
-
"description": "
|
|
886
|
-
"name": "
|
|
878
|
+
"to": {
|
|
879
|
+
"description": "Recipient address",
|
|
880
|
+
"name": "to",
|
|
881
|
+
"required": true,
|
|
882
|
+
"hasDynamicHelp": false,
|
|
883
|
+
"multiple": false,
|
|
884
|
+
"type": "option"
|
|
885
|
+
},
|
|
886
|
+
"amount": {
|
|
887
|
+
"description": "Amount to send, in tokens",
|
|
888
|
+
"name": "amount",
|
|
887
889
|
"required": true,
|
|
888
890
|
"hasDynamicHelp": false,
|
|
889
891
|
"multiple": false,
|
|
890
892
|
"type": "option"
|
|
893
|
+
},
|
|
894
|
+
"fee-payer": {
|
|
895
|
+
"description": "Specify the fee-payer account. Defaults to the client keypair.",
|
|
896
|
+
"name": "fee-payer",
|
|
897
|
+
"required": false,
|
|
898
|
+
"hasDynamicHelp": false,
|
|
899
|
+
"multiple": false,
|
|
900
|
+
"type": "option"
|
|
891
901
|
}
|
|
892
902
|
},
|
|
893
903
|
"hasDynamicHelp": false,
|
|
894
904
|
"hiddenAliases": [],
|
|
895
|
-
"id": "
|
|
905
|
+
"id": "transfer",
|
|
896
906
|
"pluginAlias": "@lightprotocol/zk-compression-cli",
|
|
897
907
|
"pluginName": "@lightprotocol/zk-compression-cli",
|
|
898
908
|
"pluginType": "core",
|
|
899
909
|
"strict": true,
|
|
900
|
-
"summary": "
|
|
910
|
+
"summary": "Transfer tokens from one account to another.",
|
|
901
911
|
"enableJsonFlag": false,
|
|
902
912
|
"isESM": false,
|
|
903
913
|
"relativePath": [
|
|
904
914
|
"dist",
|
|
905
915
|
"commands",
|
|
906
|
-
"
|
|
916
|
+
"transfer",
|
|
907
917
|
"index.js"
|
|
908
918
|
]
|
|
909
919
|
}
|
|
910
920
|
},
|
|
911
|
-
"version": "0.
|
|
921
|
+
"version": "0.28.0-beta.1"
|
|
912
922
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/zk-compression-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0-beta.1",
|
|
4
4
|
"description": "ZK Compression: Secure Scaling on Solana",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
{
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"tweetnacl": "^1.0.3",
|
|
50
50
|
"wait-on": "^7.2.0",
|
|
51
51
|
"which": "^5.0.0",
|
|
52
|
-
"@lightprotocol/compressed-token": "0.
|
|
53
|
-
"@lightprotocol/stateless.js": "0.
|
|
52
|
+
"@lightprotocol/compressed-token": "0.23.0-beta.1",
|
|
53
|
+
"@lightprotocol/stateless.js": "0.23.0-beta.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@eslint/js": "9.36.0",
|
|
@@ -97,48 +97,11 @@
|
|
|
97
97
|
"oclif"
|
|
98
98
|
],
|
|
99
99
|
"types": "dist/index.d.ts",
|
|
100
|
-
"nx": {
|
|
101
|
-
"targets": {
|
|
102
|
-
"build": {
|
|
103
|
-
"inputs": [
|
|
104
|
-
"{workspaceRoot}/js",
|
|
105
|
-
"{workspaceRoot}/programs",
|
|
106
|
-
"{workspaceRoot}/gnark-prover"
|
|
107
|
-
],
|
|
108
|
-
"outputs": [
|
|
109
|
-
"{workspaceRoot}/bin",
|
|
110
|
-
"{workspaceRoot}/dist",
|
|
111
|
-
"{workspaceRoot}/lib",
|
|
112
|
-
"{workspaceRoot}/test_bin"
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
"build-ci": {
|
|
116
|
-
"dependsOn": [
|
|
117
|
-
"@lightprotocol/stateless.js:build-ci",
|
|
118
|
-
"@lightprotocol/compressed-token:build-ci"
|
|
119
|
-
],
|
|
120
|
-
"inputs": [
|
|
121
|
-
"{workspaceRoot}/js",
|
|
122
|
-
"{workspaceRoot}/gnark-prover",
|
|
123
|
-
"{projectRoot}/scripts/**"
|
|
124
|
-
],
|
|
125
|
-
"outputs": [
|
|
126
|
-
"{workspaceRoot}/bin",
|
|
127
|
-
"{workspaceRoot}/dist",
|
|
128
|
-
"{workspaceRoot}/lib",
|
|
129
|
-
"{workspaceRoot}/test_bin"
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
"test-ci": {
|
|
133
|
-
"dependsOn": []
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
100
|
"scripts": {
|
|
138
|
-
"add-bins": "./scripts/copyLocalProgramBinaries.sh",
|
|
139
101
|
"postinstall": "[ -d ./bin ] && find ./bin -type f -exec chmod +x {} + || echo 'No bin directory found, skipping chmod'",
|
|
140
|
-
"
|
|
141
|
-
"build
|
|
102
|
+
"sync-prover-version": "./scripts/syncProverVersion.sh",
|
|
103
|
+
"build": "shx rm -rf dist && pnpm sync-prover-version && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json",
|
|
104
|
+
"build-release": "shx rm -rf dist && pnpm sync-prover-version && pnpm tsc -p tsconfig.json && pnpm tsc -p tsconfig.test.json",
|
|
142
105
|
"format": "pnpm prettier --write \"src/**/*.{ts,js}\" \"test/**/*.{ts,js}\" -w",
|
|
143
106
|
"format:check": "pnpm prettier \"src/**/*{ts,js}\" \"test/**/*.{ts,js}\" --check",
|
|
144
107
|
"lint": "eslint .",
|