@layr-labs/ecloud-cli 0.2.0 → 0.2.1-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 +111 -24
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +107 -33
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +70 -13
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +68 -27
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +107 -38
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +68 -24
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +76 -34
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +76 -34
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +76 -34
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +106 -36
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +52 -13
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +52 -13
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +52 -13
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +52 -13
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +65 -9
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +52 -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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/commands/compute/app/list.ts
|
|
4
4
|
import { Command, Flags as Flags2 } from "@oclif/core";
|
|
5
5
|
import {
|
|
6
|
-
getEnvironmentConfig as
|
|
6
|
+
getEnvironmentConfig as getEnvironmentConfig3,
|
|
7
7
|
getAllAppsByDeveloper as getAllAppsByDeveloper3,
|
|
8
8
|
getAppLatestReleaseBlockNumbers,
|
|
9
9
|
getBlockTimestamps,
|
|
@@ -20,9 +20,9 @@ import fs3 from "fs";
|
|
|
20
20
|
import path3 from "path";
|
|
21
21
|
import os3 from "os";
|
|
22
22
|
import { isAddress as isAddress2 } from "viem";
|
|
23
|
-
import { privateKeyToAccount as
|
|
23
|
+
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
24
24
|
import {
|
|
25
|
-
getEnvironmentConfig,
|
|
25
|
+
getEnvironmentConfig as getEnvironmentConfig2,
|
|
26
26
|
getAvailableEnvironments,
|
|
27
27
|
isEnvironmentAvailable,
|
|
28
28
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
@@ -39,12 +39,43 @@ import {
|
|
|
39
39
|
|
|
40
40
|
// src/utils/appResolver.ts
|
|
41
41
|
import { isAddress } from "viem";
|
|
42
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
42
|
+
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
43
43
|
import {
|
|
44
44
|
UserApiClient,
|
|
45
45
|
getAllAppsByDeveloper
|
|
46
46
|
} from "@layr-labs/ecloud-sdk";
|
|
47
47
|
|
|
48
|
+
// src/utils/viemClients.ts
|
|
49
|
+
import {
|
|
50
|
+
createPublicClient,
|
|
51
|
+
http
|
|
52
|
+
} from "viem";
|
|
53
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
54
|
+
import {
|
|
55
|
+
getEnvironmentConfig,
|
|
56
|
+
addHexPrefix,
|
|
57
|
+
createViemClients as sdkCreateViemClients,
|
|
58
|
+
getChainFromID
|
|
59
|
+
} from "@layr-labs/ecloud-sdk";
|
|
60
|
+
function createViemClients(options) {
|
|
61
|
+
const privateKey = addHexPrefix(options.privateKey);
|
|
62
|
+
const environmentConfig = getEnvironmentConfig(options.environment);
|
|
63
|
+
const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
|
|
64
|
+
const chain = getChainFromID(environmentConfig.chainID);
|
|
65
|
+
const { publicClient, walletClient } = sdkCreateViemClients({
|
|
66
|
+
privateKey,
|
|
67
|
+
rpcUrl,
|
|
68
|
+
chainId: environmentConfig.chainID
|
|
69
|
+
});
|
|
70
|
+
const account = privateKeyToAccount(privateKey);
|
|
71
|
+
return {
|
|
72
|
+
publicClient,
|
|
73
|
+
walletClient,
|
|
74
|
+
chain,
|
|
75
|
+
address: account.address
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
48
79
|
// src/utils/globalConfig.ts
|
|
49
80
|
import * as fs from "fs";
|
|
50
81
|
import * as path from "path";
|
|
@@ -165,6 +196,14 @@ function getAppName(environment, appID) {
|
|
|
165
196
|
return "";
|
|
166
197
|
}
|
|
167
198
|
|
|
199
|
+
// src/utils/version.ts
|
|
200
|
+
function getCliVersion() {
|
|
201
|
+
return true ? "0.2.1-dev" : "0.0.0";
|
|
202
|
+
}
|
|
203
|
+
function getClientId() {
|
|
204
|
+
return `ecloud-cli/v${getCliVersion()}`;
|
|
205
|
+
}
|
|
206
|
+
|
|
168
207
|
// src/utils/appResolver.ts
|
|
169
208
|
var CHUNK_SIZE = 10;
|
|
170
209
|
async function getAppInfosChunked(userApiClient, appIds, addressCount) {
|
|
@@ -258,7 +297,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
258
297
|
async function getEnvironmentInteractive(environment) {
|
|
259
298
|
if (environment) {
|
|
260
299
|
try {
|
|
261
|
-
|
|
300
|
+
getEnvironmentConfig2(environment);
|
|
262
301
|
if (!isEnvironmentAvailable(environment)) {
|
|
263
302
|
throw new Error(`Environment ${environment} is not available in this build`);
|
|
264
303
|
}
|
|
@@ -271,7 +310,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
271
310
|
const configDefaultEnv = getDefaultEnvironment();
|
|
272
311
|
if (configDefaultEnv && availableEnvs.includes(configDefaultEnv)) {
|
|
273
312
|
try {
|
|
274
|
-
|
|
313
|
+
getEnvironmentConfig2(configDefaultEnv);
|
|
275
314
|
defaultEnv = configDefaultEnv;
|
|
276
315
|
} catch {
|
|
277
316
|
}
|
|
@@ -334,7 +373,7 @@ async function validateCommonFlags(flags, options) {
|
|
|
334
373
|
}
|
|
335
374
|
|
|
336
375
|
// src/commands/compute/app/list.ts
|
|
337
|
-
import { privateKeyToAccount as
|
|
376
|
+
import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
|
|
338
377
|
|
|
339
378
|
// src/utils/format.ts
|
|
340
379
|
import chalk from "chalk";
|
|
@@ -462,6 +501,17 @@ function printAppDisplay(display, log, indent = " ", options = {}) {
|
|
|
462
501
|
}
|
|
463
502
|
}
|
|
464
503
|
|
|
504
|
+
// src/utils/dashboard.ts
|
|
505
|
+
var DASHBOARD_URLS = {
|
|
506
|
+
"sepolia-dev": "https://compute-dashboard-sepolia-dev.vercel.app",
|
|
507
|
+
sepolia: "https://verify-sepolia.eigencloud.xyz",
|
|
508
|
+
"mainnet-alpha": "https://verify.eigencloud.xyz"
|
|
509
|
+
};
|
|
510
|
+
function getDashboardUrl(environment, appAddress) {
|
|
511
|
+
const baseUrl = DASHBOARD_URLS[environment] || DASHBOARD_URLS["sepolia"];
|
|
512
|
+
return `${baseUrl}/app/${appAddress}`;
|
|
513
|
+
}
|
|
514
|
+
|
|
465
515
|
// src/commands/compute/app/list.ts
|
|
466
516
|
import chalk2 from "chalk";
|
|
467
517
|
|
|
@@ -543,15 +593,20 @@ var AppList = class _AppList extends Command {
|
|
|
543
593
|
const { flags } = await this.parse(_AppList);
|
|
544
594
|
const validatedFlags = await validateCommonFlags(flags);
|
|
545
595
|
const environment = validatedFlags.environment;
|
|
546
|
-
const environmentConfig =
|
|
596
|
+
const environmentConfig = getEnvironmentConfig3(environment);
|
|
547
597
|
const rpcUrl = validatedFlags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
548
598
|
const privateKey = validatedFlags["private-key"];
|
|
549
|
-
const account =
|
|
599
|
+
const account = privateKeyToAccount4(privateKey);
|
|
550
600
|
const developerAddr = account.address;
|
|
601
|
+
const { publicClient, walletClient } = createViemClients({
|
|
602
|
+
privateKey,
|
|
603
|
+
rpcUrl,
|
|
604
|
+
environment
|
|
605
|
+
});
|
|
551
606
|
if (flags.verbose) {
|
|
552
607
|
this.log(`Fetching apps for developer: ${developerAddr}`);
|
|
553
608
|
}
|
|
554
|
-
const result = await getAllAppsByDeveloper3(
|
|
609
|
+
const result = await getAllAppsByDeveloper3(publicClient, environmentConfig, developerAddr);
|
|
555
610
|
if (result.apps.length === 0) {
|
|
556
611
|
this.log(`
|
|
557
612
|
No apps found for developer ${developerAddr}`);
|
|
@@ -579,7 +634,7 @@ No active apps found for developer ${developerAddr} (use --all to show terminate
|
|
|
579
634
|
}
|
|
580
635
|
return;
|
|
581
636
|
}
|
|
582
|
-
const userApiClient = new UserApiClient3(environmentConfig,
|
|
637
|
+
const userApiClient = new UserApiClient3(environmentConfig, walletClient, publicClient, getClientId());
|
|
583
638
|
const [appInfos, releaseBlockNumbers] = await Promise.all([
|
|
584
639
|
getAppInfosChunked(userApiClient, filteredApps, 1).catch((err) => {
|
|
585
640
|
if (flags.verbose) {
|
|
@@ -587,7 +642,7 @@ No active apps found for developer ${developerAddr} (use --all to show terminate
|
|
|
587
642
|
}
|
|
588
643
|
return [];
|
|
589
644
|
}),
|
|
590
|
-
getAppLatestReleaseBlockNumbers(
|
|
645
|
+
getAppLatestReleaseBlockNumbers(publicClient, environmentConfig, filteredApps).catch((err) => {
|
|
591
646
|
if (flags.verbose) {
|
|
592
647
|
this.warn(`Could not fetch release block numbers: ${err}`);
|
|
593
648
|
}
|
|
@@ -595,7 +650,7 @@ No active apps found for developer ${developerAddr} (use --all to show terminate
|
|
|
595
650
|
})
|
|
596
651
|
]);
|
|
597
652
|
const blockNumbers = Array.from(releaseBlockNumbers.values()).filter((n) => n > 0);
|
|
598
|
-
const blockTimestamps = blockNumbers.length > 0 ? await getBlockTimestamps(
|
|
653
|
+
const blockTimestamps = blockNumbers.length > 0 ? await getBlockTimestamps(publicClient, blockNumbers).catch((err) => {
|
|
599
654
|
if (flags.verbose) {
|
|
600
655
|
this.warn(`Could not fetch block timestamps: ${err}`);
|
|
601
656
|
}
|
|
@@ -645,6 +700,8 @@ No active apps found for developer ${developerAddr} (use --all to show terminate
|
|
|
645
700
|
singleAddress: true,
|
|
646
701
|
showProfile: false
|
|
647
702
|
});
|
|
703
|
+
const dashboardUrl = getDashboardUrl(environment, appItems[i].appAddr);
|
|
704
|
+
this.log(` Dashboard: ${chalk2.blue.underline(dashboardUrl)}`);
|
|
648
705
|
if (i < appItems.length - 1) {
|
|
649
706
|
this.log(
|
|
650
707
|
chalk2.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")
|