@cartesi/cli 0.16.0 → 1.0.0

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.
@@ -3,12 +3,6 @@ import { Address, Hash } from "viem";
3
3
  export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
4
4
  export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
5
5
  export type AddressBook = Record<string, Address>;
6
- export interface DApp {
7
- address: Address;
8
- blockHash: Address;
9
- blockNumber: number;
10
- transactionHash: Address;
11
- }
12
6
  export declare abstract class BaseCommand<T extends typeof Command> extends Command {
13
7
  protected flags: Flags<T>;
14
8
  protected args: Args<T>;
@@ -19,7 +13,7 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
19
13
  title: string;
20
14
  value: string;
21
15
  }): void;
22
- protected getApplicationAddress(): Promise<Address | undefined>;
16
+ protected getApplicationAddress(): Promise<Address>;
23
17
  protected getAddressBook(): Promise<AddressBook>;
24
18
  init(): Promise<void>;
25
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"baseCommand.d.ts","sourceRoot":"","sources":["../src/baseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAU,MAAM,MAAM,CAAC;AAmB7C,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAClE,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CACjD,CAAC;AACF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,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C;AACF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,OAAO,CAAE,SAAQ,OAAO;IACvE,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAG,IAAI,CAAC,CAAC,CAAC,CAAC;cAET,eAAe,CAC3B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAe9B,SAAS,CAAC,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAIpD,SAAS,CAAC,cAAc,IAAI,IAAI,GAAG,SAAS;IAY5C,SAAS,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;cAItD,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;cAKzC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAkCzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAYrC"}
@@ -3,7 +3,7 @@ import chalk from "chalk";
3
3
  import { execa } from "execa";
4
4
  import fs from "fs";
5
5
  import path from "path";
6
- import { isHash } from "viem";
6
+ import { getAddress, isHash } from "viem";
7
7
  import { authorityHistoryPairFactoryAddress, cartesiDAppFactoryAddress, dAppAddressRelayAddress, erc1155BatchPortalAddress, erc1155SinglePortalAddress, erc20PortalAddress, erc721PortalAddress, etherPortalAddress, inputBoxAddress, selfHostedApplicationFactoryAddress, testMultiTokenAddress, testNftAddress, testTokenAddress, } from "./contracts.js";
