In-memory node that can be used for integration testing and debugging.
In-memory node that can be used for integration testing and debugging.
Install · User Book · Rust Book · Contributing
Install anvil-zksync with your preferred method from the below options:
Homebrew
brew tap matter-labs/anvil-zksync https://github.com/matter-labs/anvil-zksync.git
brew install anvil-zksyncScript (installs forge-zksync, cast-zksync & anvil‑zksync)
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bashPre‑built binaries
# download and unpack the latest release
tar -xzf anvil-zksync_x.y.z_.tar.gz -C /usr/local/bin
chmod +x /usr/local/bin/anvil-zksyncBuild from source
# clone and build from source
git clone [email protected]:matter-labs/anvil-zksync.git
cd anvil-zksync
cargo build --releaseStart a local ZK chain node
anvil-zksync runLaunches a fast, in-memory ZK chain for local development.
Fork any Elastic Network chain
anvil-zksync fork --fork-url eraMirror mainnet, testnet, or any Elastic ZK chain using a custom RPC.
Replay transactions
anvil-zksync -vv replay_tx --fork-url era 0x0820a939dfe83221f44a6f0f81f8059ec8a7a4e17006965a8b0c146a2c4a00c2Debug live transactions with full VM call‑trace and verbose output.
Integrate an L1 node
For L1–L2 interactions, choose one of the following:
Spawn a local L1 (defaults to port 8012):
anvil-zksync --spawn-l1 [port]Connect to an external L1 (must be started with --no-request-size-limit):
anvil --no-request-size-limit
anvil-zksync --external-l1 http://localhost:8545Note:
--spawn-l1and--external-l1are mutually exclusive.
For the full CLI reference and advanced usage, see the user docs: https://matter-labs.github.io/anvil-zksync/latest
Bug reports, fixes and new features are welcome! Please read the contributing guide to get started.
This project is licensed under the terms of the MIT License / Apache License – see the LICENSE-MIT, LICENSE-APACHE and file for details.
No open issues yet, or sync has not completed.