Start a local L1 (Anvil) and L2 (zksync_os_server) directly from official matter-labs/zksync-os-server release assets.
- Downloads official binaries + state (
genesis.json,zkos-l1-state.json) - Boots both L1 (Anvil) and L2 (zksync_os_server)
- Exports
ETH_RPCandZKSYNC_RPCfor your subsequent test steps
- Runner:
ubuntu-latest(Anvil requires Linux) - Foundry: must be available (to provide
anvilbinary)
Example setup:
- name: Setup Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: v1.4.1- name: Run ZKsync OS
uses: dutterbutter/[email protected]
with:
version: latest- name: Run ZKsync OS
uses: dutterbutter/[email protected]
with:
version: v0.8.2
l1_port: 8545
l2_port: 3050- name: Run ZKsync OS
uses: dutterbutter/[email protected]
with:
version: latest
include_prerelease: true| Name | Default | Description |
|---|---|---|
version |
latest |
Release tag (e.g. v0.8.2) or latest |
include_prerelease |
false |
If true and version=latest, allows pre-releases |
l1_port |
8545 |
L1 RPC port (Anvil) |
l2_port |
3050 |
L2 RPC port (zksync_os_server) |
linux_arch |
x86_64 |
Architecture for binary (x86_64 or aarch64) |
set_env |
true |
Export ETH_RPC and ZKSYNC_RPC to GITHUB_ENV |
| Name | Description |
|---|---|
l1_rpc_url |
Local L1 RPC URL |
l2_rpc_url |
Local L2 RPC URL |
resolved_version |
Actual tag resolved (e.g. v0.8.2) |
If set_env is true (default), these are automatically exported:
ETH_RPC=http://127.0.0.1:8545
ZKSYNC_RPC=http://127.0.0.1:3050-
Ports busy: Adjust
l1_port/l2_portif the runner already uses 8545 or 3050. -
Logs:
.zks/anvil.log— Anvil output.zks/l2.log— zksync_os_bin output
Upload them on failure for debugging:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: zks-logs
path: .zks/*.logIf you encounter issues not covered in the troubleshooting section, feel free to open an issue in the repository.
Feel free to open issues or PRs if you find any problems or have suggestions for improvements. Your contributions are more than welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
Happy Testing! 🚀