Repository navigation
docs: move the starter and examples content into the docs - #25784
Open
alejoamiras wants to merge 15 commits into
Open
alejoamiras wants to merge 15 commits into
alejoamiras wants to merge 15 commits into
Conversation
…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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
aztec initto 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 commits are split by line: the v6 commits first, then the main mirror.