Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6c6dbbd
fix(cli): accept a 0x-prefixed cartesi-machine stored hash
brunomenezes Oct 3, 2026
4cce627
chore(cli): require cartesi-machine 0.21.0
brunomenezes Oct 3, 2026
5b4bfa1
test(cli): allow overriding the sdk image used in integration tests
brunomenezes Oct 3, 2026
3b3b1d6
test(cli): build temporary apps with the sdk image the readers use
brunomenezes Oct 3, 2026
e1ffb99
refactor(cli): generate contracts with @cartesi/wagmi-plugin
brunomenezes Aug 19, 2026
3c9f66e
feat(cli): add TestUsdc, RefundOutputBuilder and UsdWithdrawalOutputB…
brunomenezes Aug 19, 2026
7c1d8fe
fix(cli): use the renamed portal deposit function names
brunomenezes Sep 29, 2026
96df6fe
fix(cli): probe portals with version in fork validation
brunomenezes Sep 29, 2026
d22ace1
fix(cli): pass the new calculateDaveAppAddress arguments
brunomenezes Sep 29, 2026
8f9348d
test(cli): assert the probed function names in fork validation
brunomenezes Sep 29, 2026
218191d
chore(cli): bump @cartesi/wagmi-plugin to 1.0.0-alpha.7
brunomenezes Sep 29, 2026
c0a00b0
chore(cli): exclude the PRT internal contracts from codegen
brunomenezes Oct 2, 2026
51466d3
refactor(cli): widen application status and expose reason from app list
brunomenezes Sep 24, 2026
101ca0c
test(cli): cover app list parsing in exec/rollups
brunomenezes Sep 24, 2026
02e3c1d
feat(cli): warn when an application leaves the OK state during run
brunomenezes Sep 24, 2026
fca98aa
feat(cli): highlight non-OK application states in the status command
brunomenezes Sep 24, 2026
05f60e9
fix(cli): bound the wait for healthy services
brunomenezes Sep 24, 2026
2b3a6f5
fix(cli): stop waiting when a service container has exited
brunomenezes Sep 24, 2026
cb4f022
feat(cli): always pass the PRT auth mnemonic to the node
brunomenezes Sep 24, 2026
ce2ef37
feat(cli): allow overriding the node's PRT auth variables
brunomenezes Sep 24, 2026
e3b01d3
test(cli): cover node startup against the compose environment
brunomenezes Oct 2, 2026
da31af4
feat(cli): allow overriding the node's claimer auth variables
brunomenezes Oct 3, 2026
6e69d4f
fix(cli): pass the claim staging period for every consensus type
brunomenezes Oct 3, 2026
1b2a6f3
fix(cli): hash the machine snapshot with the project sdk image
brunomenezes Oct 2, 2026
3590041
ci(cli): stop installing foundry in the cli workflow
brunomenezes Oct 3, 2026
1840fd7
chore(cli): bump the default sdk to 0.12.0-alpha.43
brunomenezes Oct 5, 2026
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/brave-foxes-climb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Pass `--claim-staging-period` to the node for every consensus type. It was dropped when deploying with `--prt`, so a value given alongside that flag was silently ignored.
5 changes: 5 additions & 0 deletions .changeset/busy-bags-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Add `TestUsdc` to the devnet address book, and `RefundOutputBuilder` and `UsdWithdrawalOutputBuilderFactory` to the common one.
5 changes: 5 additions & 0 deletions .changeset/busy-olives-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Read the machine snapshot hash with the project's SDK image. Without a local `cartesi-machine-stored-hash`, `cartesi run`, `cartesi hash` and the commands that look up the deployed application read the snapshot in the default SDK image, whose emulator may not load a snapshot built by the `sdk` configured in `cartesi.toml`.
5 changes: 5 additions & 0 deletions .changeset/eleven-actors-spend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Fix `cartesi deposit` for ERC-20, ERC-721 and ERC-1155 against the renamed portal functions.
5 changes: 5 additions & 0 deletions .changeset/great-doors-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Warn in `cartesi run` when the application stops being healthy, reporting the node's reason instead of letting it go quiet while inputs keep being accepted on-chain.
5 changes: 5 additions & 0 deletions .changeset/lemon-geese-wander.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Allow the node's six `CARTESI_AUTH_*` claimer variables to be overridden from the host environment, matching the PRT set. Without `CARTESI_AUTH_KIND` only plain-mnemonic signing was reachable.
5 changes: 5 additions & 0 deletions .changeset/lucky-birds-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Colour the application status in `cartesi status`, distinguishing the recoverable `FAILED` state from the terminal ones, and print the node's reason beneath the table.
5 changes: 5 additions & 0 deletions .changeset/olive-games-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Stop waiting for a service whose container has exited, so a crash loop reports immediately instead of retrying until the timeout.
5 changes: 5 additions & 0 deletions .changeset/olive-moons-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Recognize the four terminal application states the node reports (`GUEST_EXCEPTION`, `MACHINE_HALTED`, `MCYCLE_OVERFLOW`, `UNEXPECTED_YIELD`) and surface the node's `reason` diagnostic alongside them.
5 changes: 5 additions & 0 deletions .changeset/plenty-moons-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Bump the default SDK to `0.12.0-alpha.43`, which carries cartesi-machine 0.21 and rollups-node 2.0.0-alpha.13.
5 changes: 5 additions & 0 deletions .changeset/quiet-pugs-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Bound the wait for services to become healthy. The backoff had no upper limit, so a service that never started held `cartesi run` for up to 19 hours instead of failing.
5 changes: 5 additions & 0 deletions .changeset/rotten-roses-write.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Fix fork validation against rollups-contracts 3.0.0-alpha.10 and dave 3.0.0-alpha.5.
5 changes: 5 additions & 0 deletions .changeset/shiny-hounds-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Pass the devnet mnemonic to the node as `CARTESI_PRT_AUTH_MNEMONIC`. The node starts its PRT service on every run and, with claim submission enabled by default, that service requires its own signer, for which PRT has no default.
5 changes: 5 additions & 0 deletions .changeset/thick-experts-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Generate contracts from the rollups-contracts and dave releases instead of `@cartesi/devnet`.
5 changes: 5 additions & 0 deletions .changeset/tidy-pears-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

