Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump node to 1.5.0 #35

Merged
merged 8 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/four-eagles-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": minor
---

bump node to 1.5.0, change epoch duration semantics and option name
39 changes: 20 additions & 19 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@
"/oclif.manifest.json"
],
"dependencies": {
"@inquirer/confirm": "^3.1.6",
"@inquirer/core": "^8.1.0",
"@inquirer/input": "^2.1.6",
"@inquirer/select": "^2.3.2",
"@inquirer/type": "^1.3.1",
"@oclif/core": "^3.26.5",
"@oclif/plugin-help": "^6.0.21",
"@oclif/plugin-plugins": "^5.0.17",
"@inquirer/confirm": "^3.1.17",
"@inquirer/core": "^9.0.5",
"@inquirer/input": "^2.2.4",
"@inquirer/select": "^2.4.2",
"@inquirer/type": "^1.5.1",
"@oclif/core": "^4.0.14",
"@oclif/plugin-help": "^6.2.7",
"@oclif/plugin-plugins": "^5.3.9",
"bytes": "^3.1",
"chalk": "^5.3.0",
"execa": "^8.0",
"cli-table3": "^0.6.5",
"execa": "^9.3.0",
"fs-extra": "^11",
"giget": "^1.2.3",
"lookpath": "^1.2.2",
"open": "^10.1.0",
"ora": "^8.0.1",
"progress-stream": "^2.0",
"semver": "^7.5",
"semver": "^7.6.3",
"tmp": "^0.2.3",
"viem": "^2.9.29"
"viem": "^2.18.2"
},
"devDependencies": {
"@cartesi/devnet": "workspace:*",
Expand All @@ -46,25 +47,25 @@
"@types/bytes": "^3.1",
"@types/fs-extra": "^11",
"@types/inquirer": "^9",
"@types/node": "^20.14.10",
"@types/node": "^20.14.12",
"@types/node-fetch": "^2.6",
"@types/progress-stream": "^2.0",
"@types/prompts": "^2.4",
"@types/semver": "^7.5.8",
"@types/tmp": "^0.2",
"@wagmi/cli": "^2.1.4",
"@wagmi/cli": "^2.1.15",
"copyfiles": "^2",
"eslint": "^8.57.0",
"eslint-config-oclif": "^5.1.3",
"eslint-config-oclif-typescript": "^3.1.7",
"eslint-config-oclif": "^5.2.0",
"eslint-config-oclif-typescript": "^3.1.8",
"npm-run-all": "^4",
"oclif": "^4.9.3",
"rimraf": "^5.0.8",
"oclif": "^4.14.9",
"rimraf": "^6.0.1",
"ts-node": "^10",
"tsconfig": "workspace:*",
"tslib": "^2.6.3",
"typescript": "^5.5.3",
"vitest": "^1.5.3"
"typescript": "^5.5.4",
"vitest": "^2.0.4"
},
"oclif": {
"bin": "cartesi",
Expand Down
32 changes: 24 additions & 8 deletions apps/cli/src/commands/address-book.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ux } from "@oclif/core";
import Table from "cli-table3";

import { AddressBook as AddressBookType, BaseCommand } from "../baseCommand.js";

