From 1993636747d387e128dade9740a57ee638adf682 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 18:04:25 +0000 Subject: [PATCH 1/3] updated docs --- README.md | 4 +-- docs/docs/dev_docs/contracts/compiling.md | 35 +++++++++++++++---- .../getting_started/noir_contracts.md | 16 +++++---- yarn-project/aztec-nr/README.md | 7 +++- 4 files changed, 45 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a229197bb966..2ee28cc8e21c 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ To build the C++ code, follow the [instructions in the circuits subdirectory](./ To build Typescript code, make sure to have [`nvm`](https://github.com/nvm-sh/nvm) (node version manager) installed. -To build noir code, make sure that you are using the `aztec` tagged version of nargo. This is the latest pin version the team works on to ensure local and ci environments are in sync. This should be installed through `noir-contracts/bootstrap.sh` and the regular `bootstrap.sh` script. However if you find yourself wanting to update to the latest `aztec` tag outside of these channels, you can run `noirup -v aztec` to manually download the latest binaries. - +To build noir code, make sure that you are using the version from `yarn-project/noir-compiler/src/noir-version.json`. +Install nargo by running `noirup -v TAG_FROM_THE_FILE`. ## Continuous Integration This repository uses CircleCI for continuous integration. Build steps are managed using [`build-system`](https://github.com/AztecProtocol/build-system). Small packages are built and tested as part of a docker build operation, while larger ones and end-to-end tests spin up a large AWS spot instance. Each successful build step creates a new docker image that gets tagged with the package name and commit. diff --git a/docs/docs/dev_docs/contracts/compiling.md b/docs/docs/dev_docs/contracts/compiling.md index 845ffdf645ed..72d90252055f 100644 --- a/docs/docs/dev_docs/contracts/compiling.md +++ b/docs/docs/dev_docs/contracts/compiling.md @@ -8,23 +8,44 @@ We'll also cover how to generate a helper [TypeScript interface](#typescript-int ## Prerequisites -You will need the Noir build tool `nargo`, which you can install via [`noirup`](https://github.com/noir-lang/noirup). Make sure you install the `aztec` version of nargo: +You will need Aztec CLI to compile the contracts. +Follow [CLI tutorial](../getting_started/cli.md#installing-the-aztec-cli) and install the version compatible with your Sandbox. + +Start the Sandbox (see [Sandbox tutorial](../getting_started/sandbox.md) if unsure how to do it) and get node info: ```bash +aztec-cli get-node-info +``` +Your output should look like this: + +``` +Node Info: + +Version: 1 +Chain Id: 31337 +Rollup Address: 0x9e545e3c0baab3e08cdfd552c960a1050f373042 +Client: aztec-rpc@0.1.0 +Compatible Nargo Version: NARGO_VERSION +``` + +You will need the Noir build tool `nargo`, which you can install via [`noirup`](https://github.com/noir-lang/noirup). + +Install `noirup`: +```shell curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash -noirup -v aztec +``` + +Now install the version of `nargo` compatible with your Sandbox version by replacing `NARGO_VERSION` with the version from the output of `aztec-cli get-node-info`: +```shell +noirup -v NARGO_VERSION ``` :::info -You can re-run `noirup -v aztec` whenever you want to update to the latest version of Noir supported by the Aztec Network. +Once you'll update the sandbox you will have to run the `noirup` again with the updated `NARGO_VERSION`. ::: ## Compile using the CLI -To compile a contract using the Aztec CLI, first install it: - -`npm install -g @aztec/cli` - Then run the `compile` command with the path to your [contract project folder](./layout.md#directory-structure), which is the one that contains the `Nargo.toml` file: ``` diff --git a/docs/docs/dev_docs/getting_started/noir_contracts.md b/docs/docs/dev_docs/getting_started/noir_contracts.md index 65e27c146430..ab8b12fb12e9 100644 --- a/docs/docs/dev_docs/getting_started/noir_contracts.md +++ b/docs/docs/dev_docs/getting_started/noir_contracts.md @@ -11,18 +11,20 @@ If you haven't read [Aztec Sandbox](./sandbox.md), we recommend going there firs ::: ### Dependencies -#### `nargo` -Nargo is Noir's build tool. On your terminal, run: -```bash -curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash -noirup -v aztec -``` -This ensures you are on the aztec branch of nargo. + #### Aztec Sandbox You need to setup the [aztec sandbox](./sandbox.md) +#### `aztec-cli` +Install aztec-cli by following the [CLI tutorial](../getting_started/cli.md#installing-the-aztec-cli). + +#### `nargo` +Nargo is Noir's build tool. + +Install it by following the [Prerequisites section of contract compilation](../contracts/compiling.md#Prerequisites). + ## Set up for aztec.nr contracts 1. Inside the yarn project you created from the [Sandbox](./sandbox.md) page, create a sub-folder where the contracts will reside. ```bash diff --git a/yarn-project/aztec-nr/README.md b/yarn-project/aztec-nr/README.md index b5f09142a4ab..a228f280565a 100644 --- a/yarn-project/aztec-nr/README.md +++ b/yarn-project/aztec-nr/README.md @@ -59,7 +59,12 @@ To use `Aztec-nr` the `aztec` version of `Noir` is required (Note; this version Once noirup is installed, you can run the following: ```bash -noirup -v aztec +noirup -v NARGO_VERSION_COMPATIBLE_WITH_YOUR_SANDBOX +``` + +Replace `NARGO_VERSION_COMPATIBLE_WITH_YOUR_SANDBOX` with the version from the output of `aztec-cli get-node-info`: +```bash +aztec-cli get-node-info ``` For more installation options, please view [Noir's getting started.](https://noir-lang.org/getting_started/nargo_installation) From 6a03a7a6c20f761719071a8f54f812d31efc3925 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 19 Sep 2023 09:49:48 +0200 Subject: [PATCH 2/3] cleanup --- docs/docs/dev_docs/contracts/compiling.md | 6 +++++- docs/docs/dev_docs/getting_started/noir_contracts.md | 10 +--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/docs/dev_docs/contracts/compiling.md b/docs/docs/dev_docs/contracts/compiling.md index 9487bc1ed7ee..29e03632ab7d 100644 --- a/docs/docs/dev_docs/contracts/compiling.md +++ b/docs/docs/dev_docs/contracts/compiling.md @@ -18,6 +18,10 @@ You can run `aztec-cli get-node-info` to query the version of nargo that corresp ## Compile using the CLI +To compile a contract using the Aztec CLI, first install it: + +`npm install -g @aztec/cli` + Then run the `compile` command with the path to your [contract project folder](./layout.md#directory-structure), which is the one that contains the `Nargo.toml` file: ``` @@ -144,4 +148,4 @@ The compiler exposes the following functions: Once you have compiled your contracts, you can use the generated artifacts via the `Contract` class in the `aztec.js` package to deploy and interact with them, or rely on the type-safe typescript classes directly. Alternatively, use the CLI [to deploy](../../dev_docs/cli/cli.md#deploying-a-token-contract) and [interact](../../dev_docs/cli/cli.md#sending-a-transaction) with them. import Disclaimer from "../../misc/common/\_disclaimer.mdx"; - + \ No newline at end of file diff --git a/docs/docs/dev_docs/getting_started/noir_contracts.md b/docs/docs/dev_docs/getting_started/noir_contracts.md index 7e12adf768f9..22ff07aeee33 100644 --- a/docs/docs/dev_docs/getting_started/noir_contracts.md +++ b/docs/docs/dev_docs/getting_started/noir_contracts.md @@ -24,14 +24,6 @@ You need to setup the [Aztec sandbox](./sandbox.md). -#### `aztec-cli` -Install aztec-cli by following the [CLI tutorial](../getting_started/cli.md#installing-the-aztec-cli). - -#### `nargo` -Nargo is Noir's build tool. - -Install it by following the [Prerequisites section of contract compilation](../contracts/compiling.md#Prerequisites). - ## Set up for aztec.nr contracts 1. Inside the yarn project you created from the [Aztec.js](./sandbox.md) page, create a sub-folder where the contracts will reside. @@ -89,4 +81,4 @@ You can replace the content of the generated file `example_contract/src/main.nr` - Consider going through the [token contract tutorial](./token_contract_tutorial.md) for a deep dive on writing more advanced Aztec contracts and an introduction to some of the concepts that underpin the Aztec network architecture. - After writing the contract, you have to compile it. Details can be found [here](../contracts/compiling.md). - After compiling, you can deploy your contract to the Aztec network. Relevant instructions and explanations can be found [here](../contracts/deploying.md). -- Thereafter, you can interact with the contracts similar to how it was shown in the the [Creating and submitting transactions section on the Sandbox page](./sandbox.md#creating-and-submitting-transactions). +- Thereafter, you can interact with the contracts similar to how it was shown in the the [Creating and submitting transactions section on the Sandbox page](./sandbox.md#creating-and-submitting-transactions). \ No newline at end of file From 5756b51976ebb28ee6a28a02a1d8c218aa6fbe16 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 19 Sep 2023 09:51:49 +0200 Subject: [PATCH 3/3] WIP --- README.md | 1 + docs/docs/dev_docs/contracts/compiling.md | 2 +- docs/docs/dev_docs/getting_started/noir_contracts.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index abc616020a66..6dfabaa19641 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ To build Typescript code, make sure to have [`nvm`](https://github.com/nvm-sh/nv To build noir code, make sure that you are using the version from `yarn-project/noir-compiler/src/noir-version.json`. Install nargo by running `noirup -v TAG_FROM_THE_FILE`. + ## Continuous Integration This repository uses CircleCI for continuous integration. Build steps are managed using [`build-system`](https://github.com/AztecProtocol/build-system). Small packages are built and tested as part of a docker build operation, while larger ones and end-to-end tests spin up a large AWS spot instance. Each successful build step creates a new docker image that gets tagged with the package name and commit. diff --git a/docs/docs/dev_docs/contracts/compiling.md b/docs/docs/dev_docs/contracts/compiling.md index 29e03632ab7d..071a7b56bec3 100644 --- a/docs/docs/dev_docs/contracts/compiling.md +++ b/docs/docs/dev_docs/contracts/compiling.md @@ -148,4 +148,4 @@ The compiler exposes the following functions: Once you have compiled your contracts, you can use the generated artifacts via the `Contract` class in the `aztec.js` package to deploy and interact with them, or rely on the type-safe typescript classes directly. Alternatively, use the CLI [to deploy](../../dev_docs/cli/cli.md#deploying-a-token-contract) and [interact](../../dev_docs/cli/cli.md#sending-a-transaction) with them. import Disclaimer from "../../misc/common/\_disclaimer.mdx"; - \ No newline at end of file + diff --git a/docs/docs/dev_docs/getting_started/noir_contracts.md b/docs/docs/dev_docs/getting_started/noir_contracts.md index 22ff07aeee33..9d60ddab6b92 100644 --- a/docs/docs/dev_docs/getting_started/noir_contracts.md +++ b/docs/docs/dev_docs/getting_started/noir_contracts.md @@ -81,4 +81,4 @@ You can replace the content of the generated file `example_contract/src/main.nr` - Consider going through the [token contract tutorial](./token_contract_tutorial.md) for a deep dive on writing more advanced Aztec contracts and an introduction to some of the concepts that underpin the Aztec network architecture. - After writing the contract, you have to compile it. Details can be found [here](../contracts/compiling.md). - After compiling, you can deploy your contract to the Aztec network. Relevant instructions and explanations can be found [here](../contracts/deploying.md). -- Thereafter, you can interact with the contracts similar to how it was shown in the the [Creating and submitting transactions section on the Sandbox page](./sandbox.md#creating-and-submitting-transactions). \ No newline at end of file +- Thereafter, you can interact with the contracts similar to how it was shown in the the [Creating and submitting transactions section on the Sandbox page](./sandbox.md#creating-and-submitting-transactions).