8
8
  export class BaseCommand extends Command {
9
9
  async getServiceState(projectName, serviceName) {
@@ -39,12 +39,14 @@ export class BaseCommand extends Command {
39
39
  }
40
40
  async getApplicationAddress() {
41
41
  // fixed value, as we do deterministic deployment with a zero hash
42
- return "0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e";
42
+ return getAddress("0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e");
43
43
  }
44
44
  async getAddressBook() {
45
+ const applicationAddress = await this.getApplicationAddress();
45
46
  // build rollups contracts address book
46
47
  const contracts = {
47
48
  AuthorityHistoryPairFactory: authorityHistoryPairFactoryAddress,
49
+ CartesiDApp: applicationAddress,
48
50
  CartesiDAppFactory: cartesiDAppFactoryAddress,
49
51
  DAppAddressRelay: dAppAddressRelayAddress,
50
52
  EntryPointV06: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
@@ -68,11 +70,6 @@ export class BaseCommand extends Command {
68
70
  VerifyingPaymasterV06: "0x28ec0633192d0cBd9E1156CE05D5FdACAcB93947",
69
71
  VerifyingPaymasterV07: "0xc5c97885C67F7361aBAfD2B95067a5bBdA603608",
70
72
  };
71
- // get dapp address
72
- const applicationAddress = await this.getApplicationAddress();
73
- if (applicationAddress) {
74
- contracts["CartesiDApp"] = applicationAddress;
75
- }
76
73
  return contracts;
77
74
  }
78
75
  async init() {
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW,CACrD,OAAO,gBAAgB,CAC1B;IACG,MAAM,CAAC,OAAO,SAAwB;IAEtC,MAAM,CAAC,WAAW,SAC8V;IAEhX,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;MAWV;IAEF;;;OAGG;YACW,UAAU;YAcV,YAAY;YAsEZ,aAAa;YAgBb,MAAM;IA+BpB,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAoBrC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAwB9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0DpC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW,CACrD,OAAO,gBAAgB,CAC1B;IACG,MAAM,CAAC,OAAO,SAAwB;IAEtC,MAAM,CAAC,WAAW,SAC8V;IAEhX,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;MAWV;IAEF;;;OAGG;YACW,UAAU;YAcV,YAAY;YAsEZ,aAAa;YAUb,MAAM;IA+BpB,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAoBrC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAkBhC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAwB9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0DpC"}
@@ -80,13 +80,7 @@ Update your application Dockerfile using one of the templates at https://github.
80
80
  // saves the OCI Image to a tarball
81
81
  async createTarball(image, outputFilePath) {
82
82
  // create docker tarball from app image
83
- const { stdout: appCid } = await execa("docker", [
84
- "image",
85
- "save",
86
- image,
87
- "-o",
88
- outputFilePath,
89
- ]);
83
+ await execa("docker", ["image", "save", image, "-o", outputFilePath]);
90
84
  }
91
85
  // this wraps the call to the sdk image with a one-shot approach
92
86
  // the (inputPath, outputPath) signature will mount the input as a volume and copy the output with docker cp
@@ -12,6 +12,9 @@ export default class Run extends BaseCommand<typeof Run> {
12
12
  "no-backend": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
13
  verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
14
14
  "listen-port": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
+ cpus: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
+ memory: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
17
+ "dry-run": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
15
18
  };
16
19
  run(): Promise<void>;
17
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW,CAAC,OAAO,GAAG,CAAC;IACpD,MAAM,CAAC,OAAO,SAA2B;IAEzC,MAAM,CAAC,WAAW,SAAmD;IAErE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,KAAK;;;;;;;;;MA0CV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmIpC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW,CAAC,OAAO,GAAG,CAAC;IACpD,MAAM,CAAC,OAAO,SAA2B;IAEzC,MAAM,CAAC,WAAW,SAAmD;IAErE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,KAAK;;;;;;;;;;;;MAyDV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoJpC"}
@@ -40,9 +40,17 @@ class Run extends BaseCommand {
40
40
  CARTESI_SNAPSHOT_DIR: "/usr/share/rollups-node/snapshot",
41
41
  CARTESI_BIN_PATH: binPath,
42
42
  CARTESI_LISTEN_PORT: listenPort.toString(),
43
+ CARTESI_VALIDATOR_CPUS: flags.cpus?.toString(),
44
+ CARTESI_VALIDATOR_MEMORY: flags.memory?.toString(),
43
45
  };
44
46
  // validator
45
47
  const composeFiles = ["docker-compose-validator.yaml"];
48
+ if (flags.cpus) {
49
+ composeFiles.push("docker-compose-validator-cpus.yaml");
50
+ }
51
+ if (flags.memory) {
52
+ composeFiles.push("docker-compose-validator-memory.yaml");
53
+ }
46
54
  // prompt
47
55
  composeFiles.push("docker-compose-prompt.yaml");
48
56
  // database
@@ -96,6 +104,14 @@ class Run extends BaseCommand {
96
104
  // XXX: need this handler, so SIGINT can still call the finally block below
97
105
  process.on("SIGINT", () => { });
98
106
  try {
107
+ if (flags["dry-run"]) {
108
+ // show the docker compose configuration
109
+ await execa("docker", [...compose_args, "config"], {
110
+ env,
111
+ stdio: "inherit",
112
+ });
113
+ return;
114
+ }
99
115
  // run compose environment
100
116
  await execa("docker", [...compose_args, "up", ...up_args], {
101
117
  env,
@@ -158,5 +174,18 @@ Run.flags = {
158
174
  description: "port to listen for incoming connections",
159
175
  default: 8080,
160
176
  }),
177
+ cpus: Flags.integer({
178
+ description: "Define the number of CPUs to use (eg.: 1) for the rollups-node",
179
+ summary: "number of cpu limits for the rollups-node",
180
+ }),
181
+ memory: Flags.integer({
182
+ description: "Define the amount of memory to use for the rollups-node in MB (eg.: 1024)",
183
+ summary: "memory limit for the rollups-node in MB",
184
+ }),
185
+ "dry-run": Flags.boolean({
186
+ description: "show the docker compose configuration",
187
+ default: false,
188
+ hidden: true,
189
+ }),
161
190
  };
162
191
  export default Run;
@@ -1,4 +1,4 @@
1
- FROM cartesi/rollups-node:1.5.0
1
+ FROM cartesi/rollups-node:1.5.1
2
2
  ENV CARTESI_SNAPSHOT_DIR=/usr/share/rollups-node/snapshot
3
3
  ENV CARTESI_HTTP_ADDRESS=0.0.0.0
4
4
  COPY --chown=cartesi:cartesi . ${CARTESI_SNAPSHOT_DIR}
@@ -1,10 +1,10 @@
1
1
  # cartesi/rollups-node
2
2
  CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-error}"
3
- CARTESI_LOG_TIMESTAMP="${CARTESI_LOG_TIMESTAMP:-true}"
4
3
  CARTESI_HTTP_ADDRESS="${CARTESI_HTTP_ADDRESS:-0.0.0.0}"
5
4
  CARTESI_HTTP_PORT="${CARTESI_HTTP_PORT:-10000}"
6
5
  CARTESI_FEATURE_HOST_MODE="${CARTESI_FEATURE_HOST_MODE:-false}"
7
- CARTESI_FEATURE_READER_MODE="${CARTESI_FEATURE_READER_MODE:-false}"
6
+ CARTESI_FEATURE_READER_MODE_ENABLED="${CARTESI_FEATURE_READER_MODE_ENABLED:-false}"
7
+ CARTESI_FEATURE_DISABLE_CLAIMER="${CARTESI_FEATURE_DISABLE_CLAIMER:-false}"
8
8
  CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK="${CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK:-true}"
9
9
  CARTESI_EPOCH_LENGTH="${CARTESI_EPOCH_LENGTH:-720}"
10
10
  CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
@@ -12,6 +12,7 @@ CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anv
12
12
  CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
13
13
  CARTESI_BLOCKCHAIN_IS_LEGACY="${CARTESI_BLOCKCHAIN_IS_LEGACY:-false}"
14
14
  CARTESI_BLOCKCHAIN_FINALITY_OFFSET="${CARTESI_BLOCKCHAIN_FINALITY_OFFSET:-0}"
15
+ CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT="${CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT:-60}"
15
16
  CARTESI_CONTRACTS_APPLICATION_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_ADDRESS:-0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e}"
16
17
  CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-22}"
17
18
  CARTESI_CONTRACTS_HISTORY_ADDRESS="${CARTESI_CONTRACTS_HISTORY_ADDRESS:-0x325272217ae6815b494bf38ced004c5eb8a7cda7}"
@@ -20,7 +21,6 @@ CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x59
20
21
  CARTESI_SNAPSHOT_DIR="${CARTESI_SNAPSHOT_DIR:-/usr/share/cartesi/snapshot}"
21
22
  CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}"
22
23
  CARTESI_POSTGRES_ENDPOINT="${CARTESI_POSTGRES_ENDPOINT:-postgres://postgres:password@database:5432/postgres}"
23
- CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG="${CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG:-false}"
24
24
  CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG="${CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG:-false}"
25
25
 
26
26
  # server-manager
@@ -0,0 +1,6 @@
1
+ services:
2
+ validator:
3
+ deploy:
4
+ resources:
5
+ limits:
6
+ cpus: "${CARTESI_VALIDATOR_CPUS}"
@@ -0,0 +1,6 @@
1
+ services:
2
+ validator:
3
+ deploy:
4
+ resources:
5
+ limits:
6
+ memory: "${CARTESI_VALIDATOR_MEMORY}M"
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  validator:
3
- image: cartesi/rollups-node:1.5.0
3
+ image: cartesi/rollups-node:1.5.1
4
4
  depends_on:
5
5
  dapp_deployer:
6
6
  condition: service_completed_successfully
package/dist/prompts.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Separator } from "@inquirer/core";
2
2
  import input from "@inquirer/input";
3
3
  import select from "@inquirer/select";
4
- import { CancelablePromise, Context } from "@inquirer/type";
4
+ import { Context } from "@inquirer/type";
5
5
  import { Address, Hex } from "viem";
6
6
  type InputConfig = Parameters<typeof input>[0];
7
7
  type SelectConfig<ValueType> = Parameters<typeof select<ValueType>>[0];
@@ -57,6 +57,6 @@ export type SelectAutoConfig<ValueType> = SelectConfig<ValueType> & {
57
57
  };
58
58
  export declare const selectAuto: <ValueType>(config: SelectAutoConfig<ValueType> & {
59
59
  discardDisabled?: boolean;
60
- }, context?: Context | undefined) => CancelablePromise<ValueType>;
60
+ }, context?: Context | undefined) => Promise<ValueType>;
61
61
  export {};
