@cartesi/cli 0.14.3 → 0.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"address-book.d.ts","sourceRoot":"","sources":["../../src/commands/address-book.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW,CAAC,OAAO,WAAW,CAAC;IACpE,MAAM,CAAC,OAAO,SAAmD;IAEjE,MAAM,CAAC,WAAW,SACwF;IAE1G,MAAM,CAAC,QAAQ,WAA2C;IAE1D,OAAc,cAAc,UAAQ;IAEvB,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;CAe/C"}
1
+ {"version":3,"file":"address-book.d.ts","sourceRoot":"","sources":["../../src/commands/address-book.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW,CAAC,OAAO,WAAW,CAAC;IACpE,MAAM,CAAC,OAAO,SAAmD;IAEjE,MAAM,CAAC,WAAW,SACwF;IAE1G,MAAM,CAAC,QAAQ,WAA2C;IAE1D,OAAc,cAAc,UAAQ;IAEvB,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;CA+B/C"}
@@ -1,14 +1,33 @@
1
- import { ux } from "@oclif/core";
1
+ import Table from "cli-table3";
2
2
  import { BaseCommand } from "../baseCommand.js";
3
3
  class AddressBook extends BaseCommand {
4
4
  async run() {
5
5
  const addressBook = await super.getAddressBook();
6
6
  if (!this.jsonEnabled()) {
7
7
  // print as a table
8
- ux.table(Object.entries(addressBook).map(([name, address]) => ({
9
- name,
10
- address,
11
- })), { name: { header: "Contract" }, address: {} });
8
+ const table = new Table({
9
+ head: ["Contract", "Address"],
10
+ chars: {
11
+ top: "",
12
+ "top-mid": "",
13
+ "top-left": "",
14
+ "top-right": "",
15
+ bottom: "",
16
+ "bottom-mid": "",
17
+ "bottom-left": "",
18
+ "bottom-right": "",
19
+ left: "",
20
+ "left-mid": "",
21
+ mid: "",
22
+ "mid-mid": "",
23
+ right: "",
24
+ "right-mid": "",
25
+ middle: " ",
26
+ },
27
+ style: { "padding-left": 0, "padding-right": 0 },
28
+ });
29
+ table.push(...Object.entries(addressBook));
30
+ console.log(table.toString());
12
31
  }
13
32
  // return (as json)
14
33
  return addressBook;
@@ -12,7 +12,7 @@ const CARTESI_LABEL_DATA_SIZE = `${CARTESI_LABEL_PREFIX}.data_size`;
12
12
  const CARTESI_DEFAULT_RAM_SIZE = "128Mi";
13
13
  const CARTESI_LABEL_SDK_VERSION = `${CARTESI_LABEL_PREFIX}.sdk_version`;
14
14
  const CARTESI_LABEL_SDK_NAME = `${CARTESI_LABEL_PREFIX}.sdk_name`;
15
- const CARTESI_DEFAULT_SDK_VERSION = "0.6.2";
15
+ const CARTESI_DEFAULT_SDK_VERSION = "0.9.0";
16
16
  class BuildApplication extends BaseCommand {
17
17
  /**
18
18
  * Build DApp image (linux/riscv64). Returns image id.
@@ -5,7 +5,7 @@ export default class Run extends BaseCommand<typeof Run> {
5
5
  static examples: string[];
6
6
  static flags: {
7
7
  "block-time": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- "epoch-duration": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ "epoch-length": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
9
  "no-backend": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
10
  verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
11
11
  "listen-port": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -23,13 +23,13 @@ class Run extends BaseCommand {
23
23
  const binPath = path.join(path.dirname(new URL(import.meta.url).pathname), "..");
24
24
  // setup the environment variable used in docker compose
25
25
  const blockInterval = flags["block-time"];
26
- const epochDuration = flags["epoch-duration"];
26
+ const epochLength = flags["epoch-length"];
27
27
  const listenPort = flags["listen-port"];
28
28
  const env = {
29
29
  ANVIL_VERBOSITY: flags.verbose ? "--steps-tracing" : "--silent",
30
30
  BLOCK_TIME: blockInterval.toString(),
31
31
  BLOCK_TIMEOUT: (blockInterval + 3).toString(),
32
- CARTESI_EPOCH_DURATION: epochDuration.toString(),
32
+ CARTESI_EPOCH_LENGTH: epochLength.toString(),
33
33
  CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG: flags.verbose
34
34
  ? "false"
35
35
  : "true",
@@ -115,9 +115,9 @@ Run.flags = {
115
115
  description: "interval between blocks (in seconds)",
116
116
  default: 5,
117
117
  }),
118
- "epoch-duration": Flags.integer({
119
- description: "duration of an epoch (in seconds)",
120
- default: 3600,
118
+ "epoch-length": Flags.integer({
119
+ description: "length of an epoch (in blocks)",
120
+ default: 720,
121
121
  }),
122
122
  "no-backend": Flags.boolean({
123
123
  description: "Run a node without the application code. Application must be executed by the developer on the host machine, fetching inputs from the node running at http://localhost:5004",
@@ -11,7 +11,7 @@ class Shell extends BaseCommand {
11
11
  const ext2 = path.join(containerDir, path.basename(ext2Path));
12
12
  const ramSize = "128Mi";
13
13
  const driveLabel = "root";
14
- const sdkImage = "cartesi/sdk:0.6.0"; // XXX: how to resolve sdk version?
14
+ const sdkImage = "cartesi/sdk:0.9.0"; // XXX: how to resolve sdk version?
15
15
  const args = [
16
16
  "run",
17
17
  "--interactive",
@@ -1,4 +1,4 @@
1
- FROM cartesi/rollups-node:1.4.0
1
+ FROM cartesi/rollups-node:1.5.0
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}
@@ -6,14 +6,13 @@ CARTESI_HTTP_PORT="${CARTESI_HTTP_PORT:-10000}"
6
6
  CARTESI_FEATURE_HOST_MODE="${CARTESI_FEATURE_HOST_MODE:-false}"
7
7
  CARTESI_FEATURE_READER_MODE="${CARTESI_FEATURE_READER_MODE:-false}"
8
8
  CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK="${CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK:-true}"
9
- CARTESI_EPOCH_DURATION="${CARTESI_EPOCH_DURATION:-3600}"
9
+ CARTESI_EPOCH_LENGTH="${CARTESI_EPOCH_LENGTH:-720}"
10
10
  CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
11
11
  CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
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
15
  CARTESI_CONTRACTS_APPLICATION_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_ADDRESS:-0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e}"
16
- CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER:-22}"
17
16
  CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-22}"
18
17
  CARTESI_CONTRACTS_HISTORY_ADDRESS="${CARTESI_CONTRACTS_HISTORY_ADDRESS:-0x325272217ae6815b494bf38ced004c5eb8a7cda7}"
19
18
  CARTESI_CONTRACTS_AUTHORITY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_ADDRESS:-0x58c93f83fb3304730c95aad2e360cdb88b782010}"
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  anvil:
3
- image: cartesi/sdk:0.6.0
3
+ image: cartesi/sdk:0.9.0
4
4
  command:
5
5
  [
6
6
  "devnet",
@@ -19,7 +19,7 @@ services:
19
19
  - 8545:8545
20
20
 
21
21
  dapp_deployer:
22
- image: cartesi/sdk:0.6.0
22
+ image: cartesi/sdk:0.9.0
23
23
  restart: on-failure
24
24
  depends_on:
25
25
  anvil:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  validator:
3
- image: cartesi/rollups-node:1.4.0
3
+ image: cartesi/rollups-node:1.5.0
4
4
  depends_on:
5
5
  dapp_deployer:
6
6
  condition: service_completed_successfully
@@ -222,10 +222,10 @@
222
222
  "multiple": false,
223
223
  "type": "option"
224
224
  },
225
- "epoch-duration": {
226
- "description": "duration of an epoch (in seconds)",
227
- "name": "epoch-duration",
228
- "default": 3600,
225
+ "epoch-length": {
226
+ "description": "length of an epoch (in blocks)",
227
+ "name": "epoch-length",
228
+ "default": 720,
229
229
  "hasDynamicHelp": false,
230
230
  "multiple": false,
231
231
  "type": "option"
@@ -883,5 +883,5 @@
883
883
  ]
884
884
  }
885
885
  },
886
- "version": "0.14.3"
886
+ "version": "0.15.0"
887
887
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "0.14.3",
3
+ "version": "0.15.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.6",
22
- "@inquirer/core": "^8.1.0",
23
- "@inquirer/input": "^2.1.6",
24
- "@inquirer/select": "^2.3.2",
25
- "@inquirer/type": "^1.3.1",
26
- "@oclif/core": "^3.26.5",
27
- "@oclif/plugin-help": "^6.0.21",
28
- "@oclif/plugin-plugins": "^5.0.17",
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
29
  "bytes": "^3.1",
30
30
  "chalk": "^5.3.0",
31
- "execa": "^8.0",
31
+ "cli-table3": "^0.6.5",
32
+ "execa": "^9.3.0",
32
33
  "fs-extra": "^11",
33
34
  "giget": "^1.2.3",
34
35
  "lookpath": "^1.2.2",
35
36
  "open": "^10.1.0",
36
37
  "ora": "^8.0.1",
37
38
  "progress-stream": "^2.0",
38
- "semver": "^7.5",
39
+ "semver": "^7.6.3",
39
40
  "tmp": "^0.2.3",
40
- "viem": "^2.9.29"
41
+ "viem": "^2.18.2"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@sunodo/wagmi-plugin-hardhat-deploy": "^0.3.0",
44
45
  "@types/bytes": "^3.1",
45
46
  "@types/fs-extra": "^11",
46
47
  "@types/inquirer": "^9",
47
- "@types/node": "^20.14.10",
48
+ "@types/node": "^20.14.12",
48
49
  "@types/node-fetch": "^2.6",
49
50
  "@types/progress-stream": "^2.0",
50
51
  "@types/prompts": "^2.4",
51
52
  "@types/semver": "^7.5.8",
52
53
  "@types/tmp": "^0.2",
53
- "@wagmi/cli": "^2.1.4",
54
+ "@wagmi/cli": "^2.1.15",
54
55
  "copyfiles": "^2",
55
56
  "eslint": "^8.57.0",
56
- "eslint-config-oclif": "^5.1.3",
57
- "eslint-config-oclif-typescript": "^3.1.7",
57
+ "eslint-config-oclif": "^5.2.0",
58
+ "eslint-config-oclif-typescript": "^3.1.8",
58
59
  "npm-run-all": "^4",
59
- "oclif": "^4.9.3",
60
- "rimraf": "^5.0.8",
60
+ "oclif": "^4.14.9",
61
+ "rimraf": "^6.0.1",
61
62
  "ts-node": "^10",
62
63
  "tslib": "^2.6.3",
63
- "typescript": "^5.5.3",
64
- "vitest": "^1.5.3",
65
- "@cartesi/devnet": "1.7.0",
64
+ "typescript": "^5.5.4",
65
+ "vitest": "^2.0.4",
66
+ "@cartesi/devnet": "1.8.0",
66
67
  "@cartesi/eslint-config": "0.0.0",
67
68
  "tsconfig": "0.0.0"
68
69
  },