Setting up for Devnet
This guide explains the differences between the local network and devnet, how to migrate from the local network to devnet, and how to start developing directly on devnet.
Local Network vs Devnet: Key Differences
Before diving into the setup, it's important to understand the differences between the local network and devnet:
Local Network (Local Development)
- Runs locally on your machine
- No proving by default (faster development)
- No fees
- Instant block times
- Test accounts automatically deployed
- Ideal for rapid development and testing
Devnet (Remote Network)
- Remote environment with network of sequencers
- Always has fees enabled (need to pay or sponsor fees)
- ~36 second block times, longer L1 settlement
- No automatic test accounts
If you're new to Aztec and want to understand local development first, check out the local network guide.
Prerequisites
Before working with devnet, ensure you have:
- Docker installed
- Aztec CLI installed:
bash -i <(curl -s https://install.aztec.network)
- The devnet version installed:
aztec-up 3.0.0-devnet.4
The devnet is version dependent. It is currently running version 3.0.0-devnet.4. Maintain version consistency when interacting with the devnet to reduce errors.
Getting Started on Devnet
Step 1: Set up your environment
Set the required environment variables:
export VERSION=3.0.0-devnet.4
export NODE_URL=https://devnet.aztec-labs.com/
export SPONSORED_FPC_ADDRESS=0x280e5686a148059543f4d0968f9a18cd4992520fcd887444b8689bf2726a1f97
Step 2: Create and deploy an account
Unlike the local network, devnet has no pre-deployed accounts. You need to create your own, but first you need to register the sponsored FPC to pay transaction fees:
aztec-wallet register-contract \
--node-url $NODE_URL \
--alias sponsoredfpc \
$SPONSORED_FPC_ADDRESS SponsoredFPC \
--salt 0
Then create your account and deploy it:
aztec-wallet create-account \
--node-url $NODE_URL \
--alias my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS
The first transaction will take longer as it downloads proving keys. If you see Timeout awaiting isMined, the transaction is still processing - this is normal on testnet.
Step 3: Deploy and interact with contracts
Deploy a token contract as an example:
aztec-wallet deploy \
--node-url $NODE_URL \
--from accounts:my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
--alias token \
TokenContract \
--args accounts:my-wallet Token TOK 18 --no-wait
You can check the transaction status on aztecscan.
Interact with your deployed contract:
aztec-wallet send mint_to_private \
--node-url $NODE_URL \
--from accounts:my-wallet \
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
--contract-address token \
--args accounts:my-wallet 10
Migrating from the Local Network to Testnet
If you have an existing app running on your local network, here's how to migrate it to testnet:
1. Connect to Testnet Node
Instead of running a local network, connect to the testnet node:
export NODE_URL=https://aztec-testnet-fullnode.zkv.xyz
When running aztec-wallet commands, include the node URL:
aztec-wallet create-account -a main --node-url $NODE_URL
2. Initialize a TestWallet for Devnet
You can connect to testnet directly from your app using AztecJS:
In the browser:
import { TestWallet } from "@aztec/test-wallet/client/lazy";
In Node.js:
import { TestWallet } from "@aztec/test-wallet/server";
Then initialize with devnet configuration:
import { createAztecNodeClient } from "@aztec/aztec.js/node";
import { TestWallet } from "@aztec/test-wallet/server";
const NODE_URL = "https://devnet.aztec-labs.com";
const node = createAztecNodeClient(NODE_URL);
const wallet = await TestWallet.create(node);
3. Handle Fees on Devnet
Unlike the local network, devnet requires fee payment. You have three options:
- User pays their own fees - Send them tokens or direct them to the faucet
- Your contract sponsors fees - Deploy a fee-paying contract
- Use the canonical sponsored FPC - Recommended for getting started
See the aztec-starter for an example of how to deploy a contract with the sponsored FPC.
4. Important Migration Considerations
- Register all contracts: Including account contracts and the sponsored FPC in the wallet
- No test accounts: You'll need to deploy accounts manually
- Longer transaction times: Handle timeouts gracefully - transactions may still succeed
- L1-L2 messaging delays:
- L1→L2: Wait ~1.5-2 minutes (vs 2 blocks on the local network)
- L2→L1: Wait ~30 minutes for finalization (vs immediate on the local network)
Key Considerations When Using Devnet
Handling Transaction Timeouts
Devnet transactions take longer than on the local network. Handle timeouts gracefully:
try {
const receipt = await tx.wait();
} catch (error) {
if (error.message.includes("Timeout awaiting isMined")) {
console.log("Transaction sent but still being mined");
// Check block explorer for status
}
}
Environment Detection
Detect which environment your code is running against:
const isDevnet = process.env.NODE_URL?.includes("devnet");
const nodeUrl = process.env.NODE_URL || "http://localhost:8080";
Devnet information
RPC
Packages Versions / Github Tag
3.0.0-devnet.4
Network Configuration
- l1ChainId: 11155111
- rollupVersion: 1667575857
- enr: -Na4QDO8LfoSfCpWFbMPHwYZegt9P--3X8XCRmwuXD1SEtxdD2kx4K-ue5VuwG4DOWqDbsxLQ9Ja3Mr6OSmjV-8x-ToHhWF6dGVjsTAwLTExMTU1MTExLWIwNWYzNmM5LTE2Njc1NzU4NTctMjc2MzhiZjMtMDY4YTc5ZTiCaWSCdjSCaXCEIpEKG4lzZWNwMjU2azGhAvyGRkH6p8gsIWyI6vmqHxMIqAweVkShKk3mjGfL7e2Gg3RjcIKd0IN1ZH CCndCDdmVyjjMuMC4wLWRldm5ldC4y
Migration Notes
L1 Contract Addresses
- registryAddress:
0x9017a63e26eaf1197c49b4315a9f32a771abeea7 - slashFactoryAddress:
0x4926e1bd0ba4c9f477c57ce7311c62d4075dca5c - feeAssetHandlerAddress:
0x252a71fc243812f747fc4782dea865a260ef81c9 - rollupAddress:
0xb05f36c9dffa76f0af639385ef44d5560e0160c1 - inboxAddress:
0x33631b33f335e249279db08b9b7272c9906c1405 - outboxAddress:
0xfe37ceedec5674805fdc3cd5ca8aa6ca656cbfb9 - feeJuiceAddress:
0xa9144418460188c2b59914e6a7cb01deb1e019d7 - stakingAssetAddress:
0xdcaca47b74caf5c14ce023597f0e3b67e1f14496 - feeJuicePortalAddress:
0xeea84a878a3fd52d14e7820dddb60d35219b9cd9 - coinIssuerAddress:
0x48ab541e0f60e3138f6f24c5cc72993ffcdca462 - rewardDistributorAddress:
0x4833dacefe705e31200d071a04d17bd29e2c740c - governanceProposerAddress:
0x4194937ab0bb3b1b4b1b1d770bb8577a0500911b - governanceAddress:
0x6af3cc6c09a72b5a0ab772f37fd7b719569f27b9 - gseAddress:
0xeee2d3289dff43909b935da9ef2121fdcad8773f
Protocol Contract Addresses
- classRegistry:
0x0000000000000000000000000000000000000000000000000000000000000003 - feeJuice:
0x0000000000000000000000000000000000000000000000000000000000000005 - instanceRegistry:
0x0000000000000000000000000000000000000000000000000000000000000002 - multiCallEntrypoint:
0x0000000000000000000000000000000000000000000000000000000000000004 - sponsoredFPC:
0x280e5686a148059543f4d0968f9a18cd4992520fcd887444b8689bf2726a1f97
Next Steps
- New to Aztec? Start with the local network tutorial for faster development
- Ready for production testing? Continue using devnet
- Learn more: Check out our tutorials
- Explore: Visit Aztec Playground