62
62
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EACH,OAAO,EACP,GAAG,EASN,MAAM,MAAM,CAAC;AAEd,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,KAAK,YAAY,CAAC,SAAS,IAAI,UAAU,CAAC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AACtE,eAAO,MAAM,YAAY,WACb,mBAAmB,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,CAAA;CAAE,KAC1C,OAAO,CAAC,GAAG,CA8Cb,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,WACf,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,KAC1C,OAAO,CAAC,KAAK,MAAM,EAAE,CA+DvB,CAAC;AAGF,MAAM,MAAM,MAAM,CAAC,SAAS,IAAI;IAC5B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,GAAG;IAChE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,SAAS,UACxB,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,YACzD,OAAO,GAAG,SAAS,KAC9B,OAAO,CAAC,SAAS,CAsBnB,CAAC"}
package/dist/prompts.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import confirm from "@inquirer/confirm";
2
2
  import input from "@inquirer/input";
3
3
  import select from "@inquirer/select";
4
- import { CancelablePromise } from "@inquirer/type";
5
4
  import chalk from "chalk";
6
5
  import { encodeAbiParameters, formatUnits, getAddress, isAddress, isHex, parseAbiParameters, parseUnits, stringToHex, } from "viem";
7
6
  export const addressInput = async (config) => {
@@ -152,7 +151,7 @@ export const selectAuto = (config, context) => {
152
151
  const prefix = chalk.green("?");
153
152
  const message = chalk.bold(config.message);
154
153
  output.write(`${prefix} ${message} ${chalk.cyan(choice.name || choice.value)}\n`);
155
- return new CancelablePromise((resolve) => resolve(choice.value));
154
+ return new Promise((resolve) => resolve(choice.value));
156
155
  }
157
156
  }
