Skip to content

Commit 6e5107b

Browse files
critesjoshAztecBot
authored andcommitted
docs: add getting started on testnet guide (#22366)
Adds a new "Getting Started on Testnet" documentation page addressing developer questions about deploying to testnet. This was requested because the docs currently guide developers to the local network but don't explain how to use testnet. The guide uses the **Sponsored FPC** at `0x2ae02a54fd254586fd628ff46b71071bd8db32b63dc5d083f844f2c208a3923c` for fee payment, so developers can get started without bridging Fee Juice from L1. The new page covers: - Installing the correct testnet version of the CLI - Registering the Sponsored FPC and using it for fee payment - Creating and deploying accounts - Deploying and interacting with contracts (Token example) - Viewing transactions on Aztecscan - Registering existing contracts in PXE - Link to manual fee bridging docs for advanced users Also updates: - `sidebars-developer.js` — added testnet page between local network and devnet - `networks.md` — added Sponsored FPC address for testnet, updated links and notes - `how_to_pay_fees.md` — removed conditional blocks saying Sponsored FPC isn't on testnet - `getting_started_on_devnet.md` — removed stale testnet warning about Sponsored FPC - `getting_started_on_local_network.md` — cross-links to testnet guide - [ ] Run `yarn start` in docs/ and verify the new page renders correctly - [ ] Verify sidebar shows the testnet page between local network and devnet - [ ] Verify cross-links from networks.md and local network page work - [ ] Verify preprocessor macros (`#include_testnet_version`) resolve correctly - [ ] Confirm Sponsored FPC address `0x2ae02a54fd254586fd628ff46b71071bd8db32b63dc5d083f844f2c208a3923c` is correct and funded
1 parent 76db45e commit 6e5107b

6 files changed

Lines changed: 426 additions & 2 deletions

File tree

docs/developer_versioned_docs/version-v4.1.0-rc.2/getting_started_on_local_network.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: [local_network, testnet]
88
import Tabs from '@theme/Tabs';
99
import TabItem from '@theme/TabItem';
1010

11-
Get started on your local environment using a local network.
11+
Get started on your local environment using a local network. If you'd rather deploy to a live network, read the [getting started on testnet guide](./getting_started_on_testnet.md).
1212

1313
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.
1414

@@ -252,4 +252,5 @@ Simulation result: 25n
252252
Want to build something cool on Aztec?
253253
254254
- Check out the [Token Contract Tutorial](./docs/tutorials/contract_tutorials/token_contract.md) for a beginner tutorial, or jump into more advanced ones
255+
- Ready for a live network? Try [deploying on testnet](./getting_started_on_testnet.md)
255256
- Start on your own thing and check out the How To Guides to help you!
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
---
2+
title: Getting Started on Testnet
3+
sidebar_position: 1
4+
tags: [testnet]
5+
description: Deploy contracts and send transactions on the Aztec testnet using the CLI wallet and the Sponsored FPC for fee payment.
6+
---
7+
8+
import { General } from '@site/src/components/Snippets/general_snippets';
9+
10+
This guide walks you through deploying your first contract on the Aztec testnet. You will install the CLI tools, create an account using the Sponsored FPC (so you don't need to bridge Fee Juice yourself), and deploy and interact with a contract.
11+
12+
## Testnet vs Local Network
13+
14+
| Feature | Local Network | Testnet |
15+
|---------|-------------|---------|
16+
| **Environment** | Local machine | Decentralized network on Sepolia |
17+
| **Fees** | Free (test accounts prefunded) | Sponsored FPC available |
18+
| **Block times** | Instant | ~36 seconds |
19+
| **Proving** | Optional | Required |
20+
| **Accounts** | Test accounts pre-deployed | Must create and deploy your own |
21+
22+
:::info
23+
If you want to develop and iterate quickly, start with the [local network guide](./getting_started_on_local_network.md). The local network has instant blocks and no proving, making it faster for development.
24+
:::
25+
26+
## Prerequisites
27+
28+
- <General.node_ver />
29+
30+
## Install the Aztec toolchain
31+
32+
Install the testnet version of the Aztec CLI:
33+
34+
```bash
35+
VERSION=4.2.0-aztecnr-rc.2 bash -i <(curl -sL https://install.aztec.network/4.2.0-aztecnr-rc.2)
36+
```
37+
38+
:::warning
39+
Testnet is version-dependent. It is currently running version `4.2.0-aztecnr-rc.2`. Maintain version consistency when interacting with the testnet to avoid errors.
40+
:::
41+
42+
This installs:
43+
44+
- **aztec** - Compiles and tests Aztec contracts, launches infrastructure, and provides utility commands
45+
- **aztec-up** - Version manager for the Aztec toolchain (`aztec-up install`, `aztec-up use`, `aztec-up list`)
46+
- **aztec-wallet** - CLI tool for interacting with the Aztec network
47+
48+
## Getting started on testnet
49+
50+
### Step 1: Set up your environment
51+
52+
Set the required environment variables:
53+
54+
```bash
55+
export NODE_URL=https://rpc.testnet.aztec-labs.com
56+
export SPONSORED_FPC_ADDRESS=0x254082b62f9108d044b8998f212bb145619d91bfcd049461d74babb840181257
57+
```
58+
59+
### Step 2: Register the Sponsored FPC
60+
61+
The Sponsored FPC (Fee Payment Contract) pays transaction fees on your behalf, so you don't need to bridge Fee Juice from L1. Register it in your wallet:
62+
63+
```bash
64+
aztec-wallet register-contract \
65+
--node-url $NODE_URL \
66+
--alias sponsoredfpc \
67+
$SPONSORED_FPC_ADDRESS SponsoredFPC \
68+
--salt 0
69+
```
70+
71+
### Step 3: Create and deploy an account
72+
73+
Unlike the local network, testnet has no pre-deployed accounts. Create and deploy your own:
74+
75+
```bash
76+
aztec-wallet create-account \
77+
--node-url $NODE_URL \
78+
--alias my-wallet \
79+
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS
80+
```
81+
82+
:::note
83+
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.
84+
:::
85+
86+
### Step 4: Deploy a contract
87+
88+
Deploy a token contract as an example:
89+
90+
```bash
91+
aztec-wallet deploy \
92+
--node-url $NODE_URL \
93+
--from accounts:my-wallet \
94+
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
95+
--alias token \
96+
TokenContract \
97+
--args accounts:my-wallet Token TOK 18
98+
```
99+
100+
This deploys the `TokenContract` with:
101+
- `admin`: your wallet address
102+
- `name`: Token
103+
- `symbol`: TOK
104+
- `decimals`: 18
105+
106+
You can check the transaction status on [Aztecscan](https://testnet.aztecscan.xyz).
107+
108+
### Step 5: Interact with your contract
109+
110+
Mint some tokens:
111+
112+
```bash
113+
aztec-wallet send mint_to_public \
114+
--node-url $NODE_URL \
115+
--from accounts:my-wallet \
116+
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
117+
--contract-address token \
118+
--args accounts:my-wallet 100
119+
```
120+
121+
Check your balance:
122+
123+
```bash
124+
aztec-wallet simulate balance_of_public \
125+
--node-url $NODE_URL \
126+
--from accounts:my-wallet \
127+
--contract-address token \
128+
--args accounts:my-wallet
129+
```
130+
131+
This should print:
132+
133+
```
134+
Simulation result: 100n
135+
```
136+
137+
Move tokens to private state:
138+
139+
```bash
140+
aztec-wallet send transfer_to_private \
141+
--node-url $NODE_URL \
142+
--from accounts:my-wallet \
143+
--payment method=fpc-sponsored,fpc=$SPONSORED_FPC_ADDRESS \
144+
--contract-address token \
145+
--args accounts:my-wallet 25
146+
```
147+
148+
Check your private balance:
149+
150+
```bash
151+
aztec-wallet simulate balance_of_private \
152+
--node-url $NODE_URL \
153+
--from accounts:my-wallet \
154+
--contract-address token \
155+
--args accounts:my-wallet
156+
```
157+
158+
This should print:
159+
160+
```
161+
Simulation result: 25n
162+
```
163+
164+
## Viewing transactions on the block explorer
165+
166+
You can view your transactions, contracts, and account on the testnet block explorers:
167+
168+
- [Aztecscan](https://testnet.aztecscan.xyz)
169+
- [Aztec Explorer](https://aztecexplorer.xyz/?network=testnet)
170+
171+
Search by transaction hash, contract address, or account address to see details and status.
172+
173+
## Registering existing contracts
174+
175+
To interact with a contract deployed by someone else, you need to register it in your local PXE first:
176+
177+
```bash
178+
aztec-wallet register-contract \
179+
--node-url $NODE_URL \
180+
--alias mycontract \
181+
<CONTRACT_ADDRESS> <ArtifactName>
182+
```
183+
184+
For example, to register a `TokenContract` deployed by someone else:
185+
186+
```bash
187+
aztec-wallet register-contract \
188+
--node-url $NODE_URL \
189+
--alias external-token \
190+
0x1234...abcd TokenContract
191+
```
192+
193+
After registration, you can interact with it using `aztec-wallet send` and `aztec-wallet simulate` as shown above.
194+
195+
## Paying fees without the Sponsored FPC
196+
197+
The Sponsored FPC is convenient for getting started, but you can also pay fees directly by bridging Fee Juice from Ethereum Sepolia. See [Paying Fees](./docs/aztec-js/how_to_pay_fees.md#bridge-fee-juice-from-l1) for details on bridging and other fee payment methods.
198+
199+
## Testnet information
200+
201+
For complete testnet technical details including contract addresses and network configuration, see the [Networks page](/networks#testnet).
202+
203+
## Next steps
204+
205+
- Check out the [Tutorials](./docs/tutorials/contract_tutorials/counter_contract.md) for building more complex contracts
206+
- Learn about [paying fees](./docs/aztec-js/how_to_pay_fees.md) with different methods
207+
- Explore [Aztec Playground](https://play.aztec.network/) for an interactive development experience

docs/developer_versioned_sidebars/version-v4.1.0-rc.2-sidebars.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"type": "doc",
1414
"id": "getting_started_on_local_network"
1515
},
16+
{
17+
"type": "doc",
18+
"id": "getting_started_on_testnet"
19+
},
1620
{
1721
"type": "doc",
1822
"id": "ai_tooling"

docs/docs-developers/getting_started_on_local_network.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: [local_network, testnet]
88
import Tabs from '@theme/Tabs';
99
import TabItem from '@theme/TabItem';
1010

11-
Get started on your local environment using a local network.
11+
Get started on your local environment using a local network. If you'd rather deploy to a live network, read the [getting started on testnet guide](./getting_started_on_testnet.md).
1212

1313
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.
1414

@@ -257,4 +257,5 @@ Simulation result: 25n
257257
Want to build something cool on Aztec?
258258
259259
- Check out the [Token Contract Tutorial](./docs/tutorials/contract_tutorials/token_contract.md) for a beginner tutorial, or jump into more advanced ones
260+
- Ready for a live network? Try [deploying on testnet](./getting_started_on_testnet.md)
260261
- Start on your own thing and check out the How To Guides to help you!

0 commit comments

Comments
 (0)