Skip to content

dutterbutter/zksync-server-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZKsync Server Action (L1 + L2)

Start a local L1 (Anvil) and L2 (zksync_os_server) directly from official matter-labs/zksync-os-server release assets.

Features

  • Downloads official binaries + state (genesis.json, zkos-l1-state.json)
  • Boots both L1 (Anvil) and L2 (zksync_os_server)
  • Exports ETH_RPC and ZKSYNC_RPC for your subsequent test steps

Quick Start

Requirements

  • Runner: ubuntu-latest (Anvil requires Linux)
  • Foundry: must be available (to provide anvil binary)

Example setup:

- name: Setup Foundry
  uses: foundry-rs/foundry-toolchain@v1
  with:
    version: v1.4.1

Minimal usage (latest stable)

- name: Run ZKsync OS
  uses: dutterbutter/[email protected]
  with:
    version: latest

Pinned version

- name: Run ZKsync OS 
  uses: dutterbutter/[email protected]
  with:
    version: v0.8.2
    l1_port: 8545
    l2_port: 3050

Include pre-releases

- name: Run ZKsync OS
  uses: dutterbutter/[email protected]
  with:
    version: latest
    include_prerelease: true

Inputs

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

Outputs

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)

Environment Variables

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

Troubleshooting

  • Ports busy: Adjust l1_port / l2_port if 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/*.log

Support

If you encounter issues not covered in the troubleshooting section, feel free to open an issue in the repository.

Contributing 🤝

Feel free to open issues or PRs if you find any problems or have suggestions for improvements. Your contributions are more than welcome!

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Happy Testing! 🚀

About

Github Action for L1 (Anvil) - L2 (ZKsync OS) CI Testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published