158
157
  return select(config, context);
@@ -272,6 +272,29 @@
272
272
  "hasDynamicHelp": false,
273
273
  "multiple": false,
274
274
  "type": "option"
275
+ },
276
+ "cpus": {
277
+ "description": "Define the number of CPUs to use (eg.: 1) for the rollups-node",
278
+ "name": "cpus",
279
+ "summary": "number of cpu limits for the rollups-node",
280
+ "hasDynamicHelp": false,
281
+ "multiple": false,
282
+ "type": "option"
283
+ },
284
+ "memory": {
285
+ "description": "Define the amount of memory to use for the rollups-node in MB (eg.: 1024)",
286
+ "name": "memory",
287
+ "summary": "memory limit for the rollups-node in MB",
288
+ "hasDynamicHelp": false,
289
+ "multiple": false,
290
+ "type": "option"
291
+ },
292
+ "dry-run": {
293
+ "description": "show the docker compose configuration",
294
+ "hidden": true,
295
+ "name": "dry-run",
296
+ "allowNo": false,
297
+ "type": "boolean"
275
298
  }
276
299
  },
277
300
  "hasDynamicHelp": false,
@@ -912,5 +935,5 @@
912
935
  ]
913
936
  }
914
937
  },
915
- "version": "0.16.0"
938
+ "version": "1.0.0"
916
939
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "0.16.0",
3
+ "version": "1.0.0",
4
4
  "description": "Cartesi CLI",
5
5
  "author": "Danilo Tuler <tuler@pobox.com>",
6
6
  "bin": {
@@ -18,51 +18,52 @@
18
18
  "/oclif.manifest.json"
19
19
  ],
