@layr-labs/ecloud-cli 0.4.0 → 0.4.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/VERSION +2 -2
- package/dist/commands/auth/whoami.js +15 -0
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +15 -0
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +15 -0
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +15 -0
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +15 -0
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +15 -0
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +15 -0
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +15 -0
- package/dist/commands/billing/top-up.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +64 -3
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +16 -1
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +16 -1
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +16 -1
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +16 -1
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +16 -1
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +63 -3
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +63 -3
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +63 -3
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +69 -8
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +16 -1
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +16 -1
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +16 -1
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +16 -1
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +16 -1
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +16 -1
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/undelegate.js +16 -1
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js +565 -0
- package/dist/hooks/init/__tests__/version-check.test.js.map +1 -0
- package/dist/hooks/init/version-check.js +344 -0
- package/dist/hooks/init/version-check.js.map +1 -0
- package/package.json +5 -2
|
@@ -312,7 +312,7 @@ function listApps(environment) {
|
|
|
312
312
|
|
|
313
313
|
// src/utils/version.ts
|
|
314
314
|
function getCliVersion() {
|
|
315
|
-
return true ? "0.4.
|
|
315
|
+
return true ? "0.4.1" : "0.0.0";
|
|
316
316
|
}
|
|
317
317
|
function getClientId() {
|
|
318
318
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -1276,6 +1276,7 @@ async function getEnvironmentInteractive(environment) {
|
|
|
1276
1276
|
var MAX_IMAGE_SIZE = 4 * 1024 * 1024;
|
|
1277
1277
|
|
|
1278
1278
|
// src/flags.ts
|
|
1279
|
+
import { formatEther, parseGwei } from "viem";
|
|
1279
1280
|
var commonFlags = {
|
|
1280
1281
|
environment: Flags.string({
|
|
1281
1282
|
required: false,
|
|
@@ -1297,8 +1298,60 @@ var commonFlags = {
|
|
|
1297
1298
|
required: false,
|
|
1298
1299
|
description: "Enable verbose logging (default: false)",
|
|
1299
1300
|
default: false
|
|
1301
|
+
}),
|
|
1302
|
+
"max-fee-per-gas": Flags.string({
|
|
1303
|
+
required: false,
|
|
1304
|
+
description: "Override max fee per gas in gwei (e.g., 50)",
|
|
1305
|
+
env: "ECLOUD_MAX_FEE_PER_GAS"
|
|
1306
|
+
}),
|
|
1307
|
+
"max-priority-fee": Flags.string({
|
|
1308
|
+
required: false,
|
|
1309
|
+
description: "Override max priority fee per gas in gwei (e.g., 5)",
|
|
1310
|
+
env: "ECLOUD_MAX_PRIORITY_FEE"
|
|
1311
|
+
}),
|
|
1312
|
+
nonce: Flags.string({
|
|
1313
|
+
required: false,
|
|
1314
|
+
description: 'Override transaction nonce (integer or "latest" to replace a stuck transaction)'
|
|
1300
1315
|
})
|
|
1301
1316
|
};
|
|
1317
|
+
async function applyTxOverrides(estimate, flags, opts) {
|
|
1318
|
+
const maxFeeStr = flags["max-fee-per-gas"];
|
|
1319
|
+
const priorityFeeStr = flags["max-priority-fee"];
|
|
1320
|
+
const nonceStr = flags.nonce;
|
|
1321
|
+
if (!maxFeeStr && !priorityFeeStr && nonceStr == null) return estimate;
|
|
1322
|
+
let { gasLimit, maxFeePerGas, maxPriorityFeePerGas } = estimate;
|
|
1323
|
+
if (maxFeeStr) {
|
|
1324
|
+
maxFeePerGas = parseGwei(maxFeeStr);
|
|
1325
|
+
}
|
|
1326
|
+
if (priorityFeeStr) {
|
|
1327
|
+
maxPriorityFeePerGas = parseGwei(priorityFeeStr);
|
|
1328
|
+
}
|
|
1329
|
+
if (maxFeePerGas < maxPriorityFeePerGas) {
|
|
1330
|
+
maxFeePerGas = maxPriorityFeePerGas;
|
|
1331
|
+
}
|
|
1332
|
+
const maxCostWei = gasLimit * maxFeePerGas;
|
|
1333
|
+
const eth = Number(formatEther(maxCostWei));
|
|
1334
|
+
const maxCostEth = eth.toFixed(6).replace(/\.?0+$/, "") || "<0.000001";
|
|
1335
|
+
let nonce;
|
|
1336
|
+
if (nonceStr != null) {
|
|
1337
|
+
if (nonceStr === "latest") {
|
|
1338
|
+
if (!opts?.publicClient || !opts?.address) {
|
|
1339
|
+
throw new Error("--nonce latest requires a public client and address");
|
|
1340
|
+
}
|
|
1341
|
+
nonce = await opts.publicClient.getTransactionCount({
|
|
1342
|
+
address: opts.address,
|
|
1343
|
+
blockTag: "latest"
|
|
1344
|
+
});
|
|
1345
|
+
} else {
|
|
1346
|
+
const parsed = Number(nonceStr);
|
|
1347
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
1348
|
+
throw new Error(`Invalid nonce: "${nonceStr}". Must be a non-negative integer or "latest".`);
|
|
1349
|
+
}
|
|
1350
|
+
nonce = parsed;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
return { gasLimit, maxFeePerGas, maxPriorityFeePerGas, maxCostWei, maxCostEth, nonce };
|
|
1354
|
+
}
|
|
1302
1355
|
async function validateCommonFlags(flags, options) {
|
|
1303
1356
|
flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
|
|
1304
1357
|
if (options?.requirePrivateKey !== false) {
|
|
@@ -1756,13 +1809,13 @@ var AppUpgrade = class _AppUpgrade extends Command {
|
|
|
1756
1809
|
const buildFromDockerfile = dockerfilePath !== "";
|
|
1757
1810
|
const imageRef = verifiableImageUrl ? verifiableImageUrl : await getImageReferenceInteractive(flags["image-ref"], buildFromDockerfile);
|
|
1758
1811
|
envFilePath = envFilePath ?? await getEnvFileInteractive(flags["env-file"]);
|
|
1812
|
+
const { publicClient, walletClient, address } = createViemClients({
|
|
1813
|
+
privateKey,
|
|
1814
|
+
rpcUrl,
|
|
1815
|
+
environment
|
|
1816
|
+
});
|
|
1759
1817
|
let currentInstanceType = "";
|
|
1760
1818
|
try {
|
|
1761
|
-
const { publicClient, walletClient } = createViemClients({
|
|
1762
|
-
privateKey,
|
|
1763
|
-
rpcUrl,
|
|
1764
|
-
environment
|
|
1765
|
-
});
|
|
1766
1819
|
const userApiClient = new UserApiClient3(
|
|
1767
1820
|
environmentConfig,
|
|
1768
1821
|
walletClient,
|
|
@@ -1808,8 +1861,16 @@ var AppUpgrade = class _AppUpgrade extends Command {
|
|
|
1808
1861
|
logVisibility,
|
|
1809
1862
|
resourceUsageMonitoring
|
|
1810
1863
|
});
|
|
1864
|
+
const finalTx = await applyTxOverrides(gasEstimate, flags, { publicClient, address });
|
|
1865
|
+
if (flags["max-fee-per-gas"] || flags["max-priority-fee"]) {
|
|
1866
|
+
this.log(chalk2.yellow(`
|
|
1867
|
+
Gas override active \u2014 max fee: ${flags["max-fee-per-gas"] || "estimated"} gwei, priority fee: ${flags["max-priority-fee"] || "estimated"} gwei`));
|
|
1868
|
+
}
|
|
1869
|
+
if (finalTx.nonce != null) {
|
|
1870
|
+
this.log(chalk2.yellow(`Nonce override active \u2014 nonce: ${finalTx.nonce}`));
|
|
1871
|
+
}
|
|
1811
1872
|
this.log(`
|
|
1812
|
-
Estimated transaction cost: ${chalk2.cyan(
|
|
1873
|
+
Estimated transaction cost: ${chalk2.cyan(finalTx.maxCostEth)} ETH`);
|
|
1813
1874
|
if (isMainnet(environmentConfig)) {
|
|
1814
1875
|
const confirmed = await confirm(`Continue with upgrade?`);
|
|
1815
1876
|
if (!confirmed) {
|
|
@@ -1818,7 +1879,7 @@ ${chalk2.gray(`Upgrade cancelled`)}`);
|
|
|
1818
1879
|
return;
|
|
1819
1880
|
}
|
|
1820
1881
|
}
|
|
1821
|
-
const res = await compute.app.executeUpgrade(prepared,
|
|
1882
|
+
const res = await compute.app.executeUpgrade(prepared, finalTx);
|
|
1822
1883
|
await compute.app.watchUpgrade(res.appId);
|
|
1823
1884
|
try {
|
|
1824
1885
|
const cwd = process.env.INIT_CWD || process.cwd();
|