Skip to content

docs: move the starter and examples content into the docs - #25784

Open
alejoamiras wants to merge 15 commits into
nextfrom
docs-repos-fold-main
Open

alejoamiras wants to merge 15 commits into
nextfrom
docs-repos-fold-main

Conversation

@alejoamiras

Copy link
Copy Markdown
Contributor

Moves what was still useful in aztec-starter and aztec-examples into the docs, where CI builds and tests it, so those repos can be retired. Everything lands in the v6 line and in the main docs.

  • New pages: "Your first full project" (from aztec init to deploying and calling a contract from TypeScript, tested from an empty folder), a note hash proof tutorial, "Use multiple wallets", and a "Coming from Ethereum" section in the overview.
  • The Pod Racing contract in the webapp tutorial now finalizes each game once, only after both players have revealed. It used to let a game be finalized repeatedly, adding a win each time. It gets 20 contract tests.
  • Links to the retired repos point at the docs instead. Pages production serves only link pages that v6.0.0 already has; docs: bring the new v6 pages to production #25782 tracks bringing the new pages to production.
  • The examples runner no longer leaves root-owned files behind in the checkout.

The commits are split by line: the v6 commits first, then the main mirror.

…each game once

The v6 webapp tutorial's contract gains three finalize guards: player 2
has joined, both players have revealed, and the game is not already
finalized (a new finalized map). Its asserts get messages so failure
tests can name them.

A new lib crate, pod_racing_contract_test, ports the 16 TXE tests from
the archived starter with typed Race reads and should_fail_with, and
adds one test per guard plus a happy path that checks win_history.
Page 7 of the tutorial walks through the tests, states the two known
limits (no reveal deadline; a zero total reads as not revealed), and
ends with a forfeit exercise.
A "Coming from Ethereum" table in the v6 overview, checked against the
v6 code: self.msg_sender(), the Context-generic Map, #[external]
attributes, Fee Juice per mana with FPCs. The commit-reveal row says
what Aztec gives you (private notes hide each move) instead of claiming
a built-in commit-reveal.
A new aztec.js how-to and example run two EmbeddedWallets, each with its
own PXE: Alice mints private and public tokens to Bob, Bob's wallet
registers Alice as a sender and the token contract from the node, and
reads both balances. The example asserts the balances, so the network
run fails if note discovery breaks. The note discovery page links it.
A contract whose private create_note takes the note's randomness as a
private argument, mirroring aztec-nr's create_note and delivering the
note to its owner; a Noir circuit that recomputes the unique note hash;
and a script that creates the note, checks the owner's PXE holds it,
reads the hash and nonce from the transaction, and proves and verifies
with bb.js. A wrong randomness fails at witness generation.

The tutorial page states what the proof reveals and proves, what the
verifier must still check onchain, and the two rules for the
randomness: fresh and secret for every note, and one note per call.
A new first JS tutorial goes from an empty folder to a contract
deployed and called from TypeScript: aztec init, compile, codegen, a
complete package.json and tsconfig.json, and one script that deploys
the Counter, increments it and reads it back.

fresh_folder_test.sh rebuilds that project the way a reader does, in
an empty folder with a clean environment: it renders the page, writes
its package.json and tsconfig.json blocks, copies the example's script
region, installs from npm and type-checks. It takes about 70 s.
The v6 sidebar's archived starter repository link becomes a doc link to
"Your first full project". The v6 AI tooling page lists that page and
the note hash proof tutorial in place of the archived starter and
examples repositories. The webapp tutorial's wallet page now links
account creation for networks without test accounts.
Constrained delivery calls the handshake registry's validate_handshake, which
nullifies and re-creates the handshake note, so the transaction settles more
than one note hash and the script's single-note assertion failed on a network.
The contract now exposes the note's hash as a utility function, and the script
silos it and compares it with each settled hash under that position's nonce,
as the PXE does during note discovery.
The archived starter repositories are now tutorials in the dev lines, so the
links to aztec-starter go from the navbar and the root sidebar. Production
serves the v6.0.0 snapshot, which has neither "Your first full project" nor the
new tutorials, so the landing page QuickLink, the llms.txt line, the v6.0.0
sidebar item and the v6.0.0 AI tooling page point at "Aztec.js getting
started" and the worked contract examples v6.0.0 already has.
The runner's setup_project runs `yarn init -y`, which also runs `git init`
and writes .gitignore, .editorconfig, .gitattributes and README.md. The
compose run is root on the repository mount, and the runner's cleanup never
removed them, so every local `examples/bootstrap.sh execute` left root-owned
nested repositories in docs/examples/ts/*/. Git then treats a new example's
folder as an embedded repository and stages none of its files, and removing
the checkout needs root.

setup_project now removes the nested repository right after the init, and of
the four files only those the init created, so a setup that fails later under
set -e leaves nothing behind either. None of the five is tracked under
docs/examples/ts/*/ or docs/lines/v6/examples/ts/*/ today (git ls-files).
Both lines' runners stay identical; the v6 one runs only in a release cut's
stage outside the repository.
The v6 line's Pod Racing guards and TXE tests (page 07), "Coming from
Ethereum", multiple wallets, note hash proof and "Your first full project"
pages and examples, with their links, copied into docs-developers/ and
examples/ with the line's paths rewritten. Both pins name the same aztec-node
commit, so the copies are identical apart from paths. The runner executes the
three new TypeScript examples against main's compose network.
yarn init runs an install after it writes its files, so a failed install
made set -e skip the cleanup, and a rerun then counted the leftovers as
pre-existing. The runner now removes them whatever init returns, then
returns init's status.
@alejoamiras
alejoamiras requested a review from a team as a code owner November 6, 2026 20:31
The tutorial's create_note lets any caller create a note of any value for
itself, so a proof about one shows knowledge of a note, not a payment. The
overview no longer offers payment confirmation as the example, "What the
proof shows" says the proof does not show how the note came to exist, and
the contract section no longer says the owner can spend the note (this
contract has no function that does).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant