@layr-labs/ecloud-cli 0.2.0-dev.3 → 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/commands/compute/app/deploy.ts
|
|
4
4
|
import { Command, Flags as Flags2 } from "@oclif/core";
|
|
5
|
-
import { getEnvironmentConfig as
|
|
5
|
+
import { getEnvironmentConfig as getEnvironmentConfig4, UserApiClient as UserApiClient3, isMainnet } from "@layr-labs/ecloud-sdk";
|
|
6
6
|
|
|
7
7
|
// src/telemetry.ts
|
|
8
8
|
import {
|
|
@@ -185,9 +185,9 @@ import fs3 from "fs";
|
|
|
185
185
|
import path3 from "path";
|
|
186
186
|
import os3 from "os";
|
|
187
187
|
import { isAddress as isAddress2 } from "viem";
|
|
188
|
-
import { privateKeyToAccount as
|
|
188
|
+
import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
189
189
|
import {
|
|
190
|
-
getEnvironmentConfig,
|
|
190
|
+
getEnvironmentConfig as getEnvironmentConfig2,
|
|
191
191
|
getAvailableEnvironments,
|
|
192
192
|
isEnvironmentAvailable,
|
|
193
193
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
@@ -204,12 +204,43 @@ import {
|
|
|
204
204
|
|
|
205
205
|
// src/utils/appResolver.ts
|
|
206
206
|
import { isAddress } from "viem";
|
|
207
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
207
|
+
import { privateKeyToAccount as privateKeyToAccount2 } from "viem/accounts";
|
|
208
208
|
import {
|
|
209
209
|
UserApiClient,
|
|
210
210
|
getAllAppsByDeveloper
|
|
211
211
|
} from "@layr-labs/ecloud-sdk";
|
|
212
212
|
|
|
213
|
+
// src/utils/viemClients.ts
|
|
214
|
+
import {
|
|
215
|
+
createPublicClient,
|
|
216
|
+
http
|
|
217
|
+
} from "viem";
|
|
218
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
219
|
+
import {
|
|
220
|
+
getEnvironmentConfig,
|
|
221
|
+
addHexPrefix,
|
|
222
|
+
createViemClients as sdkCreateViemClients,
|
|
223
|
+
getChainFromID
|
|
224
|
+
} from "@layr-labs/ecloud-sdk";
|
|
225
|
+
function createViemClients(options) {
|
|
226
|
+
const privateKey = addHexPrefix(options.privateKey);
|
|
227
|
+
const environmentConfig = getEnvironmentConfig(options.environment);
|
|
228
|
+
const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
|
|
229
|
+
const chain = getChainFromID(environmentConfig.chainID);
|
|
230
|
+
const { publicClient, walletClient } = sdkCreateViemClients({
|
|
231
|
+
privateKey,
|
|
232
|
+
rpcUrl,
|
|
233
|
+
chainId: environmentConfig.chainID
|
|
234
|
+
});
|
|
235
|
+
const account = privateKeyToAccount(privateKey);
|
|
236
|
+
return {
|
|
237
|
+
publicClient,
|
|
238
|
+
walletClient,
|
|
239
|
+
chain,
|
|
240
|
+
address: account.address
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
213
244
|
// src/utils/appNames.ts
|
|
214
245
|
import * as fs2 from "fs";
|
|
215
246
|
import * as path2 from "path";
|
|
@@ -273,7 +304,7 @@ function findAvailableName(environment, baseName) {
|
|
|
273
304
|
|
|
274
305
|
// src/utils/version.ts
|
|
275
306
|
function getCliVersion() {
|
|
276
|
-
return true ? "0.2.
|
|
307
|
+
return true ? "0.2.1-dev" : "0.0.0";
|
|
277
308
|
}
|
|
278
309
|
function getClientId() {
|
|
279
310
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -694,7 +725,12 @@ async function getOrPromptAppName(appName, environment, imageRef, suggestedBaseN
|
|
|
694
725
|
return appName;
|
|
695
726
|
}
|
|
696
727
|
console.log(`Warning: App name '${appName}' is already taken.`);
|
|
697
|
-
return getAvailableAppNameInteractive(
|
|
728
|
+
return getAvailableAppNameInteractive(
|
|
729
|
+
environment,
|
|
730
|
+
imageRef,
|
|
731
|
+
suggestedBaseName,
|
|
732
|
+
skipDefaultName
|
|
733
|
+
);
|
|
698
734
|
}
|
|
699
735
|
return getAvailableAppNameInteractive(environment, imageRef, suggestedBaseName, skipDefaultName);
|
|
700
736
|
}
|
|
@@ -857,7 +893,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
857
893
|
async function getEnvironmentInteractive(environment) {
|
|
858
894
|
if (environment) {
|
|
859
895
|
try {
|
|
860
|
-
|
|
896
|
+
getEnvironmentConfig2(environment);
|
|
861
897
|
if (!isEnvironmentAvailable(environment)) {
|
|
862
898
|
throw new Error(`Environment ${environment} is not available in this build`);
|
|
863
899
|
}
|
|
@@ -870,7 +906,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
870
906
|
const configDefaultEnv = getDefaultEnvironment();
|
|
871
907
|
if (configDefaultEnv && availableEnvs.includes(configDefaultEnv)) {
|
|
872
908
|
try {
|
|
873
|
-
|
|
909
|
+
getEnvironmentConfig2(configDefaultEnv);
|
|
874
910
|
defaultEnv = configDefaultEnv;
|
|
875
911
|
} catch {
|
|
876
912
|
}
|
|
@@ -973,12 +1009,14 @@ async function getAppProfileInteractive(defaultName = "", allowRetry = true) {
|
|
|
973
1009
|
const description = await getAppDescriptionInteractive();
|
|
974
1010
|
const xURL = await getAppXURLInteractive();
|
|
975
1011
|
const imagePath = await getAppImageInteractive();
|
|
1012
|
+
const { image, imageName } = imagePathToBlob(imagePath);
|
|
976
1013
|
const profile = {
|
|
977
1014
|
name,
|
|
978
1015
|
website,
|
|
979
1016
|
description,
|
|
980
1017
|
xURL,
|
|
981
|
-
|
|
1018
|
+
image,
|
|
1019
|
+
imageName
|
|
982
1020
|
};
|
|
983
1021
|
console.log("\n" + formatProfileForDisplay(profile));
|
|
984
1022
|
const confirmed = await inquirerConfirm({
|
|
@@ -1113,12 +1151,25 @@ function formatProfileForDisplay(profile) {
|
|
|
1113
1151
|
output += ` X URL: ${profile.xURL}
|
|
1114
1152
|
`;
|
|
1115
1153
|
}
|
|
1116
|
-
if (profile.
|
|
1117
|
-
output += ` Image: ${profile.
|
|
1154
|
+
if (profile.imageName) {
|
|
1155
|
+
output += ` Image: ${profile.imageName}
|
|
1118
1156
|
`;
|
|
1119
1157
|
}
|
|
1120
1158
|
return output;
|
|
1121
1159
|
}
|
|
1160
|
+
function imagePathToBlob(imagePath) {
|
|
1161
|
+
if (!imagePath) {
|
|
1162
|
+
return { image: void 0, imageName: void 0 };
|
|
1163
|
+
}
|
|
1164
|
+
try {
|
|
1165
|
+
const fileBuffer = fs3.readFileSync(imagePath);
|
|
1166
|
+
const imageName = path3.basename(imagePath);
|
|
1167
|
+
return { image: new Blob([fileBuffer]), imageName };
|
|
1168
|
+
} catch (err) {
|
|
1169
|
+
console.error(`Failed to read image file: ${err}`);
|
|
1170
|
+
return { image: void 0, imageName: void 0 };
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1122
1173
|
|
|
1123
1174
|
// src/flags.ts
|
|
1124
1175
|
var commonFlags = {
|
|
@@ -1157,14 +1208,14 @@ import {
|
|
|
1157
1208
|
createComputeModule,
|
|
1158
1209
|
createBillingModule,
|
|
1159
1210
|
createBuildModule,
|
|
1160
|
-
getEnvironmentConfig as
|
|
1211
|
+
getEnvironmentConfig as getEnvironmentConfig3,
|
|
1161
1212
|
requirePrivateKey,
|
|
1162
1213
|
getPrivateKeyWithSource
|
|
1163
1214
|
} from "@layr-labs/ecloud-sdk";
|
|
1164
1215
|
async function createComputeClient(flags) {
|
|
1165
1216
|
flags = await validateCommonFlags(flags);
|
|
1166
1217
|
const environment = flags.environment;
|
|
1167
|
-
const environmentConfig =
|
|
1218
|
+
const environmentConfig = getEnvironmentConfig3(environment);
|
|
1168
1219
|
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
1169
1220
|
const { key: privateKey, source } = await requirePrivateKey({
|
|
1170
1221
|
privateKey: flags["private-key"]
|
|
@@ -1172,10 +1223,15 @@ async function createComputeClient(flags) {
|
|
|
1172
1223
|
if (flags.verbose) {
|
|
1173
1224
|
console.log(`Using private key from: ${source}`);
|
|
1174
1225
|
}
|
|
1175
|
-
|
|
1176
|
-
verbose: flags.verbose,
|
|
1226
|
+
const { walletClient, publicClient } = createViemClients({
|
|
1177
1227
|
privateKey,
|
|
1178
1228
|
rpcUrl,
|
|
1229
|
+
environment
|
|
1230
|
+
});
|
|
1231
|
+
return createComputeModule({
|
|
1232
|
+
verbose: flags.verbose,
|
|
1233
|
+
walletClient,
|
|
1234
|
+
publicClient,
|
|
1179
1235
|
environment,
|
|
1180
1236
|
clientId: getClientId(),
|
|
1181
1237
|
skipTelemetry: true
|
|
@@ -1184,10 +1240,18 @@ async function createComputeClient(flags) {
|
|
|
1184
1240
|
}
|
|
1185
1241
|
async function createBuildClient(flags) {
|
|
1186
1242
|
flags = await validateCommonFlags(flags, { requirePrivateKey: false });
|
|
1243
|
+
const environment = flags.environment || "mainnet";
|
|
1244
|
+
const environmentConfig = getEnvironmentConfig3(environment);
|
|
1245
|
+
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
1246
|
+
const { walletClient } = createViemClients({
|
|
1247
|
+
privateKey: flags["private-key"],
|
|
1248
|
+
rpcUrl,
|
|
1249
|
+
environment
|
|
1250
|
+
});
|
|
1187
1251
|
return createBuildModule({
|
|
1188
1252
|
verbose: flags.verbose,
|
|
1189
|
-
|
|
1190
|
-
environment
|
|
1253
|
+
walletClient: flags["private-key"] ? walletClient : void 0,
|
|
1254
|
+
environment,
|
|
1191
1255
|
clientId: getClientId(),
|
|
1192
1256
|
skipTelemetry: true
|
|
1193
1257
|
// CLI already has telemetry, skip SDK telemetry
|
|
@@ -1272,6 +1336,17 @@ async function runVerifiableBuildAndVerify(client, request, options = {}) {
|
|
|
1272
1336
|
return { build, verified: verify };
|
|
1273
1337
|
}
|
|
1274
1338
|
|
|
1339
|
+
// src/utils/dashboard.ts
|
|
1340
|
+
var DASHBOARD_URLS = {
|
|
1341
|
+
"sepolia-dev": "https://compute-dashboard-sepolia-dev.vercel.app",
|
|
1342
|
+
sepolia: "https://verify-sepolia.eigencloud.xyz",
|
|
1343
|
+
"mainnet-alpha": "https://verify.eigencloud.xyz"
|
|
1344
|
+
};
|
|
1345
|
+
function getDashboardUrl(environment, appAddress) {
|
|
1346
|
+
const baseUrl = DASHBOARD_URLS[environment] || DASHBOARD_URLS["sepolia"];
|
|
1347
|
+
return `${baseUrl}/app/${appAddress}`;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1275
1350
|
// src/utils/dockerhub.ts
|
|
1276
1351
|
var DOCKERHUB_OWNER = "eigenlayer";
|
|
1277
1352
|
var DOCKERHUB_REPO = "eigencloud-containers";
|
|
@@ -1461,7 +1536,7 @@ var AppDeploy = class _AppDeploy extends Command {
|
|
|
1461
1536
|
const { flags } = await this.parse(_AppDeploy);
|
|
1462
1537
|
const compute = await createComputeClient(flags);
|
|
1463
1538
|
const environment = flags.environment;
|
|
1464
|
-
const environmentConfig =
|
|
1539
|
+
const environmentConfig = getEnvironmentConfig4(environment);
|
|
1465
1540
|
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
1466
1541
|
const privateKey = flags["private-key"];
|
|
1467
1542
|
let buildClient;
|
|
@@ -1650,20 +1725,19 @@ ${chalk.gray(`Deployment cancelled`)}`);
|
|
|
1650
1725
|
return;
|
|
1651
1726
|
}
|
|
1652
1727
|
}
|
|
1653
|
-
const res = await compute.app.executeDeploy(prepared,
|
|
1654
|
-
maxFeePerGas: gasEstimate.maxFeePerGas,
|
|
1655
|
-
maxPriorityFeePerGas: gasEstimate.maxPriorityFeePerGas
|
|
1656
|
-
});
|
|
1728
|
+
const res = await compute.app.executeDeploy(prepared, gasEstimate);
|
|
1657
1729
|
if (!flags["skip-profile"]) {
|
|
1658
1730
|
const hasProfileFlags = flags.website || flags.description || flags["x-url"] || flags.image;
|
|
1659
1731
|
let profile = null;
|
|
1660
1732
|
if (hasProfileFlags) {
|
|
1733
|
+
const { image, imageName } = imagePathToBlob(flags.image);
|
|
1661
1734
|
profile = {
|
|
1662
1735
|
name: appName,
|
|
1663
1736
|
website: flags.website,
|
|
1664
1737
|
description: flags.description,
|
|
1665
1738
|
xURL: flags["x-url"],
|
|
1666
|
-
|
|
1739
|
+
image,
|
|
1740
|
+
imageName
|
|
1667
1741
|
};
|
|
1668
1742
|
} else {
|
|
1669
1743
|
this.log(
|
|
@@ -1705,12 +1779,25 @@ ${chalk.gray(`Deployment cancelled`)}`);
|
|
|
1705
1779
|
`
|
|
1706
1780
|
\u2705 ${chalk.green(`App deployed successfully ${chalk.bold(`(id: ${res.appId}, ip: ${ipAddress})`)}`)}`
|
|
1707
1781
|
);
|
|
1782
|
+
const dashboardUrl = getDashboardUrl(environment, res.appId);
|
|
1783
|
+
this.log(`
|
|
1784
|
+
${chalk.gray("View your app:")} ${chalk.blue.underline(dashboardUrl)}`);
|
|
1708
1785
|
});
|
|
1709
1786
|
}
|
|
1710
1787
|
};
|
|
1711
1788
|
async function fetchAvailableInstanceTypes(environmentConfig, privateKey, rpcUrl) {
|
|
1712
1789
|
try {
|
|
1713
|
-
const
|
|
1790
|
+
const { publicClient, walletClient } = createViemClients({
|
|
1791
|
+
privateKey,
|
|
1792
|
+
rpcUrl,
|
|
1793
|
+
environment: environmentConfig.name
|
|
1794
|
+
});
|
|
1795
|
+
const userApiClient = new UserApiClient3(
|
|
1796
|
+
environmentConfig,
|
|
1797
|
+
walletClient,
|
|
1798
|
+
publicClient,
|
|
1799
|
+
getClientId()
|
|
1800
|
+
);
|
|
1714
1801
|
const skuList = await userApiClient.getSKUs();
|
|
1715
1802
|
if (skuList.skus.length === 0) {
|
|
1716
1803
|
throw new Error("No instance types available from server");
|