Skip to content

Commit ce4c66b

Browse files
authored
Merge pull request #251 from AztecProtocol/josh/add-testnet-docs-to-testnet
Add testnet documentation and branch model
2 parents 085fee6 + 245425e commit ce4c66b

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

CLAUDE.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,34 @@ NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --
4747

4848
## Deployment & Scripts
4949

50-
All scripts support `::devnet` suffix for devnet targeting (sets `AZTEC_ENV=devnet`):
50+
All scripts support `::devnet` and `::testnet` suffixes for remote network targeting:
5151

5252
```bash
5353
yarn deploy # Deploy contract to local network
5454
yarn deploy::devnet # Deploy contract to devnet
55+
yarn deploy::testnet # Deploy contract to testnet
5556
yarn deploy-account # Deploy a Schnorr account
5657
yarn multiple-wallet # Deploy from one wallet, interact from another
5758
yarn profile # Profile a transaction deployment
5859
yarn read-logs # Demo utility function for client-side debug logging
5960
yarn read-logs::devnet # Same on devnet
61+
yarn read-logs::testnet # Same on testnet
6062
```
6163

6264
## Environment Configuration
6365

64-
- `AZTEC_ENV` variable selects config: `local-network` (default) or `devnet`
65-
- Config files: `config/local-network.json`, `config/devnet.json`
66+
- `AZTEC_ENV` variable selects config: `local-network` (default), `devnet`, or `testnet`
67+
- Config files: `config/local-network.json`, `config/devnet.json`, `config/testnet.json`
6668
- `config/config.ts` — singleton `ConfigManager` loads the appropriate JSON based on `AZTEC_ENV`
6769
- `.env` stores secrets (SECRET, SIGNING_KEY, SALT, contract keys) — never commit
6870

71+
## Branch Model
72+
73+
- **`next` branch** — default branch; used for local network and devnet development
74+
- **`testnet` branch** — used for testnet development; may run a different Aztec version
75+
76+
Devnet PRs target `next`. Testnet PRs target `testnet`. Each branch pins its own Aztec version independently.
77+
6978
## Project Structure
7079

7180
**Contract (Noir):**
@@ -143,9 +152,11 @@ When updating the Aztec version, update all of these locations:
143152

144153
1. `Nargo.toml``aztec` dependency tag
145154
2. `package.json` — all `@aztec/*` dependency versions
146-
3. `config/local-network.json` and `config/devnet.json``settings.version`
155+
3. `config/local-network.json`, `config/devnet.json`, and/or `config/testnet.json``settings.version` (update the configs relevant to the branch you're on)
147156
4. `README.md` — install command version
148157

158+
> **Note:** The `next` and `testnet` branches may pin different Aztec versions. Only update the config files relevant to the branch.
159+
149160
## ONBOARDING.md Maintenance
150161

151162
`ONBOARDING.md` is **generated** — do not edit it directly. Edit `docs/ONBOARDING.src.md` instead, then rebuild:

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ You can find the **Pod Racing Game contract** in `./src/main.nr`. A simple integ
1616

1717
The Pod Racing contract is a two-player competitive game where players allocate points across 5 tracks over multiple rounds. The game demonstrates Aztec's private state capabilities - round choices remain private until players reveal their final scores.
1818

19-
## Devnet
19+
## Devnet & Testnet
2020

21-
This repo connects to a locally running Aztec local network by default, but can be configured to connect to the devnet by specifying `AZTEC_ENV=devnet` in a `.env` file or by prefixing a command e.g. `AZTEC_ENV=devnet yarn deploy`.
21+
This repo connects to a locally running Aztec local network by default, but can be configured to connect to remote networks:
22+
23+
- **Devnet**: `AZTEC_ENV=devnet` — development network on the `next` branch
24+
- **Testnet**: `AZTEC_ENV=testnet` — test network on the `testnet` branch
25+
26+
Set the variable in a `.env` file or prefix a command, e.g. `AZTEC_ENV=devnet yarn deploy`.
27+
28+
> **Branch model:** Devnet code lives on the `next` branch. Testnet code lives on the `testnet` branch. Each branch may run a different Aztec version.
2229
2330
<div align="center">
2431

@@ -55,6 +62,7 @@ This project uses JSON configuration files to manage environment-specific settin
5562

5663
- `config/local-network.json` - Configuration for local network development
5764
- `config/devnet.json` - Configuration for devnet deployment
65+
- `config/testnet.json` - Configuration for testnet deployment
5866

5967
The system automatically loads the appropriate configuration file based on the `AZTEC_ENV` environment variable. If `AZTEC_ENV` is not set, it defaults to `local-network`.
6068

@@ -89,6 +97,21 @@ yarn interaction-existing-contract::devnet # Interact with devnet contracts
8997

9098
The `::devnet` suffix automatically sets `AZTEC_ENV=devnet`, loading configuration from `config/devnet.json`.
9199

100+
### Running on Testnet
101+
102+
Similarly, all scripts support a `::testnet` suffix:
103+
104+
```bash
105+
yarn deploy::testnet # Deploy to testnet
106+
yarn test::testnet # Run tests on testnet
107+
yarn deploy-account::testnet # Deploy account to testnet
108+
yarn interaction-existing-contract::testnet # Interact with testnet contracts
109+
```
110+
111+
The `::testnet` suffix sets `AZTEC_ENV=testnet`, loading configuration from `config/testnet.json`.
112+
113+
> **Note:** Testnet code should be developed and merged into the `testnet` branch, not `next`. The `testnet` branch may use a different Aztec version than the `next` (devnet) branch.
114+
92115
---
93116

94117
## 📦 **Install Packages**

0 commit comments

Comments
 (0)