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.
β¨ Features
- 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, ...).
π QuickΒ Start
Install prerequisites:
Tool | Purpose | Install |
---|---|---|
NodeΒ β₯Β 18 | CLI wrapper &Β scripts | https://nodejs.org (opens in a new tab) |
Foundry (Anvil) | Local EVM | https://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' β
β ... β β
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββ
π§© DeepΒ Dive
What happens under the hood?
- Anvil node starts on default port.
- Protocol deploy script publishes all core contracts.
- Chain simulators for Solana/Sui/TON register with the Connector.
- Tokens &Β pools are minted and seeded with liquidity.
- Funded dev accounts are printed for convenience.
π§ͺ Useful Examples
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.
π οΈ Open Source
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.