anvil-zksync Action π
A lightweight GitHub Action that starts an anvil-zksync node inside your workflow, so you can run tests or scripts against a local ZK chain.
Quickstart
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start anvil-zksync
uses: dutterbutter/anvil-zksync-action@v1.1
with:
mode: run
- name: Run tests
run: |
# e.g. point your tests at http://localhost:8011
yarn test:contracts
Example: Forking Mainnet
- name: Start anvil-zksync in fork mode
uses: dutterbutter/anvil-zksync-action@v1.1
with:
mode: fork
forkUrl: mainnet
forkBlockNumber: 59_485_781
port: 8015
Inputs
Input | Description | Default |
---|---|---|
mode | Operation mode: run or fork | run |
forkUrl | JSON-RPC endpoint to fork from (requires fork ) | β |
forkBlockNumber | Block number to snapshot (fork mode only) | β |
port | Port for the nodeβs RPC server | 8011 |
releaseTag | Release tag to download from | latest |
host | Host address to bind | 127.0.0.1 |
chainId | Chain ID exposed by the node | 260 |
logLevel | Verbosity: debug , info , warn , error | info |
logFile | File path to write logs (if set, action waits) | β |
For an exhausted list of available inputs, see the anvil-zksync-action readme.
Uploading Logs
- name: Upload anvil logs
uses: actions/upload-artifact@v4
with:
name: anvil-zksync-log
path: anvil-zksync.log
For more options and detailed CLI flags, see the anvil-zksync CLI reference.