Allow the node's six `CARTESI_PRT_AUTH_*` variables to be overridden from the host environment.
5 changes: 0 additions & 5 deletions .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1.9.1
with:
version: v1.4.3

- name: Install dependencies
run: bun install --frozen-lockfile

Expand Down
3 changes: 1 addition & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"yaml": "^2.8.2"
},
"devDependencies": {
"@cartesi/devnet": "2.0.0-alpha.15",
"@sunodo/wagmi-plugin-hardhat-deploy": "^0.4.0",
"@cartesi/wagmi-plugin": "1.0.0-alpha.7",
"@types/bun": "^1.3.6",
"@types/bytes": "^3.1.5",
"@types/fs-extra": "^11.0.4",
Expand Down
39 changes: 36 additions & 3 deletions apps/cli/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ import {
erc721PortalAddress,
etherPortalAddress,
inputBoxAddress,
refundOutputBuilderAddress,
selfHostedApplicationFactoryAddress,
testFungibleTokenAddress,
testMultiTokenAddress,
testNonFungibleTokenAddress,
testUsdcAddress,
testUsdWithdrawalOutputBuilderAddress,
usdWithdrawalOutputBuilderFactoryAddress,
} from "./contracts.js";
import { cartesiMachineStoredHash } from "./exec";
import { getApplicationAddress, getForkConfig } from "./exec/rollups.js";
Expand All @@ -37,11 +40,34 @@ export const getContextPath = (...paths: string[]): string => {
return path.join(".cartesi", ...paths);
};

export const getMachineHash = async (): Promise<Hash | undefined> => {
// read hash of the cartesi machine snapshot, if one exists
/**
* SDK image of the project, which built its machine snapshot
*/
const getProjectSdk = (): string | undefined => {
try {
return getApplicationConfig(["cartesi.toml"]).sdk;
} catch {
// an invalid config is reported by the commands that build with it
return undefined;
}
};

/**
* Read the hash of the cartesi machine snapshot, if one exists. Without a
* local cartesi-machine-stored-hash, it runs in the SDK image the snapshot was
* built with, as an emulator of another version may not load it.
* @param options sdk image of the project, read from cartesi.toml if not given
*/
export const getMachineHash = async (options?: {
sdk?: string;
}): Promise<Hash | undefined> => {
const imagePath = getContextPath("image");
if (fs.existsSync(imagePath)) {
return await cartesiMachineStoredHash.computeHash(imagePath);
const image = options?.sdk ?? getProjectSdk();
return await cartesiMachineStoredHash.computeHash(
imagePath,
image ? { image } : undefined,
);
}
return undefined;
};
Expand Down Expand Up @@ -118,6 +144,7 @@ export const getAddressBook = async (options: {
TestToken: testFungibleTokenAddress,
TestNFT: testNonFungibleTokenAddress,
TestMultiToken: testMultiTokenAddress,
TestUsdc: testUsdcAddress,
TestUsdWithdrawalOutputBuilder: testUsdWithdrawalOutputBuilderAddress,
};

Expand All @@ -132,7 +159,10 @@ export const getAddressBook = async (options: {
ERC721Portal: erc721PortalAddress,
EtherPortal: etherPortalAddress,
InputBox: inputBoxAddress,
RefundOutputBuilder: refundOutputBuilderAddress,
SelfHostedApplicationFactory: selfHostedApplicationFactoryAddress,
UsdWithdrawalOutputBuilderFactory:
usdWithdrawalOutputBuilderFactoryAddress,
};

// gather all contracts, depending whether is fork or devnet
Expand Down Expand Up @@ -166,6 +196,9 @@ export const getServiceInfo = async (options: {
"--project-name",
projectName,
"ps",
// --all so an exited container is still reported, instead of the
// service simply vanishing from the output
"--all",
service,
"--format",
"json",
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/src/commands/deposit/erc1155.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const createErc1155SingleCommand = () => {
abi: erc1155SinglePortalAbi,
account,
address: erc1155SinglePortalAddress,
functionName: "depositSingleERC1155Token",
functionName: "depositSingleErc1155Token",
args: [
token.address,
application,
Expand Down Expand Up @@ -311,7 +311,7 @@ export const createErc1155BatchCommand = () => {
abi: erc1155BatchPortalAbi,
account,
address: erc1155BatchPortalAddress,
functionName: "depositBatchERC1155Token",
functionName: "depositBatchErc1155Token",
args: [
token.address,
application,
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/commands/deposit/erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const createErc20Command = () => {
abi: erc20PortalAbi,
account,
address: erc20PortalAddress,
functionName: "depositERC20Tokens",
functionName: "depositErc20Tokens",
args: [token.address, application, amount, execLayerData],
});

Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/commands/deposit/erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const createErc721Command = () => {
abi: erc721PortalAbi,
account,
address: erc721PortalAddress,
functionName: "depositERC721Token",
functionName: "depositErc721Token",
args: [
token.address,
application,
Expand Down
Loading
Loading