Skip to content

Conversation

@tuler
Copy link
Member

@tuler tuler commented Jan 9, 2026

This PR removes cannon from devnet build process.
Now it downloads cartesi anvil state from GitHub release, deploy devnet contracts (tokens), and dump a new state.

@tuler tuler requested a review from endersonmaia January 9, 2026 01:27
@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

🦋 Changeset detected

Latest commit: e34daba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cartesi/devnet Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tuler tuler force-pushed the feature/devnet-no-cannon branch 2 times, most recently from e9f41d8 to 5f63dcb Compare January 9, 2026 05:17
@tuler
Copy link
Member Author

tuler commented Jan 9, 2026

This still must be improved quite a bit.

I think the content of the devnet package must be the same as it is now, a state dump and deployment files, one for each contract, with at least address, contractName and abi in it. Which is not what is in the Dave distribution file.

If we don't do that it will complicate the cli side, which uses wagmi to process deployment information.

@tuler tuler force-pushed the feature/devnet-no-cannon branch from 5f63dcb to 30a7fc9 Compare January 10, 2026 05:14
@tuler tuler marked this pull request as ready for review January 10, 2026 05:18
@tuler tuler requested a review from endersonmaia January 10, 2026 05:18
@endersonmaia
Copy link
Contributor

If I run with the wrong anvil version, the script fails to start anvil but keeps trying, and doesn't say that the problem is the version.

After installing the correct 1.4.3 version, I get this error:

@cartesi/devnet:build: $ bun build.ts
✔ Anvil version 1.4.3 is installed
✔ Anvil version 1.4.3 is installed
@cartesi/devnet:build: ✔ Download dependencies
@cartesi/devnet:build: ✔ Anvil started (PID: 100608)
@cartesi/devnet:build: ✔ Contracts deployed
@cartesi/devnet:build: ✔ Generating artifacts
@cartesi/devnet:build: ✖ Anvil exited with code 1
@cartesi/devnet:build: error: script "build:dump" exited with code 1
@cartesi/devnet:build: ERROR: "build:dump" exited with 1.
@cartesi/devnet:build: error: script "build" exited with code 1
@cartesi/devnet:build: ERROR: command finished with error: command (/home/endersonmaia/Work/cartesi/cli/packages/devnet) /usr/bin/bun run build exited (1)
@cartesi/devnet#build: command (/home/endersonmaia/Work/cartesi/cli/packages/devnet) /usr/bin/bun run build exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    1.505s
Failed:    @cartesi/devnet#build

 ERROR  run failed: command  exited (1)

@endersonmaia
Copy link
Contributor

If I run with the wrong anvil version, the script fails to start anvil but keeps trying, and doesn't say that the problem is the version.

After installing the correct 1.4.3 version, I get this error:

@cartesi/devnet:build: $ bun build.ts
✔ Anvil version 1.4.3 is installed
✔ Anvil version 1.4.3 is installed
@cartesi/devnet:build: ✔ Download dependencies
@cartesi/devnet:build: ✔ Anvil started (PID: 100608)
@cartesi/devnet:build: ✔ Contracts deployed
@cartesi/devnet:build: ✔ Generating artifacts
@cartesi/devnet:build: ✖ Anvil exited with code 1
@cartesi/devnet:build: error: script "build:dump" exited with code 1
@cartesi/devnet:build: ERROR: "build:dump" exited with 1.
@cartesi/devnet:build: error: script "build" exited with code 1
@cartesi/devnet:build: ERROR: command finished with error: command (/home/endersonmaia/Work/cartesi/cli/packages/devnet) /usr/bin/bun run build exited (1)
@cartesi/devnet#build: command (/home/endersonmaia/Work/cartesi/cli/packages/devnet) /usr/bin/bun run build exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    1.505s
Failed:    @cartesi/devnet#build

 ERROR  run failed: command  exited (1)

For some reason, there was an existing anvil process running and that was the issue.

After killing all anvil processes, I manage to run the build successfully.

Copy link
Contributor

@endersonmaia endersonmaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cartesi/devnet build works

BUT @cartesi/cli is failling

@cartesi/cli:build: $ bun build.ts
@cartesi/cli:build: 2 |     daveAppFactoryAddress,
@cartesi/cli:build:         ^
@cartesi/cli:build: error: No matching export in "src/contracts.ts" for import "daveAppFactoryAddress"
@cartesi/cli:build:     at /home/endersonmaia/Work/cartesi/cli/apps/cli/src/compose/node.ts:2:5
@cartesi/cli:build:
@cartesi/cli:build: 3 |     inputBoxAddress,
@cartesi/cli:build:         ^
@cartesi/cli:build: error: No matching export in "src/contracts.ts" for import "inputBoxAddress"
@cartesi/cli:build:     at /home/endersonmaia/Work/cartesi/cli/apps/cli/src/compose/node.ts:3:5
@cartesi/cli:build:
@cartesi/cli:build: 4 |     selfHostedApplicationFactoryAddress,
@cartesi/cli:build:         ^
@cartesi/cli:build: error: No matching export in "src/contracts.ts" for import "selfHostedApplicationFactoryAddress"
@cartesi/cli:build:     at /home/endersonmaia/Work/cartesi/cli/apps/cli/src/compose/node.ts:4:5
@cartesi/cli:build:
@cartesi/cli:build: Bun v1.3.5 (Linux x64)
@cartesi/cli:build: error: script "compile" exited with code 1
@cartesi/cli:build: ERROR: "compile" exited with 1.
@cartesi/cli:build: error: script "build" exited with code 1
@cartesi/cli:build: ERROR: command finished with error: command (/home/endersonmaia/Work/cartesi/cli/apps/cli) /usr/bin/bun run build exited (1)
@cartesi/cli#build: command (/home/endersonmaia/Work/cartesi/cli/apps/cli) /usr/bin/bun run build exited (1)

I'm assuming that this will be solved on another PR.

@tuler
Copy link
Member Author

tuler commented Jan 12, 2026

I'm assuming that this will be solved on another PR.

Yes, the CLI will need a small change to work. I have it ready to commit.

It is strange that the cli is resolving the dependency of "2.0.0-alpha.8" to the workspace project instead of the published version. Because it is not marked as "workspace:*".

@endersonmaia
Copy link
Contributor

It is strange that the cli is resolving the dependency of "2.0.0-alpha.8" to the workspace project instead of the published version. Because it is no marked as "workspace:*".

Maybe Bun workspaces works a little differente from turbo's.

@github-actions
Copy link
Contributor

Coverage Report for ./apps/cli

Status Category Percentage Covered / Total
🔵 Lines 90.56% 288 / 318
🔵 Statements 90.15% 293 / 325
🔵 Functions 91.22% 52 / 57
🔵 Branches 74.17% 112 / 151
File CoverageNo changed files found.
Generated in workflow #741 for commit e34daba by the Vitest Coverage Report Action

@tuler tuler merged commit 708887e into feature/bun Jan 12, 2026
5 checks passed
@tuler tuler deleted the feature/devnet-no-cannon branch January 12, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants