@layr-labs/ecloud-cli 0.2.0 → 0.2.2-dev
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/VERSION +2 -2
- package/dist/commands/auth/whoami.js +16 -3
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/cancel.js +44 -5
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +44 -5
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +44 -5
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/compute/app/create.js +16 -3
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +120 -25
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +124 -35
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +78 -17
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +69 -28
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +109 -40
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +82 -120
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +77 -35
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +77 -35
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +77 -35
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +117 -39
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +56 -16
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +72 -67
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +55 -13
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +55 -13
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +68 -9
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +55 -13
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +20 -7
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +46 -10
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/package.json +2 -2
|
@@ -13,9 +13,9 @@ import fs3 from "fs";
|
|
|
13
13
|
import path3 from "path";
|
|
14
14
|
import os3 from "os";
|
|
15
15
|
import { isAddress as isAddress2 } from "viem";
|
|
16
|
-
import { privateKeyToAccount as
|
|
16
|
+
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
17
17
|
import {
|
|
18
|
-
getEnvironmentConfig,
|
|
18
|
+
getEnvironmentConfig as getEnvironmentConfig2,
|
|
19
19
|
getAvailableEnvironments,
|
|
20
20
|
isEnvironmentAvailable,
|
|
21
21
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
@@ -32,12 +32,43 @@ import {
|
|
|
32
32
|
|
|
33
33
|
// src/utils/appResolver.ts
|
|
34
34
|
import { isAddress } from "viem";
|
|
35
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
35
|
+
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
36
36
|
import {
|
|
37
37
|
UserApiClient,
|
|
38
38
|
getAllAppsByDeveloper
|
|
39
39
|
} from "@layr-labs/ecloud-sdk";
|
|
40
40
|
|
|
41
|
+
// src/utils/viemClients.ts
|
|
42
|
+
import {
|
|
43
|
+
createPublicClient,
|
|
44
|
+
http
|
|
45
|
+
} from "viem";
|
|
46
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
47
|
+
import {
|
|
48
|
+
getEnvironmentConfig,
|
|
49
|
+
addHexPrefix,
|
|
50
|
+
createViemClients as sdkCreateViemClients,
|
|
51
|
+
getChainFromID
|
|
52
|
+
} from "@layr-labs/ecloud-sdk";
|
|
53
|
+
function createViemClients(options) {
|
|
54
|
+
const privateKey = addHexPrefix(options.privateKey);
|
|
55
|
+
const environmentConfig = getEnvironmentConfig(options.environment);
|
|
56
|
+
const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
|
|
57
|
+
const chain = getChainFromID(environmentConfig.chainID);
|
|
58
|
+
const { publicClient, walletClient } = sdkCreateViemClients({
|
|
59
|
+
privateKey,
|
|
60
|
+
rpcUrl,
|
|
61
|
+
chainId: environmentConfig.chainID
|
|
62
|
+
});
|
|
63
|
+
const account = privateKeyToAccount(privateKey);
|
|
64
|
+
return {
|
|
65
|
+
publicClient,
|
|
66
|
+
walletClient,
|
|
67
|
+
chain,
|
|
68
|
+
address: account.address
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
41
72
|
// src/utils/globalConfig.ts
|
|
42
73
|
import * as fs from "fs";
|
|
43
74
|
import * as path from "path";
|
|
@@ -124,7 +155,7 @@ var APPS_DIR = path2.join(CONFIG_DIR, "apps");
|
|
|
124
155
|
|
|
125
156
|
// src/utils/version.ts
|
|
126
157
|
function getCliVersion() {
|
|
127
|
-
return true ? "0.2.
|
|
158
|
+
return true ? "0.2.2-dev" : "0.0.0";
|
|
128
159
|
}
|
|
129
160
|
function getClientId() {
|
|
130
161
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -198,7 +229,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
198
229
|
async function getEnvironmentInteractive(environment) {
|
|
199
230
|
if (environment) {
|
|
200
231
|
try {
|
|
201
|
-
|
|
232
|
+
getEnvironmentConfig2(environment);
|
|
202
233
|
if (!isEnvironmentAvailable(environment)) {
|
|
203
234
|
throw new Error(`Environment ${environment} is not available in this build`);
|
|
204
235
|
}
|
|
@@ -211,7 +242,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
211
242
|
const configDefaultEnv = getDefaultEnvironment();
|
|
212
243
|
if (configDefaultEnv && availableEnvs.includes(configDefaultEnv)) {
|
|
213
244
|
try {
|
|
214
|
-
|
|
245
|
+
getEnvironmentConfig2(configDefaultEnv);
|
|
215
246
|
defaultEnv = configDefaultEnv;
|
|
216
247
|
} catch {
|
|
217
248
|
}
|
|
@@ -278,16 +309,27 @@ import {
|
|
|
278
309
|
createComputeModule,
|
|
279
310
|
createBillingModule,
|
|
280
311
|
createBuildModule,
|
|
281
|
-
getEnvironmentConfig as
|
|
312
|
+
getEnvironmentConfig as getEnvironmentConfig3,
|
|
282
313
|
requirePrivateKey,
|
|
283
314
|
getPrivateKeyWithSource
|
|
284
315
|
} from "@layr-labs/ecloud-sdk";
|
|
285
316
|
async function createBuildClient(flags) {
|
|
286
317
|
flags = await validateCommonFlags(flags, { requirePrivateKey: false });
|
|
318
|
+
const environment = flags.environment || "mainnet";
|
|
319
|
+
const environmentConfig = getEnvironmentConfig3(environment);
|
|
320
|
+
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
321
|
+
let walletClient;
|
|
322
|
+
if (flags["private-key"]) {
|
|
323
|
+
walletClient = createViemClients({
|
|
324
|
+
privateKey: flags["private-key"],
|
|
325
|
+
rpcUrl,
|
|
326
|
+
environment
|
|
327
|
+
}).walletClient;
|
|
328
|
+
}
|
|
287
329
|
return createBuildModule({
|
|
288
330
|
verbose: flags.verbose,
|
|
289
|
-
|
|
290
|
-
environment
|
|
331
|
+
walletClient,
|
|
332
|
+
environment,
|
|
291
333
|
clientId: getClientId(),
|
|
292
334
|
skipTelemetry: true
|
|
293
335
|
// CLI already has telemetry, skip SDK telemetry
|
|
@@ -367,8 +409,8 @@ function assertBuildId(buildId) {
|
|
|
367
409
|
}
|
|
368
410
|
|
|
369
411
|
// src/commands/compute/build/logs.ts
|
|
370
|
-
import { privateKeyToAccount as
|
|
371
|
-
import { addHexPrefix } from "@layr-labs/ecloud-sdk";
|
|
412
|
+
import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
|
|
413
|
+
import { addHexPrefix as addHexPrefix2 } from "@layr-labs/ecloud-sdk";
|
|
372
414
|
var BuildLogs = class _BuildLogs extends Command {
|
|
373
415
|
static description = "Get or stream build logs";
|
|
374
416
|
static examples = [
|
|
@@ -400,8 +442,8 @@ var BuildLogs = class _BuildLogs extends Command {
|
|
|
400
442
|
const client = await createBuildClient(validatedFlags);
|
|
401
443
|
let buildId = args.buildId;
|
|
402
444
|
if (!buildId) {
|
|
403
|
-
const billingAddress =
|
|
404
|
-
|
|
445
|
+
const billingAddress = privateKeyToAccount4(
|
|
446
|
+
addHexPrefix2(validatedFlags["private-key"])
|
|
405
447
|
).address;
|
|
406
448
|
buildId = await promptBuildIdFromRecentBuilds({ client, billingAddress, limit: 20 });
|
|
407
449
|
} else {
|