You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates the docker install script to get the sandbox, cli and nargo.
~~just verify that the LSP works with aztec-nargo. suggestions to
install nargo have been removed.~~
EDIT: I added the recommendation to install nargo back in for the LSP.
Closes: AztecProtocol#3846
# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [x] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [x] Every change is related to the PR description.
- [x] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Copy file name to clipboardexpand all lines: docs/docs/concepts/advanced/contract_creation.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -206,7 +206,7 @@ The `deployedContracts` array has a maximum size `MAX_NUM_DEPLOYED_CONTRACTS`. I
206
206
207
207
Excluding these steps, constructor function call is executed identically to a regular private function.
208
208
209
-
> Under this design, if a public constructor is desired, one must create a private constructor function that then calls a public function. This could be abstracted away by the Noir++ compiler.
209
+
> Under this design, if a public constructor is desired, one must create a private constructor function that then calls a public function. This could be abstracted away by the aztec-nargo compiler.
210
210
211
211
**Q: why can't deployments be part of the public fn callstack?**
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/cli/blank_box.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ See the Quickstart page for [requirements](../getting_started/quickstart.md#requ
20
20
21
21
Aztec Boxes use [yarn](https://classic.yarnpkg.com/) for package management, so if you want to follow along exactly, make sure you have it [installed](https://classic.yarnpkg.com/en/docs/install).
22
22
23
-
You will also need to install Noir to compile contracts. You can find instructions for installing the latest version of Noir that is compatible with the Sandbox on the [Aztec.nr Contracts](../contracts/main.md#install-noir) page.
23
+
You will also need to install Aztec tooling to compile contracts. You can find instructions for installing the latest version [here](../cli/sandbox-reference.md).
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/cli/main.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,10 @@ These provide a self contained environment which deploys Aztec on a local (empty
32
32
33
33
The current sandbox does not generate or verify proofs, but provides a working end to end developer flow for writing and interacting with Aztec.nr smart contracts.
34
34
35
-
## Aztec CLI
35
+
## Aztec CLI and aztec-nargo
36
36
37
-
The Aztec CLI is a command-line tool allowing the user to interact directly with the Aztec network and sandbox.
37
+
The Aztec CLI is a command-line tool allowing you to interact directly with the Aztec network and sandbox.
38
38
39
-
It aims to provide all of the functionality required to deploy, compile, and invoke contracts and query system state such as contract data, transactions and emitted logs.
39
+
It aims to provide all of the functionality required to deploy, and invoke contracts and query system state such as contract data, transactions and emitted logs.
40
+
41
+
Use `aztec-nargo` for compiling contracts. See the [compiling contracts](../contracts/compiling.md) page for more information.
This will attempt to run the Sandbox on ` localhost:8080`. You can change the port defined in `./.aztec/docker-compose.yml`. Running the command again will overwrite any changes made to the `docker-compose.yml`.
17
+
This will install the following:
18
18
19
-
This command also installs or updates the CLI. If you have previously installed the CLI via a node package manager, you will need to uninstall it and remove it from your project dependencies and install it via Docker.
19
+
-**aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc).
20
+
-**aztec-cli** - a command line tool for interfacing and experimenting with infrastructure.
21
+
-**aztec-nargo** - aztec's build of nargo, the noir compiler toolchain.
22
+
-**aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing.
23
+
-**aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions.
24
+
25
+
Once these have been installed, to start the sandbox, run:
26
+
27
+
```bash
28
+
aztec-sandbox
29
+
```
30
+
31
+
This will attempt to run the Sandbox with the PXE listening on ` localhost:8080`. You can change the port defined in `./.aztec/docker-compose.yml` or by setting the `PXE_PORT` environment variable. Running the install command again will overwrite any changes made to the `docker-compose.yml`.
32
+
33
+
See the full list of configurable environment variables [here](#environment-variables).
34
+
35
+
If you have previously installed the CLI via a node package manager, you will need to uninstall it and remove it from your project dependencies and install it via Docker.
20
36
21
37
To install a specific version of the sandbox, you can set the environment variable `SANDBOX_VERSION`
Copy file name to clipboardexpand all lines: docs/docs/dev_docs/contracts/main.md
+5-7
Original file line number
Diff line number
Diff line change
@@ -18,27 +18,25 @@ An **Aztec smart contract** is a smart contract with **private** state variables
18
18
19
19
# Getting started
20
20
21
-
## Install Noir
21
+
## Install aztec-nargo
22
22
23
-
To write an Aztec.nr contract, you need to write Noir, [aztec-cli](../cli/cli-commands) comes with a built-in compiler for Noir contracts.
23
+
To write an Aztec.nr contract, you need to write Noir, `aztec-nargo` comes with a built-in compiler for Aztec contracts written in Noir. See install instructions [here](../cli/sandbox-reference.md).
24
24
25
25
:::info
26
-
For those coming from vanilla Noir, the version used for aztec.nr is tracked separately to nargo for vanilla noir, so be sure to use the nargo version shown above
26
+
For those coming from vanilla Noir, the version used for aztec.nr is tracked separately to nargo for vanilla Noir. Be sure to use `aztec-nargo` to compile your contracts.
27
27
:::
28
28
29
29
## Install `nargo` (recommended)
30
30
31
-
The CLI comes with the Noir compiler, so installing `nargo` is not required, however it is recommended as it provides a better developer experience for writing contracts. You will need nargo installed to take advantage of the [Noir Language Server](https://noir-lang.org/nargo/language_server), which provides syntax highlighting and formatting for your Aztec contracts.
32
-
33
-
You will also need `nargo` if you want to run unit tests in Noir.
31
+
`aztec-nargo` comes with the Noir compiler, so installing `nargo` is not required, however it is recommended as it provides a better developer experience for writing contracts. You will need nargo installed to take advantage of the [Noir Language Server](https://noir-lang.org/nargo/language_server), which provides syntax highlighting and formatting for your Aztec contracts.
34
32
35
33
You can install `nargo` with the following commands:
36
34
37
35
<InstallNargoInstructions />
38
36
39
37
## Install Noir tooling
40
38
41
-
There are a number of tools to make writing Aztec.nr contracts more pleasant. See [here](https://github.com/noir-lang/awesome-noir#get-coding).
39
+
There are a number of tools to make writing Aztec.nr contracts in Noir more pleasant. See [here](https://github.com/noir-lang/awesome-noir#get-coding).
This is a library for utilizing notes that hold addresses. Find it on [GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-nr/address-note/src).
36
30
37
31
## Easy private state
@@ -42,6 +36,14 @@ easy_private_state = { git="https://github.com/AztecProtocol/aztec-packages/", t
42
36
43
37
This is an abstraction library for using private variables like [`EasyPrivateUint`](https://github.com/AztecProtocol/aztec-packages/blob/6c20b45993ee9cbd319ab8351e2722e0c912f427/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr#L17).
This library contains types that are used in the Aztec protocol. Find it on [GitHub](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/noir-protocol-circuits/src/crates/types/src).
@@ -148,14 +149,20 @@ Now we've written a simple Aztec.nr smart contract, it's time to ensure everythi
148
149
149
150
### Compile the smart contract
150
151
151
-
In the root of the `nargo` project, run this:
152
+
In `./contracts/counter/` directory, run this:
152
153
153
154
```bash
154
-
aztec-cli compile.
155
+
aztec-nargo compile
155
156
```
156
157
157
158
This will compile the smart contract and create a `target` folder with a `.json` artifact inside.
158
159
160
+
After compiling, you need to generate the ABI and typescript class. In the same directory, run this:
161
+
162
+
```bash
163
+
aztec-cli codegen target -o src/artifacts --ts
164
+
```
165
+
159
166
### Deploy
160
167
161
168
You can use the previously generated artifact to deploy the smart contract. Our constructor takes two arguments - `initial_counter` and `owner` so let's make sure to pass those in.
@@ -192,7 +199,7 @@ Use one of these `address`es as the `owner`. You can either copy it or export.
192
199
To deploy the counter contract, [ensure the sandbox is running](../cli/sandbox-reference.md) and run this in the root of your Noir project:
-**aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc).
45
+
-**aztec-cli** - a command line tool for interfacing and experimenting with infrastructure.
46
+
-**aztec-nargo** - aztec's build of nargo, the noir compiler toolchain.
47
+
-**aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing.
48
+
-**aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions.
49
+
50
+
Once these have been installed, to start the sandbox, run:
51
+
52
+
```bash
53
+
aztec-sandbox
40
54
```
41
55
42
56
This will attempt to run the Sandbox on ` localhost:8080`, so you will have to make sure nothing else is running on that port or change the port defined in `./.aztec/docker-compose.yml`. Running the command again will overwrite any changes made to the `docker-compose.yml`.
0 commit comments