diff --git a/aztec-postprocess-contract/README.md b/aztec-postprocess-contract/README.md deleted file mode 100644 index a6512572d47f..000000000000 --- a/aztec-postprocess-contract/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## `aztec-postprocess-contract` - -The Aztec compilation process consists of two steps: -1. `aztec-nargo` which just forwards all arguments to Noir's `nargo` compiler at the version tied to this version of aztec. -2. `aztec-postprocess-contract` which post-processes the compiled contracts to prepare them for use in the Aztec ecosystem. - -### `transpile_contract_and_gen_vks.sh` -This script provides the core functionality behind the `aztec-postprocess-contract` command available via aztec-up. It performs postprocessing on compiled Noir contracts: -1. Finds all contract artifacts in `target` directories -2. Transpiles each artifact using the `avm-transpiler` -3. Generates verification keys for each artifact using `bb` (`barretenberg`'s binary) -4. Caches verification keys to speed up subsequent compilations - -Example usage: `aztec-postprocess-contract` (via aztec-up) or directly `./transpile_contract_and_gen_vks.sh` diff --git a/aztec-postprocess-contract/transpile_contract_and_gen_vks.sh b/aztec-postprocess-contract/transpile_contract_and_gen_vks.sh deleted file mode 100755 index 2fd960ab5caa..000000000000 --- a/aztec-postprocess-contract/transpile_contract_and_gen_vks.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# This script performs postprocessing on compiled Noir contracts. -# It expects to find compiled artifacts and transforms them via -# transpilation and verification key generation. -# -# Usage: transpile_contract_and_gen_vks.sh [artifact_path ...] -# If no paths provided, bb will search for artifacts in target/ directories -set -euo pipefail - -dir=$(dirname $0) -BB_BINARY_PATH=${BB_BINARY_PATH:-"$dir/../barretenberg/cpp/build/bin/bb"} - -# No arguments provided - let bb auto-discover and process all artifacts -echo "Searching for contract artifacts in target/ directories..." -$BB_BINARY_PATH aztec_process - -echo "Contract postprocessing complete!" diff --git a/aztec-up/README.md b/aztec-up/README.md index c484ecde1418..2c6a18c6d7b6 100644 --- a/aztec-up/README.md +++ b/aztec-up/README.md @@ -9,13 +9,9 @@ That is all. This will install into `~/.aztec/bin` a collection of scripts to help with running aztec containers, and will update the user's `PATH` variable in their shell startup script so they can be found. -- `aztec` - The infrastructure container. -- `aztec-cli` - A command-line tool for interacting with infrastructure. -- `aztec-nargo` - A build of `nargo` from `noir` that is guaranteed to be version-aligned. Provides compiler, lsp and more. -- `aztec-postprocess-contract` - Postprocessing tool for Aztec contracts that transpiles artifacts using `avm-transpiler` and generates verification keys using `bb`. -- `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. +- `aztec` - a collection of tools to compile and test contracts, to launch subsystems and interact with the aztec network." +- `aztec-up` - a tool to upgrade the aztec toolchain to the latest, or specific versions." +- `aztec-wallet` - our minimalistic CLI wallet" After installed, you can use `aztec-up` to upgrade or install specific versions. diff --git a/aztec-up/bin/aztec b/aztec-up/bin/aztec index 315d2fd3de5a..667a77bdccb2 100755 --- a/aztec-up/bin/aztec +++ b/aztec-up/bin/aztec @@ -54,11 +54,205 @@ function get_env_vars { awk -F"'" '{for(i=2;i<=NF;i+=2) printf $i " "}' } +function validate_working_directory { + # Validate working directory is under $HOME for Docker containerization + if [[ $PWD != ${HOME}* ]]; then + >&2 echo "Due to how we containerize our applications, we require your working directory to be somewhere within $HOME." + exit 1 + fi +} + +function run_nargo { + # Helper function to run nargo commands with proper Docker setup + # Usage: run_nargo [args...] + + # Determine if we need interactive/tty flags + if [ -t 0 ]; then + if [ -t 1 ]; then + TTY_FLAGS="-ti" + else + TTY_FLAGS="-i" + fi + fi + + # Run nargo via docker + docker run ${TTY_FLAGS:-} \ + --user $(id -u):$(id -g) \ + -v $HOME:$HOME \ + -e HOME=$HOME \ + --workdir="$PWD" \ + --entrypoint=/usr/src/noir/noir-repo/target/release/nargo \ + $DOCKER_REPO:$VERSION "$@" +} + +function setup_aztec_contract_project { + # Setup an Aztec contract project by adding dependencies and creating the main.nr template + # Usage: setup_aztec_contract_project + # If project_path is ".", operates in current directory + local PROJECT_DIR="$1" + + # Get the actual aztec version for the git tag + AZTEC_VERSION=$(docker run --rm --entrypoint=node $DOCKER_REPO:$VERSION --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js --version 2>/dev/null | tr -d '\n\r') + + # Determine file paths based on whether we're in current dir or a subdirectory + if [ "$PROJECT_DIR" = "." ]; then + NARGO_TOML_PATH="Nargo.toml" + MAIN_NR_PATH="src/main.nr" + else + NARGO_TOML_PATH="$PROJECT_DIR/Nargo.toml" + MAIN_NR_PATH="$PROJECT_DIR/src/main.nr" + fi + + # Add aztec dependency to Nargo.toml + if [ -f "$NARGO_TOML_PATH" ]; then + echo "" >> "$NARGO_TOML_PATH" + echo "aztec = { git=\"https://github.com/AztecProtocol/aztec-nr\", tag=\"v${AZTEC_VERSION}\", directory=\"aztec\" }" >> "$NARGO_TOML_PATH" + echo "Added aztec dependency (v${AZTEC_VERSION}) to Nargo.toml" + else + >&2 echo "Warning: Could not find Nargo.toml at $NARGO_TOML_PATH to add aztec dependency" + fi + + # Replace the contents of main.nr with the Aztec contract template + if [ -f "$MAIN_NR_PATH" ]; then + cat > "$MAIN_NR_PATH" << 'EOF' +use aztec::macros::aztec; + +#[aztec] +contract Main {} +EOF + echo "Created main.nr with Aztec contract template" + else + >&2 echo "Warning: Could not find main.nr at $MAIN_NR_PATH" + fi +} + +function parse_project_flags_and_build_nargo_args { + # Parse project type flags and build nargo arguments + # Usage: Call this function and it will populate NARGO_ARGS, HAS_TYPE_FLAG, IS_CONTRACT + # For 'new' command: pass "new" as first arg and handle PATH specially + # For 'init' command: pass "init" as first arg + local COMMAND="$1" + shift + + NARGO_ARGS=("$COMMAND") + HAS_TYPE_FLAG=false + IS_CONTRACT=false + PROJECT_PATH="" + + while [ "$#" -gt 0 ]; do + case $1 in + --name) + NARGO_ARGS+=("--name" "$2") + shift 2 + ;; + --lib) + NARGO_ARGS+=("--lib") + HAS_TYPE_FLAG=true + shift + ;; + --bin) + NARGO_ARGS+=("--bin") + HAS_TYPE_FLAG=true + shift + ;; + --contract) + NARGO_ARGS+=("--contract") + HAS_TYPE_FLAG=true + IS_CONTRACT=true + shift + ;; + --help|-h) + return 2 # Special return code to indicate help was requested + ;; + -*) + echo "Unknown option: $1" + echo "Run 'aztec $COMMAND --help' for usage information" + exit 1 + ;; + *) + # For 'new' command, this is the PATH argument + if [ "$COMMAND" = "new" ]; then + PROJECT_PATH="$1" + fi + NARGO_ARGS+=("$1") + shift + ;; + esac + done + + # Default to --contract if no type flag was provided + if [ "$HAS_TYPE_FLAG" = false ]; then + NARGO_ARGS+=("--contract") + IS_CONTRACT=true + fi + + return 0 +} + case ${1:-} in + compile) + shift + + # If help is requested, show Aztec-specific info then run nargo compile help and then exit in order to not trigger + # transpilation + for arg in "$@"; do + if [ "$arg" == "--help" ] || [ "$arg" == "-h" ]; then + cat << 'EOF' +Aztec Compile - Compile Aztec Noir contracts + +This command compiles Aztec Noir contracts using nargo and then automatically +postprocesses them to generate Aztec-specific artifacts including: + - Transpiled contract artifacts + - Verification keys + +The compiled contracts will be placed in the target/ directory by default. + +AZTEC-SPECIFIC NOTES: + - Working directory must be under $HOME due to Docker containerization + - Compilation automatically includes contract postprocessing + - Use standard nargo compile options (see below) + +ENVIRONMENT VARIABLES: + AZTEC_PATH Path to Aztec installation (default: $HOME/.aztec) + VERSION Aztec version to use (default: from $AZTEC_PATH/default_version) + DOCKER_REPO Docker repository (default: aztecprotocol/aztec) + +--- +Underlying nargo compile options: + +EOF + # Run nargo compile help + run_nargo compile $arg + exit 0 + fi + done + + # We didn't need to perform this check for help because there we don't need to access any files. + validate_working_directory + + # Run nargo compile + run_nargo compile "$@" + + # Check if nargo compile succeeded + if [ $? -ne 0 ]; then + >&2 echo "Compilation failed!" + exit 1 + fi + + echo "Postprocessing contract..." + + docker run ${TTY_FLAGS:-} \ + --user $(id -u):$(id -g) \ + -v $HOME:$HOME \ + -e HOME=$HOME \ + --workdir="$PWD" \ + --entrypoint=/usr/src/barretenberg/cpp/build/bin/bb-avm \ + $DOCKER_REPO:$VERSION aztec_process + + echo "Compilation complete!" + ;; test) shift - # Should this just be aztec-test? It's like, a new command that doesn't exist on aztec cli. - # Or just make this a first class command on aztec cli? export ENV_VARS_TO_INJECT="LOG_LEVEL" export LOG_LEVEL="${LOG_LEVEL:-info}" @@ -208,6 +402,151 @@ case ${1:-} in -v $(realpath $(dirname $2))/:/tmp \ $DOCKER_REPO:$VERSION /tmp/$(basename $2) $3 ;; + new) + shift + + # Parse arguments + parse_project_flags_and_build_nargo_args "new" "$@" + PARSE_RESULT=$? + + # Handle help request + if [ $PARSE_RESULT -eq 2 ]; then + cat << 'EOF' +Aztec New - Create a new Aztec Noir project in a new directory + +Usage: aztec new [OPTIONS] + +Arguments: + The path to save the new project + +Options: + --name Name of the package [default: package directory name] + --lib Use a library template + --bin Use a binary template + --contract Use a contract template [default] + -h, --help Print help + +This command creates a new Aztec Noir project using nargo and automatically +adds the Aztec.nr dependency to your Nargo.toml file. + +ENVIRONMENT VARIABLES: + AZTEC_PATH Path to Aztec installation (default: $HOME/.aztec) + VERSION Aztec version to use (default: from $AZTEC_PATH/default_version) + DOCKER_REPO Docker repository (default: aztecprotocol/aztec) + +EOF + exit 0 + fi + + # Check if PATH was provided + if [ -z "$PROJECT_PATH" ]; then + echo "Error: PATH argument is required" + echo "Usage: aztec new [OPTIONS] " + echo "Run 'aztec new --help' for more information" + exit 1 + fi + + validate_working_directory + + echo "Creating new Noir project at $PROJECT_PATH..." + + # Run nargo new via docker + run_nargo "${NARGO_ARGS[@]}" + + # Check if nargo new succeeded + if [ $? -ne 0 ]; then + >&2 echo "Project creation failed!" + exit 1 + fi + + # Setup Aztec contract project (add dependency and create template) + if [ "$IS_CONTRACT" = true ]; then + setup_aztec_contract_project "$PROJECT_PATH" + fi + ;; + init) + shift + + # Parse arguments + parse_project_flags_and_build_nargo_args "init" "$@" + PARSE_RESULT=$? + + # Handle help request + if [ $PARSE_RESULT -eq 2 ]; then + cat << 'EOF' +Aztec Init - Create a new Aztec Noir project in the current directory + +Usage: aztec init [OPTIONS] + +Options: + --name Name of the package [default: current directory name] + --lib Use a library template + --bin Use a binary template + --contract Use a contract template [default] + -h, --help Print help + +This command creates a new Aztec Noir project in the current directory using nargo +and automatically adds the Aztec.nr dependency to your Nargo.toml file. + +ENVIRONMENT VARIABLES: + AZTEC_PATH Path to Aztec installation (default: $HOME/.aztec) + VERSION Aztec version to use (default: from $AZTEC_PATH/default_version) + DOCKER_REPO Docker repository (default: aztecprotocol/aztec) + +EOF + exit 0 + fi + + validate_working_directory + + echo "Initializing Noir project..." + + # Run nargo init via docker + run_nargo "${NARGO_ARGS[@]}" + + # Check if nargo init succeeded + if [ $? -ne 0 ]; then + >&2 echo "Initialization failed!" + exit 1 + fi + + # Setup Aztec contract project (add dependency and create template) + if [ "$IS_CONTRACT" = true ]; then + setup_aztec_contract_project "." + fi + ;; + fmt) + shift + + validate_working_directory + + # Run nargo fmt + run_nargo fmt "$@" + ;; + check) + shift + + validate_working_directory + + # Run nargo check + run_nargo check "$@" + ;; + lsp) + # TODO: Drop this (and the corresponding docs in cli.ts) in case `nargo` is to be used natively (not containerized). + + # Special-case nargo's LSP command: + # 1. include --rm for cleanup + # 2. don't specify a user (run as root) + # 3. don't specify a workdir + validate_working_directory + + docker run --rm -i \ + --name aztec-nargo-lsp \ + -v $HOME:$HOME \ + -e HOME=$HOME \ + --entrypoint=/usr/src/noir/noir-repo/target/release/nargo \ + $DOCKER_REPO:$VERSION lsp + ;; *) export ENV_VARS_TO_INJECT="SECRET_KEY" exec $(dirname $0)/.aztec-run aztec \ diff --git a/aztec-up/bin/aztec-install b/aztec-up/bin/aztec-install index 7d5a808feeb4..b1227609c35f 100755 --- a/aztec-up/bin/aztec-install +++ b/aztec-up/bin/aztec-install @@ -58,9 +58,7 @@ function title() { echo -e "${r}" fi echo -e "This will install the following scripts and update your PATH if necessary:" - echo -e " ${bold}${g}aztec${r} - a collection of tools to launch subsystems and interact with the aztec network." - echo -e " ${bold}${g}aztec-nargo${r} - aztec's build of nargo, the noir compiler toolchain." - echo -e " ${bold}${g}aztec-postprocess-contract${r} - postprocessing tool for Aztec contracts (transpilation and VK generation)." + echo -e " ${bold}${g}aztec${r} - a collection of tools to compile and test contracts, to launch subsystems and interact with the aztec network." echo -e " ${bold}${g}aztec-up${r} - a tool to upgrade the aztec toolchain to the latest, or specific versions." echo -e " ${bold}${g}aztec-wallet${r} - our minimalistic CLI wallet" echo @@ -161,8 +159,6 @@ rm -rf $BIN_PATH && mkdir -p $BIN_PATH install_bin .aztec-run install_bin aztec install_bin aztec-up -install_bin aztec-nargo -install_bin aztec-postprocess-contract install_bin aztec-wallet mv "$TMP_VERSION_FILE" "$AZTEC_PATH/default_version" diff --git a/aztec-up/bin/aztec-nargo b/aztec-up/bin/aztec-nargo deleted file mode 100755 index 1310a0e1bf09..000000000000 --- a/aztec-up/bin/aztec-nargo +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -if [[ $PWD != ${HOME}* ]]; then - >&2 echo "Due to how we containerize our applications, we require your working directory to be somewhere within $HOME." - exit 1 -fi - -AZTEC_PATH="${AZTEC_PATH:-$HOME/.aztec}" -DEFAULT_VERSION=$(cat "$AZTEC_PATH/default_version" 2> /dev/null || echo latest) -VERSION="${VERSION:-$DEFAULT_VERSION}" -DOCKER_REPO="${DOCKER_REPO:-"aztecprotocol/aztec"}" -IMAGE="$DOCKER_REPO:$VERSION" - -# Special-case nargo's LSP command: -# 1. include --rm for cleanup -# 2. don't specify a user (run as root) -# 3. don't specify a workdir -if [ "${1:-}" == "lsp" ]; then - docker run --rm -i \ - --name aztec-nargo-lsp \ - -v $HOME:$HOME \ - -e HOME=$HOME \ - --entrypoint=/usr/src/noir/noir-repo/target/release/nargo \ - $IMAGE lsp - exit -fi - -# Determine if we need interactive/tty flags -if [ -t 0 ]; then - if [ -t 1 ]; then - args="-ti" - else - args="-i" - fi -fi - -# Pass through directly to vanilla nargo -docker run ${args:-} \ - --user $(id -u):$(id -g) \ - -v $HOME:$HOME \ - -e HOME=$HOME \ - --workdir="$PWD" \ - --entrypoint=/usr/src/noir/noir-repo/target/release/nargo \ - $IMAGE "$@" diff --git a/aztec-up/bin/aztec-postprocess-contract b/aztec-up/bin/aztec-postprocess-contract deleted file mode 100755 index 6f0ddf1ae928..000000000000 --- a/aztec-up/bin/aztec-postprocess-contract +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -if [[ $PWD != ${HOME}* ]]; then - >&2 echo "Due to how we containerize our applications, we require your working directory to be somewhere within $HOME." - exit 1 -fi - -AZTEC_PATH="${AZTEC_PATH:-$HOME/.aztec}" -DEFAULT_VERSION=$(cat "$AZTEC_PATH/default_version" 2> /dev/null || echo latest) -VERSION="${VERSION:-$DEFAULT_VERSION}" -DOCKER_REPO="${DOCKER_REPO:-"aztecprotocol/aztec"}" - -# Determine if we need interactive/tty flags -if [ -t 0 ]; then - if [ -t 1 ]; then - args="-ti" - else - args="-i" - fi -fi - -# Run the aztec-postprocess-contract script from within the container -docker run ${args:-} \ - --user $(id -u):$(id -g) \ - -v $HOME:$HOME \ - -e HOME=$HOME \ - --workdir="$PWD" \ - --entrypoint=/usr/src/aztec-postprocess-contract/transpile_contract_and_gen_vks.sh \ - $DOCKER_REPO:$VERSION "$@" diff --git a/aztec-up/test/basic_install.sh b/aztec-up/test/basic_install.sh index f7a270c302fb..94ad75f14be4 100755 --- a/aztec-up/test/basic_install.sh +++ b/aztec-up/test/basic_install.sh @@ -30,17 +30,15 @@ PS1=" " source ~/.bash_profile # Sanity check lsp. echo "Checking LSP..." echo -ne 'Content-Length: 100\r\n\r\n{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"rootUri": null, "capabilities": {}}}' \ - | aztec-nargo lsp \ + | aztec lsp \ | grep -q '"jsonrpc":"2.0"' echo "LSP check passed." -# aztec-nargo -V # aztec -V # aztec-wallet -V # aztec-up -# aztec-nargo -V # aztec -V # aztec-wallet -V diff --git a/aztec-up/test/counter_contract.sh b/aztec-up/test/counter_contract.sh index 3c54816fbf80..e87d84bc9e56 100755 --- a/aztec-up/test/counter_contract.sh +++ b/aztec-up/test/counter_contract.sh @@ -38,7 +38,7 @@ export LOG_LEVEL=silent # while ! curl -fs host.docker.internal:8080/status &>/dev/null; do sleep 1; done # Execute commands as per: https://docs.aztec.network/tutorials/codealong/contract_tutorials/counter_contract -aztec-nargo new --contract counter_contract +aztec new --contract counter_contract if [ ! -f counter_contract/Nargo.toml ] || [ ! -f counter_contract/src/main.nr ]; then echo "Failed to create contract." exit 1 @@ -56,9 +56,7 @@ cd counter_contract sed -i 's|\.\./\.\./\.\./\.\./|/home/ubuntu/aztec-packages/noir-projects/|g' Nargo.toml # Compile the contract. -aztec-nargo compile -# Post-process the contract. -aztec-postprocess-contract +aztec compile # Codegen aztec codegen -o src/artifacts target if [ ! -d src/artifacts ]; then diff --git a/boxes/bootstrap.sh b/boxes/bootstrap.sh index 1fed41d24e4d..7d09e1076796 100755 --- a/boxes/bootstrap.sh +++ b/boxes/bootstrap.sh @@ -3,12 +3,9 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} -export TRANSPILER=$PWD/../avm-transpiler/target/release/avm-transpiler -export BB=$PWD/../barretenberg/cpp/build/bin/bb -export NARGO=$PWD/../noir/noir-repo/target/release/nargo -export AZTEC_NARGO=$PWD/../aztec-up/bin/aztec-nargo -export AZTEC_POSTPROCESS_CONTRACT=$PWD/../aztec-up/bin/aztec-postprocess-contract -export AZTEC_BUILDER=$PWD/../yarn-project/builder/aztec-builder-dest +# We set container name to "" to avoid container name collisions when building boxes +export CONTAINER_NAME="" +export AZTEC=$PWD/../aztec-up/bin/aztec hash=$(hash_str \ $(../noir/bootstrap.sh hash) \ diff --git a/boxes/boxes/react/package.json b/boxes/boxes/react/package.json index a4d19a2bcaa3..e75a7e367ab7 100644 --- a/boxes/boxes/react/package.json +++ b/boxes/boxes/react/package.json @@ -6,8 +6,8 @@ "type": "module", "main": "./dist/index.js", "scripts": { - "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings && ${AZTEC_POSTPROCESS_CONTRACT:-aztec-postprocess-contract}", - "codegen": "${AZTEC_BUILDER:-aztec} codegen src/contracts/target -o artifacts", + "compile": "cd src/contracts && CONTAINER_NAME=\"aztec-react-box\" ${AZTEC:-aztec} compile --silence-warnings", + "codegen": "CONTAINER_NAME=\"aztec-react-box\" ${AZTEC:-aztec} codegen src/contracts/target -o artifacts", "clean": "rm -rf ./dist .tsbuildinfo ./codegenCache.json ./artifacts ./src/contracts/target", "prep": "yarn clean && yarn compile && yarn codegen", "dev": "yarn prep && webpack serve --mode development", diff --git a/boxes/boxes/vanilla/package.json b/boxes/boxes/vanilla/package.json index febc3afed32d..d7725187ec1d 100644 --- a/boxes/boxes/vanilla/package.json +++ b/boxes/boxes/vanilla/package.json @@ -8,8 +8,8 @@ }, "scripts": { "clean": "rm -rf app/dist contracts/target contracts/codegenCache.json", - "compile-contracts": "cd contracts && ${AZTEC_NARGO:-aztec-nargo} compile && ${AZTEC_POSTPROCESS_CONTRACT:-aztec-postprocess-contract}", - "codegen-contracts": "cd contracts && ${AZTEC_BUILDER:-aztec} codegen ./target -o ./target", + "compile-contracts": "cd contracts && CONTAINER_NAME=\"aztec-vanilla-box\" ${AZTEC:-aztec} compile", + "codegen-contracts": "cd contracts && CONTAINER_NAME=\"aztec-vanilla-box\" ${AZTEC:-aztec} codegen ./target -o ./target", "copy-artifacts": "mkdir -p artifacts && cp contracts/target/*.json contracts/target/*.ts ./artifacts", "build-contracts": "yarn clean && yarn compile-contracts && yarn codegen-contracts && yarn copy-artifacts", "deploy-contracts": "node --experimental-transform-types scripts/deploy.ts", diff --git a/boxes/boxes/vite/package.json b/boxes/boxes/vite/package.json index 598d2737010a..6868f15097b6 100644 --- a/boxes/boxes/vite/package.json +++ b/boxes/boxes/vite/package.json @@ -4,8 +4,8 @@ "version": "0.0.0", "type": "module", "scripts": { - "compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings && ${AZTEC_POSTPROCESS_CONTRACT:-aztec-postprocess-contract}", - "codegen": "${AZTEC_BUILDER:-aztec} codegen src/contracts/target -o artifacts", + "compile": "cd src/contracts && CONTAINER_NAME=\"aztec-vite-box\" ${AZTEC:-aztec} compile --silence-warnings", + "codegen": "CONTAINER_NAME=\"aztec-vite-box\" ${AZTEC:-aztec} codegen src/contracts/target -o artifacts", "clean": "rm -rf ./dist .tsbuildinfo ./codegenCache.json ./artifacts ./src/contracts/target", "prep": "yarn clean && yarn compile && yarn codegen", "build": "yarn prep && tsc -b && vite build", diff --git a/boxes/contract-only/package.json b/boxes/contract-only/package.json index 3943671f8f41..3a6073470eb6 100644 --- a/boxes/contract-only/package.json +++ b/boxes/contract-only/package.json @@ -5,8 +5,8 @@ "version": "0.1.0", "type": "module", "scripts": { - "compile": "cd src && ${AZTEC_NARGO:-aztec-nargo} compile && ${AZTEC_POSTPROCESS_CONTRACT:-aztec-postprocess-contract}", - "codegen": "${AZTEC_BUILDER:-aztec-builder} codegen target -o artifacts", + "compile": "cd src && ${AZTEC:-aztec} compile", + "codegen": "${AZTEC:-aztec} codegen target -o artifacts", "clean": "rm -rf ./dest .tsbuildinfo ./artifacts ./target", "prep": "yarn clean && yarn compile && yarn codegen && tsc -b", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --runInBand", diff --git a/cspell.json b/cspell.json index 11f5be22c3b2..59bf9cd1acf9 100644 --- a/cspell.json +++ b/cspell.json @@ -331,6 +331,7 @@ "tparam", "transferables", "transitioner", + "transpiles", "trivago", "tsbuildinfo", "tsdoc", diff --git a/docs/docs/developers/docs/aztec-js/how_to_deploy_contract.md b/docs/docs/developers/docs/aztec-js/how_to_deploy_contract.md index 341096d3a8d9..e79d128677f4 100644 --- a/docs/docs/developers/docs/aztec-js/how_to_deploy_contract.md +++ b/docs/docs/developers/docs/aztec-js/how_to_deploy_contract.md @@ -20,8 +20,7 @@ This guide shows you how to deploy compiled contracts to Aztec using the generat ```bash # Compile the contract -aztec-nargo compile -aztec-postprocess-contract +aztec compile # Generate TypeScript interface aztec codegen ./target/my_contract-MyContract.json -o src/artifacts diff --git a/docs/docs/developers/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md b/docs/docs/developers/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md index 770e8ba2ab72..059b4f7811a0 100644 --- a/docs/docs/developers/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md +++ b/docs/docs/developers/docs/aztec-nr/framework-description/advanced/how_to_profile_transactions.md @@ -9,7 +9,7 @@ This guide shows you how to profile your Aztec transactions to identify bottlene ## Prerequisites -- `aztec-nargo` installed ([see installation](../../../aztec-cli/sandbox-reference.md)) +- `aztec` command installed ([see installation](../../../aztec-cli/sandbox-reference.md)) - `aztec-wallet` installed (part of Sandbox) - Aztec contract deployed and ready to test - Basic understanding of proving and gate counts @@ -111,7 +111,7 @@ Flamegraph generation is experimental and may not be available in all versions. ```bash # Compile first -aztec-nargo compile +aztec compile # Generate flamegraph aztec flamegraph target/contract.json function_name diff --git a/docs/docs/developers/docs/aztec-nr/how_to_compile_contract.md b/docs/docs/developers/docs/aztec-nr/how_to_compile_contract.md index 2b689d873c9a..1ae272aeba4a 100644 --- a/docs/docs/developers/docs/aztec-nr/how_to_compile_contract.md +++ b/docs/docs/developers/docs/aztec-nr/how_to_compile_contract.md @@ -2,7 +2,7 @@ title: Compiling Contracts tags: [contracts] sidebar_position: 2 -description: Compile your Aztec smart contracts into deployable artifacts using aztec-nargo. +description: Compile your Aztec smart contracts into deployable artifacts using aztec command. --- This guide shows you how to compile your Aztec contracts into artifacts ready for deployment and interaction. @@ -10,48 +10,19 @@ This guide shows you how to compile your Aztec contracts into artifacts ready fo ## Prerequisites - An Aztec contract written in Aztec.nr -- `aztec-nargo` installed (included with the sandbox) +- `aztec` installed (included with the sandbox) - Contract project with proper `Nargo.toml` configuration ## Compile your contract -### Step 1: Compile to JSON artifacts - Compile your Noir contracts to generate JSON artifacts: ```bash -aztec-nargo compile +aztec compile ``` This outputs contract artifacts to the `target` folder. -### Step 2: Process for Aztec - -Process the artifacts for Aztec compatibility: - -```bash -aztec-postprocess-contract -``` - -This step: -- Transpiles functions for the Aztec VM -- Generates verification keys for private functions -- Caches keys for faster subsequent compilations - -:::note -The `aztec-nargo compile` command looks for `Nargo.toml` files by ascending up the parent directories, and will compile the top-most Nargo.toml file it finds. -Eg: if you are in `/hobbies/cool-game/contracts/easter-egg/`, and both `cool-game` and `easter-egg` contain a Nargo.toml file, then `aztec-nargo compile` will be performed on `cool-game/Nargo.toml` and compile the project(s) specified within it. Eg - -``` -[workspace] -members = [ - "contracts/easter-egg", -] -``` - -The `aztec-postprocess-contract` command will process all contract artifacts it finds in `target` directories within the current directory tree. -::: - ## Use generated interfaces The compiler automatically generates type-safe interfaces for contract interaction. diff --git a/docs/docs/developers/docs/aztec-nr/installation.md b/docs/docs/developers/docs/aztec-nr/installation.md index 4e2cdd81d63b..f0bdbfb14788 100644 --- a/docs/docs/developers/docs/aztec-nr/installation.md +++ b/docs/docs/developers/docs/aztec-nr/installation.md @@ -7,12 +7,12 @@ description: Learn how to install and configure the Noir Language Server for a b Install the [Noir Language Support extension](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir) to get syntax highlighting, syntax error detection and go-to definitions for your Aztec contracts. -Once the extension is installed, check your nargo binary by hovering over Nargo in the status bar on the bottom right of the application window. Click to choose the path to aztec-nargo (or regular nargo, if you have that installed). +Once the extension is installed, check your nargo binary by hovering over Nargo in the status bar on the bottom right of the application window. Click to choose the path to `aztec` (or regular nargo, if you have that installed). -You can print the path of your `aztec-nargo` executable by running: +You can print the path of your `aztec` executable by running: ```bash -which aztec-nargo +which aztec ``` -To specify a custom nargo executable, go to the VSCode settings and search for "noir", or click extension settings on the `noir-lang` LSP plugin. Update the `Noir: Nargo Path` field to point to your desired `aztec-nargo` executable. +To specify a custom nargo executable, go to the VSCode settings and search for "noir", or click extension settings on the `noir-lang` LSP plugin. Update the `Noir: Nargo Path` field to point to your desired `aztec` executable. diff --git a/docs/docs/developers/docs/resources/glossary.md b/docs/docs/developers/docs/resources/glossary.md index 90080ee528d4..20fe80907999 100644 --- a/docs/docs/developers/docs/resources/glossary.md +++ b/docs/docs/developers/docs/resources/glossary.md @@ -16,7 +16,7 @@ The Aztec Virtual Machine (AVM) executes the public section of a transaction. It Aztec is a privacy-first Layer 2 rollup on Ethereum. It supports smart contracts with both private & public state and private & public execution. -`aztec` is a CLI tool (with an extensive set of parameters) that enables users to perform a wide range of tasks. It can: run a node, run a sandbox, execute tests, generate contract interfaces for javascript and more. +`aztec` is a CLI tool (with an extensive set of parameters) that enables users to perform a wide range of tasks. It can: compile and test contracts, run a node, run a sandbox, execute tests, generate contract interfaces for javascript and more. Full reference [here](../aztec-cli/cli_reference). @@ -26,12 +26,6 @@ The Aztec Wallet is a CLI wallet, `aztec-wallet`, that allows a user to manage a Full reference [here](../wallet-cli/cli_wallet_reference). -### `aztec-nargo` - -The command line tool used to compile Aztec contracts. It is a specific version of `nargo`, with additional transpiler for turning a contract's public function code from Noir brillig bytecode into Aztec Virtual Machine (AVM) bytecode. - -You can read more about `nargo` [here](#nargo). - ### `aztec-up` `aztec-up` updates the local aztec executables to the latest version (default behavior) or to a specified version. @@ -82,7 +76,7 @@ Noir is a Domain Specific Language (DSL) for SNARK proving systems. It is used f ### Noir Language Server -The Noir Language Server can be used in vscode to facilitate writing programs in Noir by providing syntax highlighting, circuit introspection and an execution interface. The Noir LSP addon allows the dev to choose their tool, nargo or aztec-nargo, when writing a pure Noir program or an Aztec smart contract. +The Noir Language Server can be used in vscode to facilitate writing programs in Noir by providing syntax highlighting, circuit introspection and an execution interface. The Noir LSP addon allows the dev to choose their tool, nargo or `aztec`, when writing a pure Noir program or an Aztec smart contract. You can find more info about the LSP [in the Noir docs](https://noir-lang.org/docs/tooling/language_server). @@ -144,7 +138,7 @@ Included in the sandbox: - Local Ethereum network (Anvil) - Deployed Aztec protocol contracts (for L1 and L2) - A set of test accounts with some test tokens to pay fees -- Development tools to compile contracts and interact with the network (aztec-nargo and aztec-wallet) +- Development tools to compile contracts and interact with the network (aztec command and aztec-wallet) - All of this comes packaged in a Docker container to make it easy to install and run. ### Sequencer diff --git a/docs/docs/developers/docs/resources/migration_notes.md b/docs/docs/developers/docs/resources/migration_notes.md index 7c2edd6f65f5..2f9aa71d6e62 100644 --- a/docs/docs/developers/docs/resources/migration_notes.md +++ b/docs/docs/developers/docs/resources/migration_notes.md @@ -170,6 +170,32 @@ fn withdraw(amount: u128, recipient: AztecAddress) { } ``` +## [`aztec` command] Moving functionality of `aztec-nargo` to `aztec` command + +`aztec-nargo` has been deprecated and all workflows should now migrate to the `aztec` command that fully replaces `aztec-nargo`: + +- **For contract initialization:** + + ```bash + aztec init + ``` + + (Behaves like `nargo init`, but defaults to a contract project.) + +- **For testing:** + + ```bash + aztec test + ``` + + (Starts the Aztec TXE and runs your tests.) + +- **For compiling contracts:** + ```bash + aztec compile + ``` + (Transpiles your contracts and generates verification keys.) + ## 3.0.0-devnet.4 ## [aztec.js] Removal of barrel export diff --git a/docs/docs/developers/docs/tutorials/contract_tutorials/counter_contract.md b/docs/docs/developers/docs/tutorials/contract_tutorials/counter_contract.md index 994c0f0d594b..038b38266f20 100644 --- a/docs/docs/developers/docs/tutorials/contract_tutorials/counter_contract.md +++ b/docs/docs/developers/docs/tutorials/contract_tutorials/counter_contract.md @@ -21,7 +21,7 @@ This tutorial is compatible with the Aztec version `#include_aztec_version`. Ins Run this to create a new contract project: ```bash -aztec-nargo new --contract counter +aztec new --contract counter ``` Your structure should look like this: @@ -125,8 +125,7 @@ Now we've written a simple Aztec.nr smart contract, we can compile it. In `./counter/` directory, run these commands: ```bash -aztec-nargo compile # generate contract artifacts -aztec-postprocess-contract # transpile contracts and generate verification keys +aztec compile # compiles the contract ``` The first command compiles your Noir contract and creates a `target` folder with a `.json` artifact inside. The second command processes these artifacts for use with Aztec (transpiling for the AVM and generating verification keys). Do not worry if you see some warnings - Aztec is in fast development and it is likely you will see some irrelevant warning messages. diff --git a/docs/docs/developers/docs/tutorials/contract_tutorials/token_contract.md b/docs/docs/developers/docs/tutorials/contract_tutorials/token_contract.md index 136bbddabcfc..186bec9ade0f 100644 --- a/docs/docs/developers/docs/tutorials/contract_tutorials/token_contract.md +++ b/docs/docs/developers/docs/tutorials/contract_tutorials/token_contract.md @@ -42,7 +42,7 @@ yarn init # This is to ensure yarn uses node_modules instead of pnp for dependency installation yarn config set nodeLinker node-modules yarn add @aztec/aztec.js@#include_aztec_version @aztec/accounts@#include_aztec_version @aztec/test-wallet@#include_aztec_version @aztec/kv-store@#include_aztec_version -aztec-nargo init --contract +aztec init ``` ## Contract structure @@ -171,8 +171,7 @@ In case Giggle's mental health program administration changes: You've written enough code to have a working token! Let's compile and test it: ```bash -aztec-nargo compile -aztec-postprocess-contract +aztec compile ``` ### Generate TypeScript Interface @@ -361,8 +360,7 @@ Now you've made changes to your contract, you need to recompile your contract. Here are the steps from above, for reference: ```bash -aztec-nargo compile -aztec-postprocess-contract +aztec compile aztec codegen target --outdir artifacts ``` diff --git a/docs/docs/developers/docs/tutorials/js_tutorials/token_bridge.md b/docs/docs/developers/docs/tutorials/js_tutorials/token_bridge.md index 32c9db09981b..c4f4c2f408a3 100644 --- a/docs/docs/developers/docs/tutorials/js_tutorials/token_bridge.md +++ b/docs/docs/developers/docs/tutorials/js_tutorials/token_bridge.md @@ -80,7 +80,7 @@ graph LR Let's create that crate in the `contracts` folder so it looks tidy: ```bash -aztec-nargo new --contract contracts/aztec/nft +aztec new contracts/aztec/nft cd contracts/aztec/nft ``` @@ -162,7 +162,7 @@ The bridge will also need to burn NFTs when users withdraw back to L1: Let's verify it compiles: ```bash -aztec-nargo compile +aztec compile ``` 🎉 You should see "Compiled successfully!" This means our private NFT contract is ready. Now let's build the bridge. @@ -205,7 +205,7 @@ Let's create a new contract in the same tidy `contracts/aztec` folder: ```bash cd .. -aztec-nargo new --contract nft_bridge +aztec new --contract nft_bridge cd nft_bridge ``` @@ -265,18 +265,16 @@ Both `claim` and `exit` are `#[private]`, which means the bridging process is pr ### Compile the Bridge ```bash -aztec-nargo compile +aztec compile ``` Bridge compiled successfully! Now process both contracts and generate TypeScript bindings: ```bash cd ../nft -aztec-postprocess-contract aztec codegen target --outdir ../artifacts cd ../nft_bridge -aztec-postprocess-contract aztec codegen target --outdir ../artifacts ``` diff --git a/docs/docs/developers/docs/tutorials/sandbox.md b/docs/docs/developers/docs/tutorials/sandbox.md index e8ecee699dc0..303ef815ab14 100644 --- a/docs/docs/developers/docs/tutorials/sandbox.md +++ b/docs/docs/developers/docs/tutorials/sandbox.md @@ -13,7 +13,7 @@ description: Information about running the Aztec sandbox development environment On this page you will find - [Understanding versions](#versions) -- [How to automatically update Aztec sandbox and aztec-nargo](#updating) +- [How to automatically update Aztec sandbox and aztec command](#updating) - [How to update Aztec.nr packages](#updating-aztecnr-packages) - [How to update Aztec.js packages](#updating-aztecjs-packages) - [How to enable client-side proving](#sandbox-pxe-proving) @@ -23,12 +23,6 @@ On this page you will find Aztec tools (sandbox, nargo), dependencies (Aztec.nr), and sample contracts are constantly being improved. When developing and referring to example .nr files/snippets, it is helpful to verify the versions of different components (below), and if required keep them in lock-step by [updating](#updating). -### Checking tool versions - -:::note -The `aztec-nargo` versions follow `nargo` versions, which is different to the Aztec tool versions. -::: - ### Dependency versions Dependency versions in a contract's `Nargo.toml` file correspond to the `aztec-packages` repository tag `aztec-packages` (filter tags by `aztec`...) @@ -58,13 +52,13 @@ diff ~/nargo/github.com/AztecProtocol/v0.23.0/yarn-project/noir-contracts/contra ::: -### Language server version (aztec-nargo) +### Language server version -The [Noir LSP](../aztec-nr/installation.md) uses your local version of `aztec-nargo`, and thus also `aztec-nargo compile`. -The path of the former (once installed) can be seen by hovering over "Nargo" in the bottom status bar of VS Code, and the latter via the `which aztec-nargo` command. +The [Noir LSP](../aztec-nr/installation.md) uses your local version of `aztec`, and thus also `aztec compile`. +The path of the former (once installed) can be seen by hovering over "Nargo" in the bottom status bar of VS Code, and the latter via the `which aztec` command. :::caution -For Aztec contract files, this should be `aztec-nargo` and for noir-only files this should be `nargo`. Mismatching tools and file types will generate misleading syntax and compiler errors. +For Aztec contract files, this should be `aztec` and for noir-only files this should be `nargo`. Mismatching tools and file types will generate misleading syntax and compiler errors. ::: This can present confusion when opening older contracts (and dependencies) written in older version of noir, such as: @@ -77,7 +71,7 @@ This can present confusion when opening older contracts (and dependencies) writt ### Steps to keep up to date -1. Update the Aztec sandbox to the latest version (includes `aztec-nargo`, pxe, etc): +1. Update the Aztec sandbox to the latest version (includes `aztec` command, pxe, etc): ```shell aztec-up @@ -110,9 +104,8 @@ Follow [updating Aztec.nr packages](#updating-aztecnr-packages) and [updating Ja There are four components whose versions need to be kept compatible: -1. Aztec Sandbox -2. aztec-nargo -3. `Aztec.nr`, the Noir framework for writing Aztec contracts +1. Aztec Sandbox (includes the `aztec` command) +2. `Aztec.nr`, the Noir framework for writing Aztec contracts First three are packaged together in docker and are kept compatible by running `aztec-up`. But you need to update your Aztec.nr version manually or using `aztec update`. @@ -143,8 +136,7 @@ Go to the contract directory and try compiling it to verify that the update was ```shell cd /your/contract/directory -aztec-nargo compile # generate contract artifacts -aztec-postprocess-contract # transpile contract and generate verification keys +aztec compile # compiles the contract ``` If the dependencies fail to resolve ensure that the tag matches a tag in the [aztec-packages repository (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tags). diff --git a/docs/docs/developers/docs/wallet-cli/faceid_wallet.md b/docs/docs/developers/docs/wallet-cli/faceid_wallet.md index 101060e35820..a4a8fbae1911 100644 --- a/docs/docs/developers/docs/wallet-cli/faceid_wallet.md +++ b/docs/docs/developers/docs/wallet-cli/faceid_wallet.md @@ -86,8 +86,7 @@ This creates a new project, skips running the sandbox (`-s`), and clones the con ```bash cd token_contract -aztec-nargo compile # generate contract artifacts -aztec-postprocess-contract # transpile contract and generate verification keys +aztec compile # compile contract ``` Great, our contract is ready to deploy with our TouchID wallet: diff --git a/docs/docs/developers/getting_started_on_sandbox.md b/docs/docs/developers/getting_started_on_sandbox.md index d1464effedee..17a58020a494 100644 --- a/docs/docs/developers/getting_started_on_sandbox.md +++ b/docs/docs/developers/getting_started_on_sandbox.md @@ -17,7 +17,7 @@ What's included in the sandbox: - Local Ethereum network (Anvil) - Deployed Aztec protocol contracts (for L1 and L2) - A set of test accounts with some test tokens to pay fees -- Development tools to compile contracts and interact with the network (`aztec-nargo` and `aztec-wallet`) +- Development tools to compile contracts and interact with the network (`aztec` and `aztec-wallet`) All of this comes packages in a Docker container to make it easy to install and run. @@ -48,9 +48,7 @@ bash -i <(curl -s https://install.aztec.network) This will install the following tools: -- **aztec** - launches various infrastructure subsystems (full sandbox, sequencer, prover, pxe, etc) and provides utility commands to interact with the network -- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. -- **aztec-postprocess-contract** - postprocessing tool for Aztec contracts (transpilation and VK generation). +- **aztec** - compiles and tests aztec contracts and launches various infrastructure subsystems (full sandbox, sequencer, prover, pxe, etc) and provides utility commands to interact with the network - **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. - **aztec-wallet** - a tool for interacting with the aztec network diff --git a/docs/docs/the_aztec_network/prerequisites.md b/docs/docs/the_aztec_network/prerequisites.md index 7eb7193618aa..243f4eb824c4 100644 --- a/docs/docs/the_aztec_network/prerequisites.md +++ b/docs/docs/the_aztec_network/prerequisites.md @@ -167,7 +167,7 @@ Verify installation: ```bash ls ~/.aztec/bin -# Should show: aztec, aztec-up, aztec-nargo, and aztec-wallet +# Should show: aztec, aztec-up, and aztec-wallet ``` Add Aztec to your PATH: diff --git a/docs/internal_notes/dev_docs/sandbox/components.md b/docs/internal_notes/dev_docs/sandbox/components.md index bf7061ee618a..61b08178b547 100644 --- a/docs/internal_notes/dev_docs/sandbox/components.md +++ b/docs/internal_notes/dev_docs/sandbox/components.md @@ -98,9 +98,9 @@ Design an Aztec.nr contract artifact, similar to a Solidity ABI which is output - Public input/output witness indices? - Sourcemap information, allowing building of stack traces in simulator error cases. -### aztec-nargo +### aztec -Provides the `aztec-nargo` binary for compiling contracts from the command line. +A tool that allows you to compile Aztec contracts. ### aztec.js diff --git a/playground/src/components/contract/components/ContractUpload.tsx b/playground/src/components/contract/components/ContractUpload.tsx index c265e9b81d87..f7efd6baff28 100644 --- a/playground/src/components/contract/components/ContractUpload.tsx +++ b/playground/src/components/contract/components/ContractUpload.tsx @@ -81,7 +81,7 @@ export function ContractUpload() { > 1. Install Aztec CLI by running `aztec-up {network.version || VERSION}`
- 2. Run `aztec-nargo compile` in your project directory + 2. Run `aztec compile` in your project directory
3. Look for `{''}.json` file in the ./target directory diff --git a/release-image/Dockerfile.dockerignore b/release-image/Dockerfile.dockerignore index c4e08aa3fd1e..6c21355c9174 100644 --- a/release-image/Dockerfile.dockerignore +++ b/release-image/Dockerfile.dockerignore @@ -1,7 +1,6 @@ * !/.release-please-manifest.json !/avm-transpiler/target/release/avm-transpiler -!/aztec-postprocess-contract/transpile_contract_and_gen_vks.sh !/barretenberg/cpp/build/bin/bb-avm !/barretenberg/ts/dest/ !/barretenberg/ts/package.json diff --git a/yarn-project/aztec/src/cli/cli.ts b/yarn-project/aztec/src/cli/cli.ts index 3b41254b5fd9..5b898cd72214 100644 --- a/yarn-project/aztec/src/cli/cli.ts +++ b/yarn-project/aztec/src/cli/cli.ts @@ -37,10 +37,55 @@ export function injectAztecCommands(program: Command, userLog: LogFn, debugLogge Additional commands: + init [folder] [options]: creates a new Noir project + Options: + --name Name of the package + --contract Use a contract template (default) + --lib Use a library template + --bin Use a binary template + Examples: + $ aztec init # creates a contract project in current directory + $ aztec init --lib # creates a library project + + new [options]: creates a new Noir project in a new directory + Options: + --name Name of the package + --contract Use a contract template (default) + --lib Use a library template + --bin Use a binary template + Examples: + $ aztec new my-project # creates a contract project in ./my-project + $ aztec new my-lib --lib # creates a library project in ./my-lib + + compile [options]: compiles Aztec Noir contracts + Compiles contracts with nargo compile and then postprocesses them to generate Aztec-specific artifacts including: + - Transpiled contract artifacts + - Verification keys + The compiled contracts will be placed in the target/ directory by default. + Supports standard nargo compile options. + + fmt [options]: formats Noir code using nargo fmt + Example: + $ aztec fmt # formats all Noir files in the project + + check [options]: type-checks Noir code without compiling using nargo check + Example: + $ aztec check # checks all Noir files in the project + test [options]: starts a dockerized TXE node via $ aztec start --txe then runs - $ aztec-nargo test --silence-warnings --oracle-resolver= [options] + $ aztec test --silence-warnings --oracle-resolver= [options] + + lsp: starts the Nargo Language Server Protocol server + Runs nargo lsp in a Docker container for IDE integration with Noir. + This command is typically used by IDE extensions and not called directly by users. + Example: + $ aztec lsp # starts the LSP server + + preload-crs: Downloads and caches the Common Reference String (CRS) data required for zero-knowledge proofs. + Example: + $ aztec preload-crs # preloads CRS data `, );