From b9127ba64525514b50f23a92a905fc9deb69de62 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 17:57:16 +0100 Subject: [PATCH 1/8] aztec-sandbox & aztec-builder --- docs/docs/getting_started.md | 6 +++--- docs/docs/guides/local_env/versions-updating.md | 8 ++++---- .../guides/smart_contracts/how_to_compile_contract.md | 2 +- .../docs/guides/smart_contracts/how_to_deploy_contract.md | 2 +- docs/docs/reference/sandbox_reference/index.md | 2 +- .../advanced/token_bridge/3_withdrawing_to_l1.md | 2 +- .../docs/tutorials/contract_tutorials/counter_contract.md | 4 ++-- .../contract_tutorials/private_voting_contract.md | 6 +++--- docs/docs/tutorials/contract_tutorials/token_contract.md | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index 1d1fa22519e..8061a9e7b60 100644 --- a/docs/docs/getting_started.md +++ b/docs/docs/getting_started.md @@ -25,14 +25,14 @@ 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 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 cli** - 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 +aztec start --sandbox ``` ### Have fun diff --git a/docs/docs/guides/local_env/versions-updating.md b/docs/docs/guides/local_env/versions-updating.md index c8f59f38d96..106225a6b29 100644 --- a/docs/docs/guides/local_env/versions-updating.md +++ b/docs/docs/guides/local_env/versions-updating.md @@ -86,7 +86,7 @@ Inside your project run: ```shell cd your/aztec/project -aztec-builder update . --contract src/contract1 --contract src/contract2 +aztec update . --contract src/contract1 --contract src/contract2 ``` The sandbox must be running for the update command to work. Make sure it is [installed and running](../../reference/sandbox_reference/sandbox-reference.md). @@ -104,16 +104,16 @@ There are four components whose versions need to be kept compatible: 3. `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-builder update`. +But you need to update your Aztec.nr version manually or using `aztec update`. ## Updating Aztec.nr packages ### Automatic update -`aztec-builder` will update your Aztec.nr packages to the appropriate version with the `aztec-builder update` command. Run this command from the root of your project and pass the paths to the folders containing the Nargo.toml files for your projects like so: +You can update your Aztec.nr packages to the appropriate version with the `aztec update` command. Run this command from the root of your project and pass the paths to the folders containing the Nargo.toml files for your projects like so: ```shell -aztec-builder update . --contract src/contract1 --contract src/contract2 +aztec update . --contract src/contract1 --contract src/contract2 ``` ### Manual update diff --git a/docs/docs/guides/smart_contracts/how_to_compile_contract.md b/docs/docs/guides/smart_contracts/how_to_compile_contract.md index 605d8050421..c63d7e28876 100644 --- a/docs/docs/guides/smart_contracts/how_to_compile_contract.md +++ b/docs/docs/guides/smart_contracts/how_to_compile_contract.md @@ -39,7 +39,7 @@ members = [ You can use the code generator to autogenerate type-safe typescript classes for each of your contracts. These classes define type-safe methods for deploying and interacting with your contract based on their artifact. ```bash -aztec-builder codegen ./aztec-nargo/output/target/path -o src/artifacts +aztec codegen ./aztec-nargo/output/target/path -o src/artifacts ``` Below is typescript code generated from the [Token](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/token_contract/src/main.nr) contract: diff --git a/docs/docs/guides/smart_contracts/how_to_deploy_contract.md b/docs/docs/guides/smart_contracts/how_to_deploy_contract.md index 710bd8cc40a..eb07475b884 100644 --- a/docs/docs/guides/smart_contracts/how_to_deploy_contract.md +++ b/docs/docs/guides/smart_contracts/how_to_deploy_contract.md @@ -26,7 +26,7 @@ aztec-nargo compile Generate the typescript class: ```bash -aztec-builder codegen ./aztec-nargo/output/target/path -o src/artifacts +aztec codegen ./aztec-nargo/output/target/path -o src/artifacts ``` This would create a typescript file like `Example.ts` in `./src/artifacts`. Read more on the [compiling page](how_to_compile_contract.md). diff --git a/docs/docs/reference/sandbox_reference/index.md b/docs/docs/reference/sandbox_reference/index.md index ba339531a85..8511fb8bc58 100644 --- a/docs/docs/reference/sandbox_reference/index.md +++ b/docs/docs/reference/sandbox_reference/index.md @@ -15,4 +15,4 @@ The current sandbox does not generate or verify proofs, but provides a working e ## Command line tools -Aztec-nargo and aztec-builder are command-line tool allowing you to compile smart contracts. See the [compiling contracts](../../guides/smart_contracts/how_to_compile_contract.md) page for more information. \ No newline at end of file +Aztec-nargo and aztec CLI are command-line tool allowing you to compile smart contracts. See the [compiling contracts](../../guides/smart_contracts/how_to_compile_contract.md) page for more information. \ No newline at end of file diff --git a/docs/docs/tutorials/contract_tutorials/advanced/token_bridge/3_withdrawing_to_l1.md b/docs/docs/tutorials/contract_tutorials/advanced/token_bridge/3_withdrawing_to_l1.md index a8a71c3cf0e..19e90a10f5d 100644 --- a/docs/docs/tutorials/contract_tutorials/advanced/token_bridge/3_withdrawing_to_l1.md +++ b/docs/docs/tutorials/contract_tutorials/advanced/token_bridge/3_withdrawing_to_l1.md @@ -84,7 +84,7 @@ You may get some unused variable warnings - you can ignore these. And generate the TypeScript interface for the contract and add it to the test dir. Run this inside `aztec-contracts/token_bridge`: ```bash -aztec-builder codegen target -o ../../src/test/fixtures +aztec codegen target -o ../../src/test/fixtures ``` This will create a TS interface inside `fixtures` dir in our `src/test` folder! diff --git a/docs/docs/tutorials/contract_tutorials/counter_contract.md b/docs/docs/tutorials/contract_tutorials/counter_contract.md index 8d140da25f3..e0b2d8502dc 100644 --- a/docs/docs/tutorials/contract_tutorials/counter_contract.md +++ b/docs/docs/tutorials/contract_tutorials/counter_contract.md @@ -152,12 +152,12 @@ aztec-nargo compile This will compile the smart contract and create a `target` folder with a `.json` artifact inside. -After compiling, you can generate a typescript class using `aztec-builder`'s `codegen` command. (See `aztec-builder help codegen` for syntax). +After compiling, you can generate a typescript class using `aztec codegen` command. In the same directory, run this: ```bash -aztec-builder codegen -o src/artifacts target +aztec codegen -o src/artifacts target ``` You can now use the artifact and/or the TS class in your Aztec.js! diff --git a/docs/docs/tutorials/contract_tutorials/private_voting_contract.md b/docs/docs/tutorials/contract_tutorials/private_voting_contract.md index 667720f466f..97ce0adfce2 100644 --- a/docs/docs/tutorials/contract_tutorials/private_voting_contract.md +++ b/docs/docs/tutorials/contract_tutorials/private_voting_contract.md @@ -21,7 +21,7 @@ To keep things simple, we won't create ballots or allow for delegate voting. ## Prerequisites -- You have followed the [quickstart](../../getting_started.md) to install `aztec-nargo` and `aztec-sandbox`. +- You have followed the [quickstart](../../getting_started.md) to install `aztec-nargo` and `aztec sandbox`. - Running Aztec Sandbox ## Set up a project @@ -160,10 +160,10 @@ aztec-nargo compile This will create a new directory called `target` and a JSON artifact inside it. -Use the `aztec-builder` to generate the Typescript artifact for the contract: +Use `aztec codegen` to generate the Typescript artifact for the contract: ```bash -aztec-builder codegen target --outdir src/artifacts +aztec codegen target --outdir src/artifacts ``` Once it is compiled you can [deploy](../../guides/smart_contracts/how_to_deploy_contract.md) it to the sandbox. diff --git a/docs/docs/tutorials/contract_tutorials/token_contract.md b/docs/docs/tutorials/contract_tutorials/token_contract.md index 58e1c8db21b..a01271af73f 100644 --- a/docs/docs/tutorials/contract_tutorials/token_contract.md +++ b/docs/docs/tutorials/contract_tutorials/token_contract.md @@ -480,7 +480,7 @@ aztec-nargo compile Once your contract is compiled, optionally generate a typescript interface with the following command: ```bash -aztec-builder target -o src/artifacts +aztec codegen target -o src/artifacts ``` ## Next Steps From a52473c4d7d3fec75cf61bd95252357ac47ff1e2 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 18:12:47 +0100 Subject: [PATCH 2/8] cli reference --- .../sandbox_reference/cli-reference.md | 338 ++++++++++++++++++ 1 file changed, 338 insertions(+) create mode 100644 docs/docs/reference/sandbox_reference/cli-reference.md diff --git a/docs/docs/reference/sandbox_reference/cli-reference.md b/docs/docs/reference/sandbox_reference/cli-reference.md new file mode 100644 index 00000000000..a39d2cd79b5 --- /dev/null +++ b/docs/docs/reference/sandbox_reference/cli-reference.md @@ -0,0 +1,338 @@ +--- +title: CLI Reference +--- + +:::warning + +`aztec-builder` and `aztec-sandbox` have been deprecated in favor of `aztec` CLI + +::: + +1. [Accounts](#account-management) +2. [Contract deployments and interaction](#contract-deployment-and-interaction) +3. [Network and node info](#network-and-node-information) +4. [Querying](#transaction-and-block-querying) +5. [Logging](#logging-and-data-retrieval) +6. [Debugging](#development-and-debugging-tools) +7. [L1 contracts](#l1-contract-management) +8. [Utils](#utility-commands) + +## Account Management + +### create-account +Creates an Aztec account for sending transactions. + +``` +aztec create-account [options] +``` + +Options: +- `--skip-initialization`: Skip initializing the account contract. +- `--public-deploy`: Publicly deploys the account and registers the class if needed. +- `--private-key `: Private key for the account (uses random by default). +- `--register-only`: Just register the account on the PXE without deploying. +- `--no-wait`: Skip waiting for the contract deployment. + +### get-accounts +Retrieves all Aztec accounts stored in the PXE. + +``` +aztec get-accounts [options] +``` + +Options: +- `--json`: Emit output as JSON. + +### get-account +Retrieves an account given its Aztec address. + +``` +aztec get-account
[options] +``` + +### register-recipient +Registers a recipient in the PXE. + +``` +aztec register-recipient [options] +``` + +Required options: +- `-a, --address `: The account's Aztec address. +- `-p, --public-key `: The account public key. +- `-pa, --partial-address `: The partially computed address of the account contract. + +## Contract Deployment and Interaction + +### deploy +Deploys a compiled Aztec.nr contract to Aztec. + +``` +aztec deploy [options] +``` + +Options: +- `--init `: The contract initializer function to call (default: "constructor"). +- `--no-init`: Leave the contract uninitialized. +- `-a, --args `: Contract constructor arguments. +- `-k, --public-key `: Optional encryption public key for this address. +- `-s, --salt `: Optional deployment salt for generating the deployment address. +- `--universal`: Do not mix the sender address into the deployment. +- `--json`: Emit output as JSON. +- `--no-wait`: Skip waiting for the contract deployment. +- `--no-class-registration`: Don't register this contract class. +- `--no-public-deployment`: Don't emit this contract's public bytecode. + +### send +Calls a function on an Aztec contract. + +``` +aztec send [options] +``` + +Options: +- `-a, --args [functionArgs...]`: Function arguments. +- `-c, --contract-artifact `: Compiled Aztec.nr contract's ABI. +- `-ca, --contract-address
`: Aztec address of the contract. +- `--no-wait`: Print transaction hash without waiting for it to be mined. + +### call +Simulates the execution of a view (read-only) function on a deployed contract. + +``` +aztec call [options] +``` + +Options: +- `-a, --args [functionArgs...]`: Function arguments. +- `-c, --contract-artifact `: Compiled Aztec.nr contract's ABI. +- `-ca, --contract-address
`: Aztec address of the contract. +- `-f, --from `: Aztec address of the caller. + +### add-contract +Adds an existing contract to the PXE. + +``` +aztec add-contract [options] +``` + +Required options: +- `-c, --contract-artifact `: Compiled Aztec.nr contract's ABI. +- `-ca, --contract-address
`: Aztec address of the contract. +- `--init-hash `: Initialization hash. + +Optional: +- `--salt `: Optional deployment salt. +- `-p, --public-key `: Optional public key for this contract. +- `--portal-address
`: Optional address to a portal contract on L1. +- `--deployer-address
`: Optional address of the contract deployer. + +## Network and Node Information + +### get-node-info +Retrieves information about an Aztec node at a URL. + +``` +aztec get-node-info [options] +``` + +### get-pxe-info +Retrieves information about a PXE at a URL. + +``` +aztec get-pxe-info [options] +``` + +### block-number +Retrieves the current Aztec L2 block number. + +``` +aztec block-number [options] +``` + +## Transaction and Block Querying + +### get-tx +Retrieves the receipt for a specified transaction hash. + +``` +aztec get-tx [options] +``` + +### get-block +Retrieves information for a given block or the latest block. + +``` +aztec get-block [blockNumber] [options] +``` + +Options: +- `-f, --follow`: Keep polling for new blocks. + +## Logging and Data Retrieval + +### get-logs +Retrieves unencrypted logs based on filter parameters. + +``` +aztec get-logs [options] +``` + +Options: +- `-tx, --tx-hash `: Transaction hash to get the receipt for. +- `-fb, --from-block `: Initial block number for getting logs. +- `-tb, --to-block `: Up to which block to fetch logs. +- `-al --after-log `: ID of a log after which to fetch the logs. +- `-ca, --contract-address
`: Contract address to filter logs by. +- `--follow`: Keep polling for new logs until interrupted. + +### add-note +Adds a note to the database in the PXE. + +``` +aztec add-note
[options] +``` + +Required option: +- `-n, --note [note...]`: The members of a Note serialized as hex strings. + +## Development and Debugging Tools + +### codegen +Validates and generates an Aztec Contract ABI from Noir ABI. + +``` +aztec codegen [options] +``` + +Options: +- `-o, --outdir `: Output folder for the generated code. +- `--force`: Force code generation even when the contract has not changed. + +### update +Updates Nodejs and Noir dependencies. + +``` +aztec update [projectPath] [options] +``` + +Options: +- `--contract [paths...]`: Paths to contracts to update dependencies. +- `--aztec-version `: The version to update Aztec packages to (default: latest). + +### inspect-contract +Shows a list of external callable functions for a contract. + +``` +aztec inspect-contract +``` + +### parse-parameter-struct +Helper for parsing an encoded string into a contract's parameter struct. + +``` +aztec parse-parameter-struct [options] +``` + +Required options: +- `-c, --contract-artifact `: Compiled Aztec.nr contract's ABI. +- `-p, --parameter `: The name of the struct parameter to decode into. + +## L1 Contract Management + +### deploy-l1-contracts +Deploys all necessary Ethereum contracts for Aztec. + +``` +aztec deploy-l1-contracts [options] +``` + +Required options: +- `-u, --rpc-url `: URL of the Ethereum host. +- `-pk, --private-key `: The private key to use for deployment. + +### deploy-l1-verifier +Deploys the rollup verifier contract. + +``` +aztec deploy-l1-verifier [options] +``` + +Required options: +- `--eth-rpc-url `: URL of the Ethereum host. +- `-pk, --private-key `: The private key to use for deployment. +- `--verifier `: Either 'mock' or 'real'. + +### bridge-l1-gas +Mints L1 gas tokens and pushes them to L2. + +``` +aztec bridge-l1-gas [options] +``` + +Required option: +- `--l1-rpc-url `: URL of the Ethereum host. + +### get-l1-balance +Gets the balance of gas tokens in L1 for a given Ethereum address. + +``` +aztec get-l1-balance [options] +``` + +Required option: +- `--l1-rpc-url `: URL of the Ethereum host. + +## Utility Commands + +### generate-keys +Generates encryption and signing private keys. + +``` +aztec generate-keys [options] +``` + +Option: +- `-m, --mnemonic`: Optional mnemonic string for private key generation. + +### generate-p2p-private-key +Generates a LibP2P peer private key. + +``` +aztec generate-p2p-private-key +``` + +### example-contracts +Lists the example contracts available to deploy from @aztec/noir-contracts.js. + +``` +aztec example-contracts +``` + +### compute-selector +Computes a selector for a given function signature. + +``` +aztec compute-selector +``` + +### bootstrap +Bootstraps the blockchain. + +``` +aztec bootstrap [options] +``` + +### sequencers +Manages or queries registered sequencers on the L1 rollup contract. + +``` +aztec sequencers [who] [options] +``` + +Commands: list, add, remove, who-next + +Required option: +- `--l1-rpc-url `: URL of the Ethereum host. + +Note: Most commands accept a `--rpc-url` option to specify the Aztec node URL, and many accept fee-related options for gas limit and price configuration. \ No newline at end of file From ddd7abf5e5f58d06f5316e0b917de331dba13114 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 18:13:08 +0100 Subject: [PATCH 3/8] rename --- .../sandbox_reference/{cli-reference.md => cli_reference.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/docs/reference/sandbox_reference/{cli-reference.md => cli_reference.md} (100%) diff --git a/docs/docs/reference/sandbox_reference/cli-reference.md b/docs/docs/reference/sandbox_reference/cli_reference.md similarity index 100% rename from docs/docs/reference/sandbox_reference/cli-reference.md rename to docs/docs/reference/sandbox_reference/cli_reference.md From d3d55c4b91eaa74e23d610d3cde96db51ced7937 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 18:46:45 +0100 Subject: [PATCH 4/8] add start and test to refernce --- docs/docs/getting_started.md | 2 +- .../sandbox_reference/cli_reference.md | 56 ++++++++++++++++--- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index 8061a9e7b60..c1adb0e005d 100644 --- a/docs/docs/getting_started.md +++ b/docs/docs/getting_started.md @@ -63,7 +63,7 @@ If you wish to run components of the Aztec network stack separately, you can use 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)/ +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 diff --git a/docs/docs/reference/sandbox_reference/cli_reference.md b/docs/docs/reference/sandbox_reference/cli_reference.md index a39d2cd79b5..15d9fe4fb64 100644 --- a/docs/docs/reference/sandbox_reference/cli_reference.md +++ b/docs/docs/reference/sandbox_reference/cli_reference.md @@ -7,15 +7,55 @@ title: CLI Reference `aztec-builder` and `aztec-sandbox` have been deprecated in favor of `aztec` CLI ::: +- [Start](#starting-and-testing) +- [Accounts](#account-management) +- [Contract deployments and interaction](#contract-deployment-and-interaction) +- [Network and node info](#network-and-node-information) +- [Querying](#transaction-and-block-querying) +- [Logging](#logging-and-data-retrieval) +- [Debugging](#development-and-debugging-tools) +- [L1 contracts](#l1-contract-management) +- [Utils](#utility-commands) -1. [Accounts](#account-management) -2. [Contract deployments and interaction](#contract-deployment-and-interaction) -3. [Network and node info](#network-and-node-information) -4. [Querying](#transaction-and-block-querying) -5. [Logging](#logging-and-data-retrieval) -6. [Debugging](#development-and-debugging-tools) -7. [L1 contracts](#l1-contract-management) -8. [Utils](#utility-commands) +## Starting and testing + +### start + +Initiates various Aztec modules. It can be used to start individual components or the entire Aztec Sandbox. + +``` +aztec start [options] +``` + +### Options: +- `-sb, --sandbox`: Starts the Aztec Sandbox. +- `-p, --port `: Specifies the port to run Aztec on (default: 8080). +- `-n, --node [options]`: Starts the Aztec Node with specified options. +- `-px, --pxe [options]`: Starts the PXE (Private eXecution Environment) with specified options. +- `-a, --archiver [options]`: Starts the Archiver with specified options. +- `-s, --sequencer [options]`: Starts the Sequencer with specified options. +- `-r, --prover [options]`: Starts the Prover Agent with specified options. +- `-o, --prover-node [options]`: Starts the Prover Node with specified options. +- `-p2p, --p2p-bootstrap [options]`: Starts the P2P Bootstrap node with specified options. +- `-t, --txe [options]`: Starts the TXE (Transaction Execution Environment) with specified options. + +### test + +Runs tests written in contracts with `#aztec[test]`. + +``` +aztec test [options] +``` + +Options: +- `--silence-warnings`: Silences warnings during the test execution. +- `--oracle-resolver `: Sets the oracle resolver URL (default: "http://aztec:8081"). +- `--workdir `: Sets the working directory inside the container (default: current directory). +- `-e, --env `: Set environment variables (can be used multiple times). +- `--no-tty`: Run the container without a TTY. +- `--rm`: Automatically remove the container when it exits. +- `-i, --interactive`: Keep STDIN open even if not attached. +- `-t, --tty`: Allocate a pseudo-TTY. ## Account Management From d8fb2b454965cc4582a3556d610cae6b764104f2 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 18:47:39 +0100 Subject: [PATCH 5/8] typo --- docs/docs/reference/sandbox_reference/cli_reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/reference/sandbox_reference/cli_reference.md b/docs/docs/reference/sandbox_reference/cli_reference.md index 15d9fe4fb64..a101f901477 100644 --- a/docs/docs/reference/sandbox_reference/cli_reference.md +++ b/docs/docs/reference/sandbox_reference/cli_reference.md @@ -27,7 +27,7 @@ Initiates various Aztec modules. It can be used to start individual components o aztec start [options] ``` -### Options: +Options: - `-sb, --sandbox`: Starts the Aztec Sandbox. - `-p, --port `: Specifies the port to run Aztec on (default: 8080). - `-n, --node [options]`: Starts the Aztec Node with specified options. From 87f4ee3f9cdaef2e13fa740058d30e33c9753f98 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 23 Jul 2024 19:02:56 +0100 Subject: [PATCH 6/8] typo --- docs/docs/reference/sandbox_reference/cli_reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/reference/sandbox_reference/cli_reference.md b/docs/docs/reference/sandbox_reference/cli_reference.md index a101f901477..d9127149fe2 100644 --- a/docs/docs/reference/sandbox_reference/cli_reference.md +++ b/docs/docs/reference/sandbox_reference/cli_reference.md @@ -41,7 +41,7 @@ Options: ### test -Runs tests written in contracts with `#aztec[test]`. +Runs tests written in contracts. ``` aztec test [options] From 8ccb2c395dd12314f213cfe9875675cb7b3a0831 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Wed, 24 Jul 2024 14:13:19 +0100 Subject: [PATCH 7/8] small getting started fixes --- .../contract_tutorials/counter_contract.md | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/docs/docs/tutorials/contract_tutorials/counter_contract.md b/docs/docs/tutorials/contract_tutorials/counter_contract.md index e0b2d8502dc..1e138b93286 100644 --- a/docs/docs/tutorials/contract_tutorials/counter_contract.md +++ b/docs/docs/tutorials/contract_tutorials/counter_contract.md @@ -48,15 +48,9 @@ Your structure should look like this: The file `main.nr` will soon turn into our smart contract! -Add the following dependencies to `Nargo.toml`: +Add the following dependencies to `Nargo.toml` under the autogenerated content: ```toml -[package] -name = "counter" -type = "contract" -authors = [""] -compiler_version = ">=0.28.0" - [dependencies] aztec = { git="https://github.com/AztecProtocol/aztec-packages/", tag="#include_aztec_version", directory="noir-projects/aztec-nr/aztec" } value_note = { git="https://github.com/AztecProtocol/aztec-packages/", tag="#include_aztec_version", directory="noir-projects/aztec-nr/value-note"} @@ -78,17 +72,13 @@ This defines a contract called `Counter`. We need to define some imports. -Write this within your contract at the top +Write this within your contract at the top: #include_code imports /noir-projects/noir-contracts/contracts/counter_contract/src/main.nr rust -`context::{PrivateContext, Context}` - -Context gives us access to the environment information such as `msg.sender`. We are also importing `PrivateContext` to access necessary information for our private functions. We’ll be using it in the next step. - -`map::Map` +`AztecAddress, Map` -Map is a private state variable that functions like a dictionary, relating Fields to other state variables. +`AztecAddress` is a type for storing contract (including account) addresses. `Map` is a private state variable that functions like a dictionary, relating Fields to other state variables. `value_note` @@ -150,7 +140,7 @@ In `./contracts/counter/` directory, run this: aztec-nargo compile ``` -This will compile the smart contract and create a `target` folder with a `.json` artifact inside. +This will compile the smart contract and create a `target` folder with a `.json` artifact inside. Do not worry if you see some warnings - Aztec is in fast development and it is likely you will see some irrelevant warning messages. After compiling, you can generate a typescript class using `aztec codegen` command. From 3507c2e4ee536e2230e82bc90cc4d6973fda4361 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Wed, 24 Jul 2024 22:14:38 +0900 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Gregorio Juliana --- docs/docs/getting_started.md | 4 +--- docs/docs/reference/sandbox_reference/cli_reference.md | 2 -- .../tutorials/contract_tutorials/private_voting_contract.md | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index c1adb0e005d..923d5e303a8 100644 --- a/docs/docs/getting_started.md +++ b/docs/docs/getting_started.md @@ -23,11 +23,9 @@ bash -i <(curl -s install.aztec.network) This will install the following tools: -- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). +- **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 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 cli** - A useful tool for projects to generate ABIs and update their dependencies. Once these have been installed, to start the sandbox, run: diff --git a/docs/docs/reference/sandbox_reference/cli_reference.md b/docs/docs/reference/sandbox_reference/cli_reference.md index d9127149fe2..808e83ea9c2 100644 --- a/docs/docs/reference/sandbox_reference/cli_reference.md +++ b/docs/docs/reference/sandbox_reference/cli_reference.md @@ -48,8 +48,6 @@ aztec test [options] ``` Options: -- `--silence-warnings`: Silences warnings during the test execution. -- `--oracle-resolver `: Sets the oracle resolver URL (default: "http://aztec:8081"). - `--workdir `: Sets the working directory inside the container (default: current directory). - `-e, --env `: Set environment variables (can be used multiple times). - `--no-tty`: Run the container without a TTY. diff --git a/docs/docs/tutorials/contract_tutorials/private_voting_contract.md b/docs/docs/tutorials/contract_tutorials/private_voting_contract.md index 97ce0adfce2..2d6b4342f67 100644 --- a/docs/docs/tutorials/contract_tutorials/private_voting_contract.md +++ b/docs/docs/tutorials/contract_tutorials/private_voting_contract.md @@ -21,7 +21,7 @@ To keep things simple, we won't create ballots or allow for delegate voting. ## Prerequisites -- You have followed the [quickstart](../../getting_started.md) to install `aztec-nargo` and `aztec sandbox`. +- You have followed the [quickstart](../../getting_started.md) to install `aztec-nargo` and `aztec`. - Running Aztec Sandbox ## Set up a project