Skip to content

Conversation

@br0wnD3v
Copy link

This pull request adds Zeko L2 scaffold support to zkapp-cli, complementing the existing Mina scaffold functionality.
Problem: Developers currently have no quick way to bootstrap Zeko L2 projects, unlike Mina projects which have scaffold support in zkapp-cli.
Solution: This PR enables developers to generate Zeko L2 project templates through the same zkapp-cli tool they already use for Mina development.

Benefits:
Streamlines Zeko L2 onboarding for developers familiar with Mina tooling
Provides a consistent developer experience across both Mina and its L2
Reduces friction for developers wanting to build on Zeko's faster L2 while staying in the Mina ecosystem

This addition supports the broader goal of growing both the Mina and Zeko developer communities by making it easier to get started with L2 development.

@45930
Copy link
Contributor

45930 commented Sep 24, 2025

@br0wnD3v why does there need to be an entire new template just for zeko? I was thinking zeko could be added more simply to the list of supported networks in the config command:

image

Using --zeko and creating a separate template project means we need to maintain both templates separately, but they ought to be 100% compatible, so I'd guess we can use one template that works on both. WDYT?

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.86%. Comparing base (c0e6f2a) to head (3a20b8a).

Files with missing lines Patch % Lines
src/lib/config.js 84.61% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #744      +/-   ##
===========================================
- Coverage   100.00%   99.86%   -0.14%     
===========================================
  Files           11       11              
  Lines         1492     1504      +12     
  Branches       304      308       +4     
===========================================
+ Hits          1492     1502      +10     
- Misses           0        2       +2     
Flag Coverage Δ
unittests 99.86% <85.71%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@br0wnD3v
Copy link
Author

br0wnD3v commented Sep 25, 2025

@45930 Hello sir, your suggestion is actually pretty good, I might have completely overengineered something that could have been done with proabaly 5-10 lines of code xD Thank you for the guidance

Copy link
Contributor

@45930 45930 left a comment

Choose a reason for hiding this comment

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

This still feels bolted on, rather than cohesive with the zkapp-cli.

I ran the CLI with the --zeko flag, and it generates a project scaffold an prints this:

Zeko L2 Devnet configuration added successfully!

Zeko L2 Benefits:
  - ~10 second finality (vs Mina L1's 3 minutes)
  - Higher throughput with unlimited account updates
  - Full o1js compatibility - same code works on both layers
  - Bridge functionality for seamless L1 <-> L2 transfers

Added files:
  - src/bridge-example.ts - L1 <-> L2 bridge interaction example
  - Updated config.json with zeko-devnet deployment alias

Next steps:
  - To deploy to Zeko L2 Devnet: zk deploy zeko-devnet
  - Run the bridge example: npm run build && node build/src/bridge-example.js

But from here, zk deploy has an error:

zk deploy zeko-devnet
✔ Build project
⠋ Generate build.json...Module 'node:test' not found in the './node_modules' directory.
Module 'node:test' not found in the './node_modules' directory.
Module 'node:test' not found in the './node_modules' directory.
Module 'node:test' not found in the './node_modules' directory.
Module 'node:assert' not found in the './node_modules' directory.
✔ Generate build.json
✔ Choose smart contract
  Only one smart contract exists in the project: Add
  Your config.json was updated to always use this
  smart contract when deploying to this deploy alias.
  Failed to find the feepayer private key.
  Please make sure your config.json has the correct 'feepayerKeyPath' property.

Scaffodling the project with zeko doesn't create a keys/ dir, so the deploy script doesn't work. Normally we run zk config to configure a new wallet for deployment, but that command still doesn't support zeko:

image

So overall, it feels like this flow doesn't fit in at all with the flow for Mina projects, even though there's no fundamental reason why it would have to be a different flow.

Here is how I would expect this feature to work:

  • User runs zk p MyZekoProject and all the scaffolding gets run the same way (literally not different at all thant the existing zk p command).
  • User runs zk config and selects Zeko Testnet from the list of networks, which automatically configures the zeko graphQL endpoints (I like this change from you, I think we should do the same for the Mina mainnet and devnet networks!), and we print
Next steps:
  - If this is the testnet, request tMINA at: https://zeko.io/faucet/
  - To deploy zkApp, run: `zk deploy zeko-testnet`
  • Config is properly set in config.json for the zeko-testnet key
  • User runs zk deploy zeko-testnet, and just like zk p, there is actually no change. We just use the Zeko graphQL from the config instead of the Mina graphQL

Maybe there are some minor exceptions, but the only major changes here should be in the zk config flow.

Perhaps to create the zeko-specific bridge contract example, you can modify the zk example command to accept "zeko bridge" as a valid string. This would require some work, but could be a follow-up PR. If you really want to get the bridge example in, then I suggest you create a new script, rather than overloading the project script, and still keep all the zeko-specific changes scoped to the config script, which is where network differences should be manifested.

@br0wnD3v
Copy link
Author

br0wnD3v commented Oct 18, 2025

Hello, I understand what you are saying, I will try to fix all of this and let you know, thank you for being considerate of this pull request, Have a good day @45930 🎊

@br0wnD3v
Copy link
Author

Updated with minimal changes to the original zkapp-cli codebase, incorporated the zk config flow and its much cleaner, Thank you @45930 :))

@br0wnD3v br0wnD3v requested a review from 45930 October 19, 2025 07:27
@br0wnD3v
Copy link
Author

Thank you for your help @45930, I will complete all tests today. Good day :)))

support custom URLs with known networks in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants