@cartesi/cli 0.16.0 → 0.16.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.
@@ -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
@@ -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": "0.16.1"
916
939
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Cartesi CLI",
5
5
  "author": "Danilo Tuler <tuler@pobox.com>",
6
6
  "bin": {