Getting Started on Local Network
Get started on your local environment using a local network. If you'd rather jump into devnet, read the getting started on devnet guide.
The local network is a local development Aztec network running fully on your machine, and interacting with a development Ethereum node. You can develop and deploy on it just like on a testnet or mainnet (when the time comes). The local network makes it faster and easier to develop and test your Aztec applications.
What's included in the local network:
- Local Ethereum network (Anvil)
- Deployed Aztec protocol contracts (for L1 and L2)
- A set of test accounts with some test tokens to pay fees
- Development tools to compile contracts and interact with the network (
aztecandaztec-wallet)
This guide will teach you how to install the Aztec local network, run it using the Aztec CLI, and interact with contracts using the wallet CLI. To jump right into the testnet instead, click the Testnet tab.
Prerequisites
-
Aztec libraries use Node.js version v24.12.x (lts/krypton), and backwards compatible from version 20. You can use nvm to help manage node versions.
Install and run the local network
Install the Aztec toolchain
Run:
VERSION=4.0.0-devnet.2-patch.0 bash -i <(curl -sL https://install.aztec.network/4.0.0-devnet.2-patch.0)
This will install the following tools:
- aztec - compiles and tests aztec contracts and launches various infrastructure subsystems (full local network, sequencer, prover, pxe, etc) and provides utility commands to interact with the network
- aztec-up - a version manager for the Aztec toolchain. Use
aztec-up install <version>to install a new version,aztec-up use <version>to switch between installed versions, oraztec-up listto see installed versions. - aztec-wallet - a tool for interacting with the aztec network
Start the local network
Once these have been installed, to start the local network, run:
aztec start --local-network
Congratulations, you have just installed and run the Aztec local network!
/\ | |
/ \ ___| |_ ___ ___
/ /\ \ |_ / __/ _ \/ __|
/ ____ \ / /| || __/ (__
/_/___ \_\/___|\__\___|\___|
In the terminal, you will see some logs:
- Local network version
- Contract addresses of rollup contracts
- PXE (private execution environment) setup logs
- Initial accounts that are shipped with the local network and can be used in tests
You'll know the local network is ready to go when you see something like this:
[INFO] Aztec Server listening on port 8080
Using the local network test accounts
For convenience, the local network comes with 3 initial accounts that are prefunded, helping bootstrap payment of any transaction. To use them, you will need to add them to your pxe/wallet.
To add the test accounts in the wallet, run this in another terminal:
aztec-wallet import-test-accounts
We'll use the first test account, test0, throughout to pay for transactions.
Creating an account in the local network
aztec-wallet create-account -a my-wallet -f test0
aztec-wallet will generate transaction proofs by default. This is not required when sending transactions on the local network, but it is required when sending transactions on the devnet or mainnet.
You can turn off proof generation by adding the --prover none flag to the command or setting PXE_PROVER=none.
This will create a new wallet with an account and give it the alias my-wallet. Accounts can be referenced with accounts:<alias>. You will see logs telling you the address, public key, secret key, and more.
On successful deployment of the account, you should see something like this:
New account:
Address: 0x066108a2398e3e2ff53ec4b502e4c2e778c6de91bb889de103d5b4567530d99c
Public key: 0x007343da506ea513e6c05ba4d5e92e3c682333d97447d45db357d05a28df0656181e47a6257e644c3277c0b11223b28f2b36c94f9b0a954523de61ac967b42662b60e402f55e3b7384ba61261335040fe4cd52cb0383f559a36eeea304daf67d1645b06c38ee6098f90858b21b90129e7e1fdc4666dd58d13ef8fab845b2211906656d11b257feee0e91a42cb28f46b80aabdc70baad50eaa6bb2c5a7acff4e30b5036e1eb8bdf96fad3c81e63836b8aa39759d11e1637bd71e3fc76e3119e500fbcc1a22e61df8f060004104c5a75b52a1b939d0f315ac29013e2f908ca6bc50529a5c4a2604c754d52c9e7e3dee158be21b7e8008e950991174e2765740f58
Secret key: 0x1c94f8b19e91d23fd3ab6e15f7891fde7ba7cae01d3fa94e4c6afb4006ec0cfb
Partial address: 0x2fd6b540a6bb129dd2c05ff91a9c981fb5aa2ac8beb4268f10b3aa5fb4a0fcd1
Salt: 0x0000000000000000000000000000000000000000000000000000000000000000
Init hash: 0x28df95b579a365e232e1c63316375c45a16f6a6191af86c5606c31a940262db2
Deployer: 0x0000000000000000000000000000000000000000000000000000000000000000
Waiting for account contract deployment...
Deploy tx hash: 0a632ded6269bda38ad6b54cd49bef033078218b4484b902e326c30ce9dc6a36
Deploy tx fee: 200013616
Account stored in database with aliases last & my-wallet
You may need to scroll up as there are some other logs printed after it.
You can double check by running aztec-wallet get-alias accounts:my-wallet.
For simplicity we'll keep using the test account, let's deploy our own test token!
Deploying a contract
The local network comes with some contracts that you can deploy and play with. One of these is an example token contract.
Deploy it with this:
aztec-wallet deploy TokenContractArtifact --from accounts:test0 --args accounts:test0 TestToken TST 18 -a testtoken
This takes
- the contract artifact as the argument, which is
TokenContractArtifact - the deployer account, which we used
test0 - the args that the contract constructor takes, which is the
admin(accounts:test0),name(TestToken),symbol(TST), anddecimals(18). - an alias
testtoken(-a) so we can easily reference it later withcontracts:testtoken
On successful deployment, you should see something like this:
aztec:wallet [INFO] Using wallet with address 0x066108a2398e3e2ff53ec4b502e4c2e778c6de91bb889de103d5b4567530d99c +0ms
Contract deployed at 0x15ce68d4be65819fe9c335132f10643b725a9ebc7d86fb22871f6eb8bdbc3abd
Contract partial address 0x25a91e546590d77108d7b184cb81b0a0999e8c0816da1a83a2fa6903480ea138
Contract init hash 0x0abbaf0570bf684da355bd9a9a4b175548be6999625b9c8e0e9775d140c78506
Deployment tx hash: 0a8ccd1f4e28092a8fa4d1cb85ef877f8533935c4e94b352a38af73eee17944f
Deployment salt: 0x266295eb5da322aba96fbb24f9de10b2ba01575dde846b806f884f749d416707
Deployment fee: 200943060
Contract stored in database with aliases last & testtoken
In the next step, let's mint some tokens!