Build
Tutorials
Localnet Setup

Localnet is ZetaChain’s all‑in‑one local development environment for building, testing, and debugging universal applications. It bootstraps a fully‑featured multi‑chain laboratory on your machineβ€”spinning up nodes for multiple chains (EVM, Solana, Sui, TON) and pre‑deploys the core ZetaChain protocol contracts, ZRC‑20 tokens, and Uniswap v2 &Β v3 pools. Think of Localnet as β€˜ZetaChain on localhost’ β€” fast, predictable, and ideal for rapid iteration.

Why use Localnet?

πŸ”„ Iterate on cross‑chain logic in seconds β€” no more waiting for public testnets.

πŸ§ͺ Reproduce complex multi‑chain flows with one command.

🐞 Step‑through debug every contract call at the EVM level.

πŸš€ Deploy to testnet/mainnet with confidence once flows are green locally.

  • One‑shot bootstrap – npx zetachain@latest localnet start spins up everything.
  • Multi‑chain simulation – EVM, Solana, Sui, and TON.
  • Pre‑deployed contracts
    • ZetaChain Gateway contracts on all supported chains.
    • ZRC‑20 tokens (ETH, USDC, ...)
    • Uniswap v2 + v3 factories, routers, and initial liquidity pools.
  • Configurable – Pass arbitrary flags (block time, fork URL, ...).

Install prerequisites:

ToolPurposeInstall
NodeΒ β‰₯Β 18CLI wrapper &Β scriptshttps://nodejs.org (opens in a new tab)
Foundry (Anvil)Local EVMhttps://book.getfoundry.sh/getting-started/installation (opens in a new tab)

FireΒ up Localnet:

npx zetachain@latest localnet start

Within seconds you should see output similar to:

ZETACHAIN
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ (index)                  β”‚ Values                                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ gatewayZEVM              β”‚ '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6' β”‚
β”‚ uniswapFactoryInstance   β”‚ '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' β”‚
β”‚ uniswapRouterInstance    β”‚ '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' β”‚
β”‚ ...                      β”‚                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What happens under the hood?

  1. Anvil node starts on default port.
  2. Protocol deploy script publishes all core contracts.
  3. Chain simulators for Solana/Sui/TON register with the Connector.
  4. Tokens &Β pools are minted and seeded with liquidity.
  5. Funded dev accounts are printed for convenience.

Pass custom anvil flags:

npx zetachain@latest localnet start \
  --anvil "--block-time 1 --gas-limit 120000000" \
  --port 9000

Use this to simulate faster block times or test high-throughput contracts by increasing the gas limit and adjusting chain behavior.

Run a lean EVM-only instance of Localnet:

npx zetachain@latest localnet start --skip sui solana ton

Use this when your app doesn't need Solana, Sui, or TONβ€”startup is faster and resource usage is lower.

Localnet is open-source and available on GitHub (opens in a new tab). Clone or contribute to explore how it works under the hood, customize behaviors, or extend it for your development needs.