From 225c144cd12bd227d3560ba9177ebb01e4bae77f Mon Sep 17 00:00:00 2001 From: signorecello Date: Tue, 9 Jul 2024 13:58:52 +0000 Subject: [PATCH] scoping some pending decisions and tiny nits --- boxes/README.md | 21 +++++- boxes/bin.js | 8 --- docs/docs/getting_started.md | 67 ++++++++++++++++-- docs/docs/getting_started/manual_install.md | 77 --------------------- 4 files changed, 80 insertions(+), 93 deletions(-) delete mode 100644 docs/docs/getting_started/manual_install.md diff --git a/boxes/README.md b/boxes/README.md index f7adc35ecb10..5f4215c7f14f 100644 --- a/boxes/README.md +++ b/boxes/README.md @@ -1,4 +1,23 @@ -# Aztec Boxes +# Aztec-App + +Aztec-App is a set of tools to ease development on Aztec. It consists of two main components: + +## 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 3d1bc2be6823..09cb7174db47 100755 --- a/boxes/bin.js +++ b/boxes/bin.js @@ -98,14 +98,6 @@ program 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") diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index 9b78a80b8e17..c3d61adbb1a5 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 an 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 a5e3f3ad93b2..000000000000 --- 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.