20
20
  "dependencies": {
21
- "@inquirer/confirm": "^3.1.17",
22
- "@inquirer/core": "^9.0.5",
23
- "@inquirer/input": "^2.2.4",
24
- "@inquirer/select": "^2.4.2",
25
- "@inquirer/type": "^1.5.1",
26
- "@oclif/core": "^4.0.14",
27
- "@oclif/plugin-help": "^6.2.7",
28
- "@oclif/plugin-plugins": "^5.3.9",
29
- "bytes": "^3.1",
21
+ "@inquirer/confirm": "^5.0.0",
22
+ "@inquirer/core": "^10.0.0",
23
+ "@inquirer/input": "^4.0.0",
24
+ "@inquirer/select": "^4.0.0",
25
+ "@inquirer/type": "^3.0.0",
26
+ "@oclif/core": "^4.0.29",
27
+ "@oclif/plugin-help": "^6.2.15",
28
+ "@oclif/plugin-plugins": "^5.4.15",
29
+ "bytes": "^3.1.2",
30
30
  "chalk": "^5.3.0",
31
31
  "cli-table3": "^0.6.5",
32
- "execa": "^9.3.0",
33
- "fs-extra": "^11",
32
+ "execa": "^9.4.1",
33
+ "fs-extra": "^11.2.0",
34
34
  "giget": "^1.2.3",
35
35
  "lookpath": "^1.2.2",
36
36
  "open": "^10.1.0",
37
- "ora": "^8.0.1",
38
- "progress-stream": "^2.0",
37
+ "ora": "^8.1.0",
38
+ "progress-stream": "^2.0.0",
39
39
  "semver": "^7.6.3",
40
40
  "tmp": "^0.2.3",
41
- "viem": "^2.18.2"
41
+ "viem": "^2.21.27"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@sunodo/wagmi-plugin-hardhat-deploy": "^0.3.0",
45
- "@types/bytes": "^3.1",
46
- "@types/fs-extra": "^11",
47
- "@types/inquirer": "^9",
48
- "@types/node": "^20.14.12",
49
- "@types/node-fetch": "^2.6",
50
- "@types/progress-stream": "^2.0",
51
- "@types/prompts": "^2.4",
45
+ "@types/bytes": "^3.1.4",
46
+ "@types/fs-extra": "^11.0.4",
47
+ "@types/inquirer": "^9.0.7",
48
+ "@types/node": "^22.7.6",
49
+ "@types/node-fetch": "^2.6.11",
50
+ "@types/progress-stream": "^2.0.5",
51
+ "@types/prompts": "^2.4.9",
52
52
  "@types/semver": "^7.5.8",
53
- "@types/tmp": "^0.2",
54
- "@wagmi/cli": "^2.1.15",
55
- "copyfiles": "^2",
53
+ "@types/tmp": "^0.2.6",
54
+ "@vitest/coverage-istanbul": "^2.1.3",
55
+ "@wagmi/cli": "^2.1.16",
56
+ "copyfiles": "^2.4.1",
56
57
  "eslint": "^8.57.0",
57
- "eslint-config-oclif": "^5.2.0",
58
- "eslint-config-oclif-typescript": "^3.1.8",
59
- "npm-run-all": "^4",
60
- "oclif": "^4.14.9",
58
+ "eslint-config-oclif": "^5.2.1",
59
+ "eslint-config-oclif-typescript": "^3.1.12",
60
+ "npm-run-all": "^4.1.5",
61
+ "oclif": "^4.15.9",
61
62
  "rimraf": "^6.0.1",
62
- "ts-node": "^10",
63
- "tslib": "^2.6.3",
64
- "typescript": "^5.5.4",
65
- "vitest": "^2.0.4",
63
+ "ts-node": "^10.9.2",
64
+ "tslib": "^2.8.0",
65
+ "typescript": "^5.6.3",
66
+ "vitest": "^2.1.3",
66
67
  "@cartesi/devnet": "1.8.0",
67
68
  "@cartesi/eslint-config": "0.0.0",
68
69
  "tsconfig": "0.0.0"
@@ -96,6 +97,7 @@
96
97
  "copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
97
98
  "lint": "eslint \"src/**/*.ts*\"",
98
99
  "posttest": "pnpm lint",
99
- "test": "vitest"
100
+ "test": "vitest",
101
+ "test:coverage": "vitest --coverage.enabled true"
100
102
  }
101
103
  }