From a6a605d3cd83b2f4b8e47722ff262382a7a2ea1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 11 Jul 2024 00:01:00 +0200 Subject: [PATCH] chore(boxes): adding an init command for an empty project (#7398) Quick PR to add a `npx aztec-app init` command that provides a `nargo new`-like feature. This will be used in tutorials and specially in the EthCC workshop. --------- Co-authored-by: josh crites --- .devcontainer/sandbox_only/devcontainer.json | 18 ++ .devcontainer/scripts/onCreateCommand.sh | 21 ++- .devcontainer/scripts/postAttachCommand.sh | 3 +- boxes/README.md | 22 ++- boxes/bin.js | 169 +++++++++---------- boxes/init/.yarnrc.yml | 1 + boxes/init/Nargo.toml | 6 + boxes/init/package.json | 9 + boxes/init/src/main.nr | 6 + boxes/package.json | 4 +- boxes/scripts/init.js | 19 +++ boxes/scripts/steps/sandbox/run.js | 13 +- boxes/scripts/utils.js | 3 +- boxes/yarn.lock | 60 +++---- docs/docs/getting_started.md | 67 +++++++- docs/docs/getting_started/manual_install.md | 77 --------- 16 files changed, 269 insertions(+), 229 deletions(-) create mode 100644 .devcontainer/sandbox_only/devcontainer.json create mode 100644 boxes/init/.yarnrc.yml create mode 100644 boxes/init/Nargo.toml create mode 100644 boxes/init/package.json create mode 100644 boxes/init/src/main.nr create mode 100644 boxes/scripts/init.js delete mode 100644 docs/docs/getting_started/manual_install.md diff --git a/.devcontainer/sandbox_only/devcontainer.json b/.devcontainer/sandbox_only/devcontainer.json new file mode 100644 index 00000000000..eafead0351d --- /dev/null +++ b/.devcontainer/sandbox_only/devcontainer.json @@ -0,0 +1,18 @@ +{ + "name": "Sandbox Only", + "image": "node:lts-bookworm", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "onCreateCommand": "cp -R /root/workspace /root/scripts && rm -rf /root/workspace/* && sh /root/scripts/onCreateCommand.sh sandbox_only", + "postAttachCommand": "sh /root/scripts/postAttachCommand.sh", + "customizations": { + "vscode": { + "settings": {}, + "extensions": ["noir-lang.vscode-noir"] + } + }, + "workspaceMount": "source=${localWorkspaceFolder}/.devcontainer/scripts,target=/root/workspace,type=bind", + "workspaceFolder": "/root/workspace", + "forwardPorts": [8080] +} diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh index c0970999305..f90491c9bd0 100755 --- a/.devcontainer/scripts/onCreateCommand.sh +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -13,14 +13,17 @@ fi if ! grep -q "alias sandbox" ~/.bashrc; then echo "alias sandbox=\"npx aztec-app sandbox\"" >> ~/.bashrc fi +corepack enable -source ~/.bashrc -yes | npx aztec-app -t $TYPE -n $NAME -s -mv $NAME/* $NAME/.* . -rm -rf $NAME +if [ "$TYPE" != "sandbox_only" ]; then + source ~/.bashrc + yes | npx create-aztec-app -t $TYPE -n $NAME -s + mv $NAME/* $NAME/.* . + rm -rf $NAME + + yarn -yarn - -npx -y playwright install --with-deps -yarn add @aztec/builder -yarn prep + npx -y playwright install --with-deps + yarn add @aztec/builder + yarn prep +fi diff --git a/.devcontainer/scripts/postAttachCommand.sh b/.devcontainer/scripts/postAttachCommand.sh index 9eeff69f350..06eb743d106 100755 --- a/.devcontainer/scripts/postAttachCommand.sh +++ b/.devcontainer/scripts/postAttachCommand.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash -TYPE=$1 -NAME=$2 +apt update apt install gh gh codespace ports visibility 8080:public -c $CODESPACE_NAME diff --git a/boxes/README.md b/boxes/README.md index f7adc35ecb1..f75bbb5c08a 100644 --- a/boxes/README.md +++ b/boxes/README.md @@ -1,4 +1,24 @@ -# Aztec Boxes +# Aztec-App + +Aztec-App is a set of tools to ease development on Aztec. It consists of two main components: +1. `npx` script +2. boxes (starter kits) +## npx script + +NPX is a tool bundled with `npm` and other package managers. It allows you to run a binary from a cache without installing it globally. + +To ease the development process, Aztec has developed this binary. To run it, install Node and run: + +```bash +npx aztec-app +``` + +This will prompt you with some options to clone `Aztec Boxes` and install the sandbox. As the `npx` script evolves, other commands will be added or removed. You can run it with the `-h` flag to know what other commands and flags you can pass to it. + +> [!NOTE] +> As a tool that doesn't (yet) have automated testing, it versioning and release process is decoupled from `aztec`, and its deployment is entirely manual by running `yarn npm publish --access public`. + +## Aztec Boxes Aztec Boxes are the one-stop-shop for developing on Aztec. They often include a combination of: diff --git a/boxes/bin.js b/boxes/bin.js index 75a26d2b356..cd160479d05 100755 --- a/boxes/bin.js +++ b/boxes/bin.js @@ -1,23 +1,15 @@ #!/usr/bin/env node -import { Command, Option } from "commander"; +import { Command } from "commander"; const program = new Command(); import { chooseProject } from "./scripts/steps/chooseBox.js"; -import { - install, - update, - sandboxInstallOrUpdate, -} from "./scripts/steps/sandbox/install.js"; +import { sandboxInstallOrUpdate } from "./scripts/steps/sandbox/install.js"; import axios from "axios"; import pino from "pino"; import pretty from "pino-pretty"; import ora from "ora"; import { AZTEC_REPO } from "./scripts/config.js"; -import { - start, - stop, - log, - sandboxRunStep, -} from "./scripts/steps/sandbox/run.js"; +import { sandboxRunStep } from "./scripts/steps/sandbox/run.js"; +import { init } from "./scripts/init.js"; const getLatestStable = async () => { const { data } = await axios.get( @@ -26,86 +18,88 @@ const getLatestStable = async () => { return data[0].tag_name.split("-v")[1]; }; -const init = async ({ debug, github_token, version }) => { - const axiosOpts = { - timeout: 5000, - headers: github_token ? { Authorization: `token ${github_token}` } : {}, - }; - - const prettyOpts = { - sync: true, - colorize: true, - include: debug ? "time" : "", - customLevels: "success:80", - customColors: "success:bgGreen", - }; - - const prettyStream = pretty(prettyOpts); - const logger = pino( - { - customLevels: { - success: 80, +program + .option("-v, --version ", "a version number or master tag") + .option("-d, --debug", "output extra debugging") + .option("-gh, --github_token ", "a github token") + .hook("preSubcommand", async (thisCommand) => { + const { debug, github_token, version } = thisCommand.opts(); + const axiosOpts = { + timeout: 5000, + headers: github_token ? { Authorization: `token ${github_token}` } : {}, + }; + + const prettyOpts = { + sync: true, + colorize: true, + include: debug ? "time" : "", + customLevels: "success:80", + customColors: "success:bgGreen", + }; + + const prettyStream = pretty(prettyOpts); + const logger = pino( + { + customLevels: { + success: 80, + }, + level: debug ? "debug" : "info", }, - level: debug ? "debug" : "info", - }, - prettyStream, - ); - - global.debug = (msg) => logger.debug(msg); - global.info = (msg) => logger.info(msg); - global.success = (msg) => logger.success(msg); - - global.warn = (msg) => logger.warn(msg); - global.error = (msg) => logger.error(msg); - - global.github = async ({ path, raw = false }) => { - try { - const url = raw - ? `https://raw.githubusercontent.com/${AZTEC_REPO}/${path}` - : `https://api.github.com/repos/${AZTEC_REPO}/contents/${path}`; - const { data } = await axios.get(url, axiosOpts); - global.debug(data); - return data; - } catch (e) { - global.error(e); - } - }; - - // versioning is confusing here because "latest" and "master" point to the same thing at times - // so let's clarify a bit: - // - // if the user has set a version (ex. "master" or "0.23.0"), use that - // otherwise use the stable release (ex. 0.24.0) - global.latestStable = await getLatestStable(); - global.version = version || global.latestStable; - - // if the user has set a semver version (matches the regex), fetch that tag (i.e. aztec-packages-v0.23.0) - // otherwise use the version as the tag - global.tag = global.version.match(/^\d+\.\d+\.\d+$/) - ? `aztec-packages-v${global.version}` - : global.version; - - global.debug(`Version: ${global.version}`); - global.debug(`Tag: ${global.tag}`); - global.debug(`LatestStable: ${global.latestStable}`); - - global.spinner = ora({ color: "blue" }); -}; + prettyStream, + ); + + global.debug = (msg) => logger.debug(msg); + global.info = (msg) => logger.info(msg); + global.success = (msg) => logger.success(msg); + + global.warn = (msg) => logger.warn(msg); + global.error = (msg) => logger.error(msg); + + global.github = async ({ path, raw = false }) => { + try { + const url = raw + ? `https://raw.githubusercontent.com/${AZTEC_REPO}/${path}` + : `https://api.github.com/repos/${AZTEC_REPO}/contents/${path}`; + const { data } = await axios.get(url, axiosOpts); + global.debug(data); + return data; + } catch (e) { + global.error(e); + } + }; + + // versioning is confusing here because "latest" and "master" point to the same thing at times + // so let's clarify a bit: + // + // if the user has set a version (ex. "master" or "0.23.0"), use that + // otherwise use the stable release (ex. 0.24.0) + global.latestStable = await getLatestStable(); + global.version = version || global.latestStable; + + // if the user has set a semver version (matches the regex), fetch that tag (i.e. aztec-packages-v0.23.0) + // otherwise use the version as the tag + global.tag = global.version.match(/^\d+\.\d+\.\d+$/) + ? `aztec-packages-v${global.version}` + : global.version; + + global.debug(`Version: ${global.version}`); + global.debug(`Tag: ${global.tag}`); + global.debug(`LatestStable: ${global.latestStable}`); + + global.spinner = ora({ color: "blue" }); + }); -const sandbox = program.command("sandbox"); -sandbox.description("Manage the Aztec Sandbox"); -sandbox.command("start").action(start); -sandbox.command("logs").action(log); -sandbox.command("stop").action(stop); -sandbox.command("install").action(install); -sandbox.command("update").action(update); +program + .command("init") + .description("Bootstrap an empty Aztec contract") + .argument("[folder]", "optional folder to init your project into", ".") + .action(async (folder) => { + await init(folder); + }); program .command("new", { isDefault: true }) .description("An Aztec project with a built-in development network") - .option("-d, --debug", "output extra debugging") - .option("-gh, --github_token ", "a github token") - .option("-v, --version ", "a version number or master tag") .option( "-s, --skip-sandbox", "skip sandbox installation and run after cloning", @@ -128,8 +122,7 @@ program } const { projectType, projectName, skipSandbox } = options; - // SETUP: Initialize global variables - await init(options); + // // STEP 1: Choose the boilerplate await chooseProject({ projectType, projectName }); diff --git a/boxes/init/.yarnrc.yml b/boxes/init/.yarnrc.yml new file mode 100644 index 00000000000..3186f3f0795 --- /dev/null +++ b/boxes/init/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/boxes/init/Nargo.toml b/boxes/init/Nargo.toml new file mode 100644 index 00000000000..14bcaec85ac --- /dev/null +++ b/boxes/init/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "init" +type = "contract" + +[dependencies] +aztec = { path = "../../noir-projects/aztec-nr/aztec" } diff --git a/boxes/init/package.json b/boxes/init/package.json new file mode 100644 index 00000000000..12bd80ead44 --- /dev/null +++ b/boxes/init/package.json @@ -0,0 +1,9 @@ +{ + "packageManager": "yarn@4.2.2", + "type": "module", + "dependencies": { + "@aztec/accounts": "latest", + "@aztec/aztec.js": "latest", + "@aztec/builder": "latest" + } +} diff --git a/boxes/init/src/main.nr b/boxes/init/src/main.nr new file mode 100644 index 00000000000..8e06a99f11c --- /dev/null +++ b/boxes/init/src/main.nr @@ -0,0 +1,6 @@ + +contract Main { + #[aztec(private)] + #[aztec(initializer)] + fn constructor() { } +} diff --git a/boxes/package.json b/boxes/package.json index ad941bc6c07..72690380907 100644 --- a/boxes/package.json +++ b/boxes/package.json @@ -1,7 +1,7 @@ { - "name": "create-aztec-app", + "name": "aztec-app", "packageManager": "yarn@4.0.2", - "version": "0.4.4", + "version": "0.4.9", "type": "module", "scripts": { "compile": "yarn workspaces foreach -A -v run compile", diff --git a/boxes/scripts/init.js b/boxes/scripts/init.js new file mode 100644 index 00000000000..ad122b90a27 --- /dev/null +++ b/boxes/scripts/init.js @@ -0,0 +1,19 @@ +import { replacePaths } from "./utils.js"; +import { AZTEC_REPO } from "./config.js"; +import tiged from "tiged"; + +export async function init(folder) { + const emitter = tiged(`${AZTEC_REPO}/boxes/init${tag && `#${tag}`}`, { + verbose: true, + }); + emitter.on("info", ({ message }) => debug(message)); + emitter.on("warn", ({ message }) => error(message)); + await emitter.clone(`${folder}`); + + await replacePaths({ + rootDir: `${folder}`, + tag, + version, + prefix: "", + }); +} diff --git a/boxes/scripts/steps/sandbox/run.js b/boxes/scripts/steps/sandbox/run.js index 65206dd785a..eb6d00bf7c2 100644 --- a/boxes/scripts/steps/sandbox/run.js +++ b/boxes/scripts/steps/sandbox/run.js @@ -1,17 +1,6 @@ import confirm from "@inquirer/confirm"; -import { execSync } from "child_process"; import axios from "axios"; -const sandbox = (command) => - execSync( - `docker compose -f $HOME/.aztec/docker-compose.yml -p sandbox ${command}`, - { stdio: "inherit" } - ); - -export const start = () => sandbox("up -d"); -export const stop = () => sandbox("down"); -export const log = () => sandbox("logs -f"); - export async function sandboxRunStep() { spinner.text = "Trying to reach the sandbox..."; @@ -29,7 +18,7 @@ export async function sandboxRunStep() { Accept: "*/*", "Content-Type": "application/json", }, - } + }, ); spinner.succeed(); success("The Sandbox is already running!"); diff --git a/boxes/scripts/utils.js b/boxes/scripts/utils.js index e29511266b0..e5aa33f7a71 100644 --- a/boxes/scripts/utils.js +++ b/boxes/scripts/utils.js @@ -199,7 +199,7 @@ export async function replacePaths({ rootDir, prefix = "" }) { replaces.push( new Promise(async (resolve, reject) => { let content = parse(await fs.readFile(filePath, "utf8")); - + if (!content.dependencies) return; Object.keys(content.dependencies).forEach((dep) => { const directory = content.dependencies[dep].path.replace( /^(..\/)+/, @@ -224,6 +224,7 @@ export async function replacePaths({ rootDir, prefix = "" }) { replaces.push( new Promise(async (resolve, reject) => { let content = JSON.parse(await fs.readFile(filePath, "utf8")); + if (!content.dependencies) return; Object.keys(content.dependencies) .filter((deps) => deps.match("@aztec")) // "master" actually means "latest" for the npm release diff --git a/boxes/yarn.lock b/boxes/yarn.lock index 526dda9a34f..5a2e5e285d1 100644 --- a/boxes/yarn.lock +++ b/boxes/yarn.lock @@ -15,15 +15,15 @@ __metadata: languageName: node linkType: hard -"@aztec/accounts@link:../yarn-project/accounts::locator=create-aztec-app%40workspace%3A.": +"@aztec/accounts@link:../yarn-project/accounts::locator=aztec-app%40workspace%3A.": version: 0.0.0-use.local - resolution: "@aztec/accounts@link:../yarn-project/accounts::locator=create-aztec-app%40workspace%3A." + resolution: "@aztec/accounts@link:../yarn-project/accounts::locator=aztec-app%40workspace%3A." languageName: node linkType: soft -"@aztec/aztec.js@link:../yarn-project/aztec.js::locator=create-aztec-app%40workspace%3A.": +"@aztec/aztec.js@link:../yarn-project/aztec.js::locator=aztec-app%40workspace%3A.": version: 0.0.0-use.local - resolution: "@aztec/aztec.js@link:../yarn-project/aztec.js::locator=create-aztec-app%40workspace%3A." + resolution: "@aztec/aztec.js@link:../yarn-project/aztec.js::locator=aztec-app%40workspace%3A." languageName: node linkType: soft @@ -51,15 +51,15 @@ __metadata: languageName: node linkType: hard -"@aztec/circuits.js@link:../yarn-project/circuits.js::locator=create-aztec-app%40workspace%3A.": +"@aztec/circuits.js@link:../yarn-project/circuits.js::locator=aztec-app%40workspace%3A.": version: 0.0.0-use.local - resolution: "@aztec/circuits.js@link:../yarn-project/circuits.js::locator=create-aztec-app%40workspace%3A." + resolution: "@aztec/circuits.js@link:../yarn-project/circuits.js::locator=aztec-app%40workspace%3A." languageName: node linkType: soft -"@aztec/foundation@link:../yarn-project/foundation::locator=create-aztec-app%40workspace%3A.": +"@aztec/foundation@link:../yarn-project/foundation::locator=aztec-app%40workspace%3A.": version: 0.0.0-use.local - resolution: "@aztec/foundation@link:../yarn-project/foundation::locator=create-aztec-app%40workspace%3A." + resolution: "@aztec/foundation@link:../yarn-project/foundation::locator=aztec-app%40workspace%3A." languageName: node linkType: soft @@ -113,9 +113,9 @@ __metadata: languageName: unknown linkType: soft -"@aztec/types@link:../yarn-project/types::locator=create-aztec-app%40workspace%3A.": +"@aztec/types@link:../yarn-project/types::locator=aztec-app%40workspace%3A.": version: 0.0.0-use.local - resolution: "@aztec/types@link:../yarn-project/types::locator=create-aztec-app%40workspace%3A." + resolution: "@aztec/types@link:../yarn-project/types::locator=aztec-app%40workspace%3A." languageName: node linkType: soft @@ -2353,6 +2353,26 @@ __metadata: languageName: node linkType: hard +"aztec-app@workspace:.": + version: 0.0.0-use.local + resolution: "aztec-app@workspace:." + dependencies: + "@iarna/toml": "npm:^2.2.5" + "@inquirer/confirm": "npm:^3.0.0" + "@inquirer/input": "npm:^2.0.0" + "@inquirer/select": "npm:^2.0.0" + "@playwright/test": "npm:1.42.0" + axios: "npm:^1.6.7" + commander: "npm:^12.0.0" + ora: "npm:^8.0.1" + pino: "npm:^8.19.0" + pino-pretty: "npm:^10.3.1" + tiged: "npm:^2.12.6" + bin: + aztec-app: bin.js + languageName: unknown + linkType: soft + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -3096,26 +3116,6 @@ __metadata: languageName: node linkType: hard -"create-aztec-app@workspace:.": - version: 0.0.0-use.local - resolution: "create-aztec-app@workspace:." - dependencies: - "@iarna/toml": "npm:^2.2.5" - "@inquirer/confirm": "npm:^3.0.0" - "@inquirer/input": "npm:^2.0.0" - "@inquirer/select": "npm:^2.0.0" - "@playwright/test": "npm:1.42.0" - axios: "npm:^1.6.7" - commander: "npm:^12.0.0" - ora: "npm:^8.0.1" - pino: "npm:^8.19.0" - pino-pretty: "npm:^10.3.1" - tiged: "npm:^2.12.6" - bin: - create-aztec-app: bin.js - languageName: unknown - linkType: soft - "create-jest@npm:^29.7.0": version: 29.7.0 resolution: "create-jest@npm:29.7.0" diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index 9b78a80b8e1..1d1fa22519e 100644 --- a/docs/docs/getting_started.md +++ b/docs/docs/getting_started.md @@ -2,24 +2,77 @@ title: Quickstart --- -The easiest way to start developing on Aztec locally is through `npx aztec-app`. This is a convenient way of installing the development environment (A.K.A. Sandbox) and starting new projects from a boilerplate. +You can get started with an Aztec development environment (A.K.A. Sandbox) in less than 5 minutes. -To locally install the Sandbox without other tools, see [here](./getting_started/manual_install.md). +The Sandbox is an 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. -## Prerequisites +### Prerequisites + +You need two global dependencies in your machine: - Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) - Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) -### Run the `npx` script +### Install the sandbox + +Run: + +```bash +bash -i <(curl -s install.aztec.network) +``` + +This will install the following tools: + +- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). +- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. +- **aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing. +- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. +- **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. + +Once these have been installed, to start the sandbox, run: + +```bash +aztec-sandbox +``` + +### Have fun + +**Congratulations, you have just installed and run the Aztec Sandbox!** + +```bash + /\ | | + / \ ___| |_ ___ ___ + / /\ \ |_ / __/ _ \/ __| + / ____ \ / /| || __/ (__ + /_/___ \_\/___|\__\___|\___| + +``` + +In the terminal, you will see some logs: + +1. Sandbox version +2. Contract addresses of rollup contracts +3. PXE (private execution environment) setup logs +4. Initial accounts that are shipped with the sandbox and can be used in tests + +## Running Aztec PXE / Node / P2P-Bootstrap node + +If you wish to run components of the Aztec network stack separately, you can use the `aztec start` command with various options for enabling components. + +```bash +aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] ----p2p-bootstrap [p2pOptions] +``` + +Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node.Eg if you want to run a PXE separately to a node, you can [read this guide](./aztec/concepts/pxe/index.md)/ + +## Update the sandbox -Thanks to Node, you can run the recommended `npx script`: +To update the sandbox, you can just run: ```bash -npx aztec-app +aztec-up ``` -This script gives you some options to bootstrap a new project, start/stop the sandbox, or see the logs. Run `npx aztec-app -h` for a list of options. ## Install Noir LSP (recommended) diff --git a/docs/docs/getting_started/manual_install.md b/docs/docs/getting_started/manual_install.md deleted file mode 100644 index a5e3f3ad93b..00000000000 --- a/docs/docs/getting_started/manual_install.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Manual install -sidebar_position: 1 ---- - -You can have some more control over the sandbox by installing it manually through the underlying script used by [`npx aztec-app`](../getting_started.md). - -This involves some knowledge on Docker if you want to stop, restart, or detach from logs. But it also gives you better control over things such as environment variables. - -### Prerequisites - -- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) -- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) - -### Install the sandbox - -To install the latest Sandbox version, run: - -```bash -bash -i <(curl -s install.aztec.network) -``` - -This will install the following tools: - -- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). -- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. -- **aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing. -- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. -- **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. - -Once these have been installed, to start the sandbox, run: - -```bash -aztec-sandbox -``` - -### Have fun - -**Congratulations, you have just installed and run the Aztec Sandbox!** - -```bash - /\ | | - / \ ___| |_ ___ ___ - / /\ \ |_ / __/ _ \/ __| - / ____ \ / /| || __/ (__ - /_/___ \_\/___|\__\___|\___| - -``` - -In the terminal, you will see some logs: - -1. Sandbox version -2. Contract addresses of rollup contracts -3. PXE (private execution environment) setup logs -4. Initial accounts that are shipped with the sandbox and can be used in tests - -## Running Aztec PXE / Node / P2P-Bootstrap node - -If you wish to run components of the Aztec network stack separately, you can use the `aztec start` command with various options for enabling components. - -```bash -aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] ----p2p-bootstrap [p2pOptions] -``` - -Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node.Eg if you want to run a PXE separately to a node, you can [read this guide](../aztec/concepts/pxe/index.md)/ - -## Update the sandbox - -To update the sandbox, you can just run: - -```bash -aztec-up -``` - -## Next steps - -Visit the [sandbox reference](../reference/sandbox_reference/index.md) for more info on which environment variables you can set, which cheat codes you can use, and learn about what exactly is the Aztec Sandbox.