From b8a6743f874c37ca8f863b15b1cf90872e03ab38 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 14 Sep 2023 09:09:47 -0400 Subject: [PATCH 01/19] WIP --- docs/docs/dev_docs/getting_started/sandbox.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 9ca0ef7ca4e..0a30a19c4ac 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -350,6 +350,39 @@ Our complete output should now be: That's it! We have successfully deployed a private token contract to an instance of the Aztec network and mined private state-transitioning transactions. We have also queried the resulting state all via the interfaces provided by the contract. +## Updating +To update the sandbox, simply run the curl command again: + +```sh +/bin/bash -c "$(curl -fsSL 'https://sandbox.aztec.network')" +``` + +It will download and start the latest version of sandbox. + +If you would like to use a fixed version of sandbox you can export the `SANDBOX_VERSION` environmental variable. +The version in our case is a tag of the `aztec-sandbox` image on [dockerhub](https://hub.docker.com/r/aztecprotocol/aztec-sandbox/tags). +This is the full command: + +```sh +export SANDBOX_VERSION=v0.7.0 +``` + +If this variable is not set the latest version will be used. + +To manually specify that you want to use the latest version use the `latest` tag: + +```sh +export SANDBOX_VERSION=latest +``` + +Now when you run the curl command it will use the version you specified. +To verify that it's the case check the console output of the curl command. +Alternatively you can open a new terminal and use aztec-cli to get the version. + +```sh +aztec-cli get-node-info +``` + ## Next Steps Here we showed how to interact with the sandbox, but didn't go into details on how to write your own contract or any relevant setup needed for it. From 75002081b69ed6a9998083fa2dde6c75e2c9e1eb Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 14 Sep 2023 09:31:05 -0400 Subject: [PATCH 02/19] WIP --- docs/docs/dev_docs/getting_started/cli.md | 16 ++++++++++++++-- docs/docs/dev_docs/getting_started/sandbox.md | 8 ++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/cli.md b/docs/docs/dev_docs/getting_started/cli.md index 810e992183c..d89a063c245 100644 --- a/docs/docs/dev_docs/getting_started/cli.md +++ b/docs/docs/dev_docs/getting_started/cli.md @@ -24,10 +24,22 @@ Or if you use yarn: yarn global add @aztec/cli ``` -Then verify that it is installed with: +If you have specified a SANDBOX_VERSION environmental variable when installing sandbox, you will need to specify the same version when installing the CLI. For example: ```bash -aztec-cli -h +npm install -g @aztec/cli@0.7.0 +``` + +or if you use yarn: + +```bash +yarn global add @aztec/cli@0.7.0 +``` + +Verify that the correct version is installed: + +```bash +aztec-cli --version ``` ## I have the Sandbox running, now what? diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 0a30a19c4ac..0d48e057ed7 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -383,6 +383,14 @@ Alternatively you can open a new terminal and use aztec-cli to get the version. aztec-cli get-node-info ``` +:::note + +Versions of `sandbox` and `aztec-cli` must match. +If `aztec-cli --version` does not return the same version as `SANDBOX_VERSION` then you need to install the correct version of `aztec-cli`. +See [this section](./cli.md#requirements) for how to accomplish that. + +::: + ## Next Steps Here we showed how to interact with the sandbox, but didn't go into details on how to write your own contract or any relevant setup needed for it. From 523c60913fdeab4a602dd0e5dbb32cba49518a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bene=C5=A1?= Date: Fri, 15 Sep 2023 04:53:53 -0400 Subject: [PATCH 03/19] Apply suggestions from code review Co-authored-by: Michael Connor --- docs/docs/dev_docs/getting_started/cli.md | 2 +- docs/docs/dev_docs/getting_started/sandbox.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/cli.md b/docs/docs/dev_docs/getting_started/cli.md index d89a063c245..683de00ae9b 100644 --- a/docs/docs/dev_docs/getting_started/cli.md +++ b/docs/docs/dev_docs/getting_started/cli.md @@ -24,7 +24,7 @@ Or if you use yarn: yarn global add @aztec/cli ``` -If you have specified a SANDBOX_VERSION environmental variable when installing sandbox, you will need to specify the same version when installing the CLI. For example: +If you have specified a SANDBOX_VERSION environmental variable when installing the Sandbox, you will need to specify the same version when installing the CLI. For example: ```bash npm install -g @aztec/cli@0.7.0 diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 0d48e057ed7..4333675fda2 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -359,7 +359,7 @@ To update the sandbox, simply run the curl command again: It will download and start the latest version of sandbox. -If you would like to use a fixed version of sandbox you can export the `SANDBOX_VERSION` environmental variable. +If you would like to use a fixed version of the sandbox, you can export the `SANDBOX_VERSION` environmental variable. The version in our case is a tag of the `aztec-sandbox` image on [dockerhub](https://hub.docker.com/r/aztecprotocol/aztec-sandbox/tags). This is the full command: From 29f00e997aeae2d3ca63013cb01cdd35cd5c80ae Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 09:41:14 +0000 Subject: [PATCH 04/19] testing get-node-info command --- docs/docs/dev_docs/getting_started/sandbox.md | 6 ++---- .../end-to-end/src/cli_docs_sandbox.test.ts | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 4333675fda2..e389d16c3f9 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -378,10 +378,8 @@ export SANDBOX_VERSION=latest Now when you run the curl command it will use the version you specified. To verify that it's the case check the console output of the curl command. Alternatively you can open a new terminal and use aztec-cli to get the version. - -```sh -aztec-cli get-node-info -``` + +#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash :::note diff --git a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts index 055d605e0dc..ae616884069 100644 --- a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts +++ b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts @@ -26,10 +26,24 @@ describe('CLI docs sandbox', () => { }, 60_000); const waitForSandboxWithCli = async () => { + const docs = ` +// docs:start:node-info +% aztec-cli get-node-info + +Node Info: + +Version: 1 +Chain Id: 31337 +Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 +Client: aztec-rpc@0.7.2 +// docs:end:node-info +`; + + const command = docs.split('\n')[2].split('aztec-cli ')[1]; while (true) { resetCli(); try { - await run('get-node-info'); + await run(command); break; } catch (err) { await sleep(1000); From 53b1379c57e8b08903ae5d01fcfb05ec6db3f10a Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 09:54:04 +0000 Subject: [PATCH 05/19] describing how to get a version --- docs/docs/dev_docs/getting_started/cli.md | 14 +++++++++++--- docs/docs/dev_docs/getting_started/sandbox.md | 5 +++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/cli.md b/docs/docs/dev_docs/getting_started/cli.md index 683de00ae9b..55c03eff9a2 100644 --- a/docs/docs/dev_docs/getting_started/cli.md +++ b/docs/docs/dev_docs/getting_started/cli.md @@ -24,18 +24,26 @@ Or if you use yarn: yarn global add @aztec/cli ``` -If you have specified a SANDBOX_VERSION environmental variable when installing the Sandbox, you will need to specify the same version when installing the CLI. For example: +If you have specified a SANDBOX_VERSION environmental variable when installing the Sandbox, you will need to specify the same version when installing the CLI. +To get the version of the Sandbox you have installed start the Sandbox and look for the version in the logs. +Alternatively, if you already have a version of aztec-cli installed, you can run: + +#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash + +To install a specific version of the CLI, run: ```bash -npm install -g @aztec/cli@0.7.0 +npm install -g @aztec/cli@YOUR_VERSION ``` or if you use yarn: ```bash -yarn global add @aztec/cli@0.7.0 +yarn global add @aztec/cli@YOUR_VERSION ``` +If your version was not found look at the list of available versions on [npmjs.com](https://www.npmjs.com/package/@aztec/cli?activeTab=versions). + Verify that the correct version is installed: ```bash diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index e389d16c3f9..1e04bbb63aa 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -387,6 +387,11 @@ Versions of `sandbox` and `aztec-cli` must match. If `aztec-cli --version` does not return the same version as `SANDBOX_VERSION` then you need to install the correct version of `aztec-cli`. See [this section](./cli.md#requirements) for how to accomplish that. +To get the version of the Sandbox you have installed start the Sandbox and look for the version in the logs. +Alternatively you can use `aztec-cli`: + +#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash + ::: ## Next Steps From fa3e151eb747e83694f1c6e6562d0ee77f8fe535 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 06:03:44 -0400 Subject: [PATCH 06/19] cleanup --- docs/docs/dev_docs/getting_started/sandbox.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 1e04bbb63aa..f6d8bd0bf9d 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -384,13 +384,11 @@ Alternatively you can open a new terminal and use aztec-cli to get the version. :::note Versions of `sandbox` and `aztec-cli` must match. -If `aztec-cli --version` does not return the same version as `SANDBOX_VERSION` then you need to install the correct version of `aztec-cli`. +If `aztec-cli --version` does not return the same version as sandbox then you need to install the correct version of `aztec-cli`. See [this section](./cli.md#requirements) for how to accomplish that. To get the version of the Sandbox you have installed start the Sandbox and look for the version in the logs. -Alternatively you can use `aztec-cli`: - -#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +Alternatively you can use `aztec-cli` as described above. ::: From ceb671aab7ff9f465b2a233fe7b9bbbf0b24f2d5 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 15 Sep 2023 11:32:41 -0400 Subject: [PATCH 07/19] WIP --- docs/docs/dev_docs/getting_started/updating.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/docs/dev_docs/getting_started/updating.md diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md new file mode 100644 index 00000000000..3992220a3b9 --- /dev/null +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -0,0 +1,9 @@ +--- +title: Updating +--- + +There are 4 components whose versions need to be kept compatible: +1. Aztec Sandbox, +2. Aztec CLI, +3. Noir compiler `nargo`, +4. Noir framework for Aztec contracts `aztec.nr`. \ No newline at end of file From 7faa0143318d5db97996f3a36f5cc6eb44f8f94e Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 18 Sep 2023 12:51:26 +0200 Subject: [PATCH 08/19] WIP --- docs/docs/dev_docs/getting_started/cli.md | 24 +------- .../docs/dev_docs/getting_started/updating.md | 57 ++++++++++++++++++- .../end-to-end/src/cli_docs_sandbox.test.ts | 3 +- 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/cli.md b/docs/docs/dev_docs/getting_started/cli.md index 55c03eff9a2..810e992183c 100644 --- a/docs/docs/dev_docs/getting_started/cli.md +++ b/docs/docs/dev_docs/getting_started/cli.md @@ -24,30 +24,10 @@ Or if you use yarn: yarn global add @aztec/cli ``` -If you have specified a SANDBOX_VERSION environmental variable when installing the Sandbox, you will need to specify the same version when installing the CLI. -To get the version of the Sandbox you have installed start the Sandbox and look for the version in the logs. -Alternatively, if you already have a version of aztec-cli installed, you can run: - -#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash - -To install a specific version of the CLI, run: - -```bash -npm install -g @aztec/cli@YOUR_VERSION -``` - -or if you use yarn: - -```bash -yarn global add @aztec/cli@YOUR_VERSION -``` - -If your version was not found look at the list of available versions on [npmjs.com](https://www.npmjs.com/package/@aztec/cli?activeTab=versions). - -Verify that the correct version is installed: +Then verify that it is installed with: ```bash -aztec-cli --version +aztec-cli -h ``` ## I have the Sandbox running, now what? diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index 3992220a3b9..aed8850ce2a 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -6,4 +6,59 @@ There are 4 components whose versions need to be kept compatible: 1. Aztec Sandbox, 2. Aztec CLI, 3. Noir compiler `nargo`, -4. Noir framework for Aztec contracts `aztec.nr`. \ No newline at end of file +4. Noir framework for Aztec contracts `aztec.nr`. + +## Updating Aztec Sandbox +To update the sandbox to the latest version, simply run the curl command we used for installation again: +```shell +/bin/bash -c "$(curl -fsSL 'https://sandbox.aztec.network')" +``` + +It will download and start the latest version of sandbox. + +If you would like to use a fixed version of the sandbox, you can export the `SANDBOX_VERSION` environmental variable. +If you are unsure what version to use go to [aztec-packages repository](https://github.com/AztecProtocol/aztec-packages/releases) and choose the `aztec-packages` release based on the changelog. + +Then set the `SANDBOX_VERSION` environmental variable to the version you want to use. E.g.: +```shell +export SANDBOX_VERSION=v0.7.5 +``` + +Now when you run the curl command it will use the version you specified. +To verify that it's the case check the console output of the curl command. +You should see the following line: +``` +Aztec Sandbox v0.7.5 is now ready for use! +``` + +Alternatively you can open a new terminal and use aztec-cli to get the version. + +#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash + +The client version should be the same as the one we chose by setting the `SANDBOX_VERSION` environmental variable. + +## Updating Aztec CLI +If the latest version was used when updating the sandbox then we can simply run the following command to update the CLI: +```shell +npm install -g @aztec/cli +``` + +If a specific version was set for the sandbox then we need to install the CLI with the same version: +```shell +npm install -g @aztec/cli@REPLACE_WITH_SANDBOX_VERSION +``` + +E.g.: +```shell +npm install -g @aztec/cli@0.7.5 +``` + +## Updating Noir compiler +Now we need to update the Noir compiler `nargo` to the version compatible with the sandbox. +Use `aztec-cli` to get it: +#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash + +Then we install the `Compatible Nargo Version` with (replace `COMPATIBLE_NARGO_VERSION` with the version from the previous command): +```shell +noirup -v COMPATIBLE_NARGO_VERSION +``` diff --git a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts index ae616884069..9d413b4d688 100644 --- a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts +++ b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts @@ -35,7 +35,8 @@ Node Info: Version: 1 Chain Id: 31337 Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 -Client: aztec-rpc@0.7.2 +Client: aztec-rpc@0.7.5 +Compatible Nargo Version: 0.11.1-aztec.0 // docs:end:node-info `; From a0044b391922e7b5a8fd45d6fad6b271e448c99f Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 18 Sep 2023 13:08:29 +0200 Subject: [PATCH 09/19] WIP --- docs/docs/dev_docs/getting_started/sandbox.md | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index f6d8bd0bf9d..9ca0ef7ca4e 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -350,48 +350,6 @@ Our complete output should now be: That's it! We have successfully deployed a private token contract to an instance of the Aztec network and mined private state-transitioning transactions. We have also queried the resulting state all via the interfaces provided by the contract. -## Updating -To update the sandbox, simply run the curl command again: - -```sh -/bin/bash -c "$(curl -fsSL 'https://sandbox.aztec.network')" -``` - -It will download and start the latest version of sandbox. - -If you would like to use a fixed version of the sandbox, you can export the `SANDBOX_VERSION` environmental variable. -The version in our case is a tag of the `aztec-sandbox` image on [dockerhub](https://hub.docker.com/r/aztecprotocol/aztec-sandbox/tags). -This is the full command: - -```sh -export SANDBOX_VERSION=v0.7.0 -``` - -If this variable is not set the latest version will be used. - -To manually specify that you want to use the latest version use the `latest` tag: - -```sh -export SANDBOX_VERSION=latest -``` - -Now when you run the curl command it will use the version you specified. -To verify that it's the case check the console output of the curl command. -Alternatively you can open a new terminal and use aztec-cli to get the version. - -#include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash - -:::note - -Versions of `sandbox` and `aztec-cli` must match. -If `aztec-cli --version` does not return the same version as sandbox then you need to install the correct version of `aztec-cli`. -See [this section](./cli.md#requirements) for how to accomplish that. - -To get the version of the Sandbox you have installed start the Sandbox and look for the version in the logs. -Alternatively you can use `aztec-cli` as described above. - -::: - ## Next Steps Here we showed how to interact with the sandbox, but didn't go into details on how to write your own contract or any relevant setup needed for it. From 4683bf8887a367f00a8b307a0dcff5af03e60369 Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 18 Sep 2023 13:23:37 +0200 Subject: [PATCH 10/19] WIP --- docs/docs/dev_docs/getting_started/updating.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index aed8850ce2a..8f7e4ba553a 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -62,3 +62,7 @@ Then we install the `Compatible Nargo Version` with (replace `COMPATIBLE_NARGO_V ```shell noirup -v COMPATIBLE_NARGO_VERSION ``` + +## Updating Noir framework +Finally we need to update the Noir framework for Aztec contracts `aztec.nr`. +We need to install a version compatible with our `nargo` version. \ No newline at end of file From daea07638c3fc96823ef69e43c6fb273be3d2778 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 19 Sep 2023 08:03:57 +0000 Subject: [PATCH 11/19] WIP --- docs/sidebars.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/sidebars.js b/docs/sidebars.js index ae69f0ada65..76a48a6f727 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -79,6 +79,7 @@ const sidebars = { "dev_docs/getting_started/sandbox", "dev_docs/getting_started/noir_contracts", "dev_docs/getting_started/token_contract_tutorial", + "dev_docs/getting_started/updating", ], }, From ef17a14712485c4833fe41c10946f1cd7e8a8abc Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 19 Sep 2023 11:29:57 +0200 Subject: [PATCH 12/19] WIP --- .../docs/dev_docs/getting_started/updating.md | 44 ++++++++++++++++--- .../end-to-end/src/cli_docs_sandbox.test.ts | 9 ++-- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index 8f7e4ba553a..859c8f91f75 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -21,21 +21,21 @@ If you are unsure what version to use go to [aztec-packages repository](https:// Then set the `SANDBOX_VERSION` environmental variable to the version you want to use. E.g.: ```shell -export SANDBOX_VERSION=v0.7.5 +export SANDBOX_VERSION=0.7.7 ``` Now when you run the curl command it will use the version you specified. To verify that it's the case check the console output of the curl command. You should see the following line: ``` -Aztec Sandbox v0.7.5 is now ready for use! +Aztec Sandbox 0.7.7 is now ready for use! ``` Alternatively you can open a new terminal and use aztec-cli to get the version. #include_code node-info yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash -The client version should be the same as the one we chose by setting the `SANDBOX_VERSION` environmental variable. +The sandbox version should be the same as the one we chose by setting the `SANDBOX_VERSION` environmental variable. ## Updating Aztec CLI If the latest version was used when updating the sandbox then we can simply run the following command to update the CLI: @@ -50,7 +50,7 @@ npm install -g @aztec/cli@REPLACE_WITH_SANDBOX_VERSION E.g.: ```shell -npm install -g @aztec/cli@0.7.5 +npm install -g @aztec/cli@0.7.7 ``` ## Updating Noir compiler @@ -64,5 +64,37 @@ noirup -v COMPATIBLE_NARGO_VERSION ``` ## Updating Noir framework -Finally we need to update the Noir framework for Aztec contracts `aztec.nr`. -We need to install a version compatible with our `nargo` version. \ No newline at end of file +Finally we need to update the Noir framework for Aztec contracts. +We need to install a version compatible with our `nargo` version. + +To update the framework we will update a tag of the `aztec.nr` dependency in the `Nargo.toml` file to the `SANDBOX_VERSION` from above. +Find all the dependencies pointing to the directory within `aztec.nr` framework and update the corresponding tag: + +```toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v", directory="yarn-project/aztec-nr/aztec" } +value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v", directory="yarn-project/aztec-nr/value-note" } +``` + +To provide you with a concrete example we will update from version `0.7.5`: +```toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/aztec" } +value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/value-note" } +``` + +to `0.7.7`: + +```toml +[dependencies] +aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.7", directory="yarn-project/aztec-nr/aztec" } +value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.7", directory="yarn-project/aztec-nr/value-note" } +``` + +Go to the project directory and try compiling it with `aztec-cli`` to verify that the update was successful: +```shell +cd /your/project/root +aztec-cli compile ./ +``` + +If the dependencies fail to resolve ensure that the tag matches a tag in the [aztec-packages repository](https://github.com/AztecProtocol/aztec-packages/tags). diff --git a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts index 9d413b4d688..4f78525db99 100644 --- a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts +++ b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts @@ -29,14 +29,13 @@ describe('CLI docs sandbox', () => { const docs = ` // docs:start:node-info % aztec-cli get-node-info - Node Info: -Version: 1 -Chain Id: 31337 -Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 -Client: aztec-rpc@0.7.5 +Sandbox Version: 0.7.7 Compatible Nargo Version: 0.11.1-aztec.0 +Chain Id: 31337 +Protocol Version: 1 +Rollup Address: 0x0dcd1bf9a1b36ce34237eeafef220932846bcd82 // docs:end:node-info `; From 476c08974d8bccd12d3bd96934e4ad9a9f9a7958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bene=C5=A1?= Date: Thu, 21 Sep 2023 08:50:00 +0200 Subject: [PATCH 13/19] Apply suggestions from code review Co-authored-by: Santiago Palladino --- docs/docs/dev_docs/getting_started/updating.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index 859c8f91f75..11a964f9fbc 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -45,7 +45,7 @@ npm install -g @aztec/cli If a specific version was set for the sandbox then we need to install the CLI with the same version: ```shell -npm install -g @aztec/cli@REPLACE_WITH_SANDBOX_VERSION +npm install -g @aztec/cli@$SANDBOX_VERSION ``` E.g.: @@ -65,7 +65,7 @@ noirup -v COMPATIBLE_NARGO_VERSION ## Updating Noir framework Finally we need to update the Noir framework for Aztec contracts. -We need to install a version compatible with our `nargo` version. +We need to install a version compatible with our `nargo` and Sandbox. To update the framework we will update a tag of the `aztec.nr` dependency in the `Nargo.toml` file to the `SANDBOX_VERSION` from above. Find all the dependencies pointing to the directory within `aztec.nr` framework and update the corresponding tag: From 534a73e3a2a3c4dd02e525413671e892abe61f66 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 21 Sep 2023 09:14:32 +0200 Subject: [PATCH 14/19] merge fix --- docs/sidebars.js | 196 +---------------------------------------------- 1 file changed, 1 insertion(+), 195 deletions(-) diff --git a/docs/sidebars.js b/docs/sidebars.js index 8388030fdeb..61dd8817d4a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -58,201 +58,6 @@ const sidebars = { value: '', }, - // DEVELOPER DOCUMENTATION - - { - type: "html", - className: "sidebar-title", - value: "Developer Documentation", - defaultStyle: true, - }, - - { - label: "Getting Started", - type: "category", - link: { - type: "doc", - id: "dev_docs/getting_started/main", - }, - items: [ - "dev_docs/getting_started/quickstart", - "dev_docs/getting_started/sandbox", - "dev_docs/getting_started/noir_contracts", - "dev_docs/getting_started/token_contract_tutorial", - "dev_docs/getting_started/updating", - ], - }, - - { - label: "Aztec.nr Contracts", - type: "category", - link: { - type: "doc", - id: "dev_docs/contracts/main", - }, - items: [ - "dev_docs/contracts/workflow", - "dev_docs/contracts/layout", - "dev_docs/contracts/events", - "dev_docs/contracts/compiling", - "dev_docs/contracts/deploying", - "dev_docs/contracts/artifacts", - { - label: "Syntax", - type: "category", - link: { - type: "doc", - id: "dev_docs/contracts/syntax/main", - }, - items: [ - "dev_docs/contracts/syntax/contract", - "dev_docs/contracts/syntax/functions", - "dev_docs/contracts/syntax/storage", - "dev_docs/contracts/syntax/state_variables", - "dev_docs/contracts/syntax/globals", - "dev_docs/contracts/syntax/messaging", - ], - }, - { - label: "Portals", - type: "category", - link: { - type: "doc", - id: "dev_docs/contracts/portals/main", - }, - items: [ - "dev_docs/contracts/portals/data_structures", - "dev_docs/contracts/portals/registry", - "dev_docs/contracts/portals/inbox", - "dev_docs/contracts/portals/outbox", - ] - } - // { - // label: "Resources", - // type: "category", - // items: [ - // "dev_docs/contracts/resources/style_guide", - // { - // label: "Common Patterns", - // type: "category", - // link: { - // type: "doc", - // id: "dev_docs/contracts/resources/common_patterns/main", - // }, - // items: [ - // "dev_docs/contracts/resources/common_patterns/sending_tokens_to_user", - // "dev_docs/contracts/resources/common_patterns/sending_tokens_to_contract", - // "dev_docs/contracts/resources/common_patterns/access_control", - // "dev_docs/contracts/resources/common_patterns/interacting_with_l1", - // ], - // }, - // ], - // }, - // { - // label: "Security Considerations", - // type: "category", - // items: [ - // { - // label: "Breaking changes", - // type: "category", - // link: { - // type: "doc", - // id: "dev_docs/contracts/security/breaking_changes/main", - // }, - // items: ["dev_docs/contracts/security/breaking_changes/v0"], - // }, - // ], - // }, - ], - }, - - { - label: "Sandbox", - type: "category", - link: { - type: "doc", - id: "dev_docs/sandbox/main", - }, - items: ["dev_docs/sandbox/common_errors"], - }, - - { - label: "CLI", - type: "category", - link: { - type: "doc", - id: "dev_docs/cli/main", - }, - items: ["dev_docs/cli/cli"], - }, - { - label: "DApp Development", - type: "category", - items: [ - // { - // label: "API", - // type: "category", - // link: { - // type: "doc", - // id: "dev_docs/dapps/api/main", - // }, - // items: [ - // "dev_docs/dapps/api/aztec_rpc", - // "dev_docs/dapps/api/contract_interaction", - // ], - // }, - { - label: "Tutorials", - type: "category", - link: { - type: "doc", - id: "dev_docs/dapps/tutorials/main", - }, - items: [ - "dev_docs/dapps/tutorials/project_setup", - "dev_docs/dapps/tutorials/rpc_server", - "dev_docs/dapps/tutorials/contract_deployment", - "dev_docs/dapps/tutorials/contract_interaction", - "dev_docs/dapps/tutorials/testing", - ], - }, - ], - }, - - { - label: "Testing", - type: "category", - link: { - type: "doc", - id: "dev_docs/testing/main", - }, - items: ["dev_docs/testing/testing", "dev_docs/testing/cheat_codes"], - }, - - { - label: "Wallets", - type: "category", - link: { - type: "doc", - id: "dev_docs/wallets/main", - }, - items: [ - "dev_docs/wallets/architecture", - "dev_docs/wallets/writing_an_account_contract", - ], - }, - - { - label: "Security Considerations", - type: "category", - items: ["dev_docs/limitations/main", "dev_docs/privacy/main"], - }, - - { - type: "html", - value: '', - }, - // SPECIFICATION { @@ -393,6 +198,7 @@ const sidebars = { "dev_docs/getting_started/sandbox", "dev_docs/getting_started/noir_contracts", "dev_docs/getting_started/token_contract_tutorial", + "dev_docs/getting_started/updating", ], }, From e783331f80277371dab7d5443ce12192efd53e50 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 21 Sep 2023 10:30:39 +0200 Subject: [PATCH 15/19] TLDR --- docs/docs/dev_docs/getting_started/updating.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index 11a964f9fbc..c627e24baa9 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -8,6 +8,9 @@ There are 4 components whose versions need to be kept compatible: 3. Noir compiler `nargo`, 4. Noir framework for Aztec contracts `aztec.nr`. +Aztec Sandbox, Aztec CLI and `aztec.nr` are using the same versioning scheme and their versions must match. +The Noir compiler `nargo` has its own versioning scheme and its version must match the compatible nargo version specified in Sandbox. + ## Updating Aztec Sandbox To update the sandbox to the latest version, simply run the curl command we used for installation again: ```shell From e3e73ff776342d43316584323bb8ad5980dc4edf Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 21 Sep 2023 10:46:56 +0200 Subject: [PATCH 16/19] feat: nargo version in sandbox logs --- docs/docs/dev_docs/getting_started/updating.md | 2 +- yarn-project/aztec-sandbox/package.json | 1 + yarn-project/aztec-sandbox/src/bin/index.ts | 7 +++++-- yarn-project/aztec-sandbox/tsconfig.json | 3 +++ yarn-project/yarn.lock | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index c627e24baa9..ef29e01af87 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -31,7 +31,7 @@ Now when you run the curl command it will use the version you specified. To verify that it's the case check the console output of the curl command. You should see the following line: ``` -Aztec Sandbox 0.7.7 is now ready for use! +Setting up Aztec Sandbox v0.7.7 (nargo 0.11.1-aztec.0), please stand by... ``` Alternatively you can open a new terminal and use aztec-cli to get the version. diff --git a/yarn-project/aztec-sandbox/package.json b/yarn-project/aztec-sandbox/package.json index d176756f835..134de4da8b9 100644 --- a/yarn-project/aztec-sandbox/package.json +++ b/yarn-project/aztec-sandbox/package.json @@ -35,6 +35,7 @@ "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/l1-artifacts": "workspace:^", + "@aztec/noir-compiler": "workspace:^", "@aztec/noir-contracts": "workspace:^", "@aztec/types": "workspace:^", "abitype": "^0.8.11", diff --git a/yarn-project/aztec-sandbox/src/bin/index.ts b/yarn-project/aztec-sandbox/src/bin/index.ts index 6588ed05143..8f906cf874d 100644 --- a/yarn-project/aztec-sandbox/src/bin/index.ts +++ b/yarn-project/aztec-sandbox/src/bin/index.ts @@ -2,6 +2,7 @@ import { deployInitialSandboxAccounts } from '@aztec/aztec.js'; import { createDebugLogger } from '@aztec/foundation/log'; import { fileURLToPath } from '@aztec/foundation/url'; +import NoirVersion from '@aztec/noir-compiler/noir-version'; import { readFileSync } from 'fs'; import { dirname, resolve } from 'path'; @@ -23,7 +24,7 @@ async function main() { const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'); const version = JSON.parse(readFileSync(packageJsonPath).toString()).version; - logger.info(`Setting up Aztec Sandbox v${version}, please stand by...`); + logger.info(`Setting up Aztec Sandbox v${version} (nargo ${NoirVersion.tag}), please stand by...`); const { l1Contracts, rpcServer, stop } = await createSandbox(); @@ -55,7 +56,9 @@ async function main() { } } logger.info( - `${splash}\n${github}\n\n`.concat(...accountStrings).concat(`Aztec Sandbox v${version} is now ready for use!`), + `${splash}\n${github}\n\n` + .concat(...accountStrings) + .concat(`Aztec Sandbox v${version} (nargo ${NoirVersion.tag}) is now ready for use!`), ); } diff --git a/yarn-project/aztec-sandbox/tsconfig.json b/yarn-project/aztec-sandbox/tsconfig.json index fcd42f67eb9..897517cdef6 100644 --- a/yarn-project/aztec-sandbox/tsconfig.json +++ b/yarn-project/aztec-sandbox/tsconfig.json @@ -27,6 +27,9 @@ { "path": "../l1-artifacts" }, + { + "path": "../noir-compiler" + }, { "path": "../noir-contracts" }, diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index e897b12cbf0..643e11e3290 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -183,6 +183,7 @@ __metadata: "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/l1-artifacts": "workspace:^" + "@aztec/noir-compiler": "workspace:^" "@aztec/noir-contracts": "workspace:^" "@aztec/types": "workspace:^" "@jest/globals": ^29.5.0 From 5e18c6aef44d23d8dc6ee1f66f12fbfae9b5dce6 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 22 Sep 2023 09:04:53 +0200 Subject: [PATCH 17/19] feat: #include_short_version --- docs/src/preprocess/include_version.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/preprocess/include_version.js b/docs/src/preprocess/include_version.js index 296b06158c8..afa372e0a04 100644 --- a/docs/src/preprocess/include_version.js +++ b/docs/src/preprocess/include_version.js @@ -1,7 +1,7 @@ const path = require("path"); const fs = require("fs"); -const VERSION_IDENTIFIERS = ["noir", "aztec"]; +const VERSION_IDENTIFIERS = ["noir", "aztec", "aztec_short"]; let versions; async function getVersions() { @@ -24,6 +24,7 @@ async function getVersions() { versions = { noir: noirVersion, aztec: `aztec-packages-v${aztecVersion}`, + aztec_short: aztecVersion, }; } catch (err) { throw new Error( From 3467cfc621c329a14d9bd92df54729cddc1718c6 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 22 Sep 2023 09:05:14 +0200 Subject: [PATCH 18/19] using the version macro --- .../docs/dev_docs/getting_started/updating.md | 22 +++++++------------ .../end-to-end/src/cli_docs_sandbox.test.ts | 4 ++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index ef29e01af87..9b1952aa25e 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -24,14 +24,14 @@ If you are unsure what version to use go to [aztec-packages repository](https:// Then set the `SANDBOX_VERSION` environmental variable to the version you want to use. E.g.: ```shell -export SANDBOX_VERSION=0.7.7 +export SANDBOX_VERSION=#include_aztec_short_version ``` Now when you run the curl command it will use the version you specified. To verify that it's the case check the console output of the curl command. You should see the following line: ``` -Setting up Aztec Sandbox v0.7.7 (nargo 0.11.1-aztec.0), please stand by... +Setting up Aztec Sandbox v#include_aztec_short_version (nargo #include_noir_version), please stand by... ``` Alternatively you can open a new terminal and use aztec-cli to get the version. @@ -53,7 +53,7 @@ npm install -g @aztec/cli@$SANDBOX_VERSION E.g.: ```shell -npm install -g @aztec/cli@0.7.7 +npm install -g @aztec/cli@#include_aztec_short_version ``` ## Updating Noir compiler @@ -80,18 +80,12 @@ value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec ``` To provide you with a concrete example we will update from version `0.7.5`: -```toml -[dependencies] -aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/aztec" } -value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/value-note" } -``` - -to `0.7.7`: - -```toml +```diff [dependencies] -aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.7", directory="yarn-project/aztec-nr/aztec" } -value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.7", directory="yarn-project/aztec-nr/value-note" } +-aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/aztec" } ++aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="#include_aztec_version", directory="yarn-project/aztec-nr/aztec" } +-value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/value-note" } ++value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="#include_aztec_version", directory="yarn-project/aztec-nr/value-note" } ``` Go to the project directory and try compiling it with `aztec-cli`` to verify that the update was successful: diff --git a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts index fae479bccfc..bedab689aef 100644 --- a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts +++ b/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts @@ -31,8 +31,8 @@ describe('CLI docs sandbox', () => { % aztec-cli get-node-info Node Info: -Sandbox Version: 0.7.7 -Compatible Nargo Version: 0.11.1-aztec.0 +Sandbox Version: #include_aztec_short_version +Compatible Nargo Version: #include_noir_version Chain Id: 31337 Protocol Version: 1 Rollup Address: 0x0dcd1bf9a1b36ce34237eeafef220932846bcd82 From 35615035f196c0e82a3baae81ac8e3e2e498c0f3 Mon Sep 17 00:00:00 2001 From: benesjan Date: Fri, 22 Sep 2023 09:07:59 +0200 Subject: [PATCH 19/19] cleanup --- docs/docs/dev_docs/getting_started/updating.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/updating.md b/docs/docs/dev_docs/getting_started/updating.md index 9b1952aa25e..cb0662ca63c 100644 --- a/docs/docs/dev_docs/getting_started/updating.md +++ b/docs/docs/dev_docs/getting_started/updating.md @@ -71,15 +71,9 @@ Finally we need to update the Noir framework for Aztec contracts. We need to install a version compatible with our `nargo` and Sandbox. To update the framework we will update a tag of the `aztec.nr` dependency in the `Nargo.toml` file to the `SANDBOX_VERSION` from above. -Find all the dependencies pointing to the directory within `aztec.nr` framework and update the corresponding tag: - -```toml -[dependencies] -aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v", directory="yarn-project/aztec-nr/aztec" } -value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v", directory="yarn-project/aztec-nr/value-note" } -``` +Find all the dependencies pointing to the directory within `aztec.nr` framework and update the corresponding tag. +E.g.: -To provide you with a concrete example we will update from version `0.7.5`: ```diff [dependencies] -aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.7.5", directory="yarn-project/aztec-nr/aztec" }