Expand All @@ -16,13 +16,29 @@ export default class AddressBook extends BaseCommand<typeof AddressBook> {
const addressBook = await super.getAddressBook();
if (!this.jsonEnabled()) {
// print as a table
ux.table(
Object.entries(addressBook).map(([name, address]) => ({
name,
address,
})),
{ name: { header: "Contract" }, address: {} },
);
const table = new Table({
head: ["Contract", "Address"],
chars: {
top: "",
"top-mid": "",
"top-left": "",
"top-right": "",
bottom: "",
"bottom-mid": "",
"bottom-left": "",
"bottom-right": "",
left: "",
"left-mid": "",
mid: "",
"mid-mid": "",
right: "",
"right-mid": "",
middle: " ",
},
style: { "padding-left": 0, "padding-right": 0 },
});
table.push(...Object.entries(addressBook));
console.log(table.toString());
}
// return (as json)
return addressBook;
Expand Down
10 changes: 5 additions & 5 deletions apps/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
description: "interval between blocks (in seconds)",
default: 5,
}),
"epoch-duration": Flags.integer({
description: "duration of an epoch (in seconds)",
default: 3600,
"epoch-length": Flags.integer({
description: "length of an epoch (in blocks)",
default: 720,
endersonmaia marked this conversation as resolved.
Show resolved Hide resolved
}),
"no-backend": Flags.boolean({
description:
Expand Down Expand Up @@ -64,13 +64,13 @@

// setup the environment variable used in docker compose
const blockInterval = flags["block-time"];
const epochDuration = flags["epoch-duration"];
const epochLength = flags["epoch-length"];
const listenPort = flags["listen-port"];
const env: NodeJS.ProcessEnv = {
ANVIL_VERBOSITY: flags.verbose ? "--steps-tracing" : "--silent",
BLOCK_TIME: blockInterval.toString(),
BLOCK_TIMEOUT: (blockInterval + 3).toString(),
CARTESI_EPOCH_DURATION: epochDuration.toString(),
CARTESI_EPOCH_LENGTH: epochLength.toString(),
CARTESI_EXPERIMENTAL_DISABLE_CONFIG_LOG: flags.verbose
? "false"
: "true",
Expand Down Expand Up @@ -147,7 +147,7 @@
});
} catch (e: unknown) {
// 130 is a graceful shutdown, so we can swallow it
if ((e as any).exitCode !== 130) {

Check warning on line 150 in apps/cli/src/commands/run.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
throw e;
}
} finally {
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/node/DockerfileDeploy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cartesi/rollups-node:1.4.0
FROM cartesi/rollups-node:1.5.0
ENV CARTESI_SNAPSHOT_DIR=/usr/share/rollups-node/snapshot
ENV CARTESI_HTTP_ADDRESS=0.0.0.0
COPY --chown=cartesi:cartesi . ${CARTESI_SNAPSHOT_DIR}
3 changes: 1 addition & 2 deletions apps/cli/src/node/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ CARTESI_HTTP_PORT="${CARTESI_HTTP_PORT:-10000}"
CARTESI_FEATURE_HOST_MODE="${CARTESI_FEATURE_HOST_MODE:-false}"
CARTESI_FEATURE_READER_MODE="${CARTESI_FEATURE_READER_MODE:-false}"
CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK="${CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK:-true}"
CARTESI_EPOCH_DURATION="${CARTESI_EPOCH_DURATION:-3600}"
CARTESI_EPOCH_LENGTH="${CARTESI_EPOCH_LENGTH:-720}"
CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
CARTESI_BLOCKCHAIN_IS_LEGACY="${CARTESI_BLOCKCHAIN_IS_LEGACY:-false}"
CARTESI_BLOCKCHAIN_FINALITY_OFFSET="${CARTESI_BLOCKCHAIN_FINALITY_OFFSET:-0}"
CARTESI_CONTRACTS_APPLICATION_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_ADDRESS:-0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e}"
CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER:-22}"
CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-22}"
CARTESI_CONTRACTS_HISTORY_ADDRESS="${CARTESI_CONTRACTS_HISTORY_ADDRESS:-0x325272217ae6815b494bf38ced004c5eb8a7cda7}"
CARTESI_CONTRACTS_AUTHORITY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_ADDRESS:-0x58c93f83fb3304730c95aad2e360cdb88b782010}"
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/node/docker-compose-validator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
validator:
image: cartesi/rollups-node:1.4.0
image: cartesi/rollups-node:1.5.0
depends_on:
dapp_deployer:
condition: service_completed_successfully
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"devDependencies": {
"@cartesi/eslint-config": "workspace:*",
"@changesets/cli": "^2.27.7",
"prettier": "^3.3.2",
"turbo": "^2.0.6"
"prettier": "^3.3.3",
"turbo": "^2.0.7"
},
"engines": {
"node": ">=18.0.0"
},
"packageManager": "pnpm@9.5.0"
"packageManager": "pnpm@9.6.0"
}
10 changes: 5 additions & 5 deletions packages/devnet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"devDependencies": {
"@cartesi/rollups": "^1.4.0",
"@nomicfoundation/hardhat-viem": "^2.0.3",
"@safe-global/safe-singleton-factory": "^1.0.28",
"@types/node": "^20.14.10",
"@safe-global/safe-singleton-factory": "^1.0.30",
"@types/node": "^20.14.11",
"hardhat": "^2.22.6",
"hardhat-abi-exporter": "^2",
"hardhat-deploy": "^0.12.4",
"npm-run-all": "^4",
"rimraf": "^5.0.8",
"rimraf": "^6.0.1",
"tsconfig": "workspace:*",
"typescript": "^5.5.3",
"viem": "^2.17.5"
"typescript": "^5.5.4",
"viem": "^2.18.2"
},
"dependencies": {
"@openzeppelin/contracts": "5.0.2"
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"license": "Apache-2.0",
"private": true,
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@vercel/style-guide": "^6.0.0",
"eslint-config-prettier": "^9",
"eslint-config-turbo": "^2.0.6",
"eslint-config-turbo": "^2.0.7",
"eslint-plugin-only-warn": "^1",
"typescript": "^5.5.3"
"typescript": "^5.5.4"
},
"files": [
"library.js",
Expand Down
Loading
Loading