-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update docs #3223
Merged
Merged
docs: update docs #3223
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2e8bdca
docs: update docs
alexghr 771de58
docs: document `aztec-cli update` command
alexghr 6f8f879
add new setup info
critesjosh c51278f
clarify
critesjosh d5784a5
add clarifying notes
critesjosh aa6ce38
Merge branch 'master' into alexg/docs/update-docs
critesjosh 10f8309
Merge branch 'master' into alexg/docs/update-docs
critesjosh eec9646
fix link
critesjosh da8bbeb
fix link
critesjosh af89571
add note on sandbox as dep
critesjosh aca597f
Update docs/docs/dev_docs/cli/cli-commands.md
critesjosh f51f841
Update docs/docs/dev_docs/cli/cli-commands.md
critesjosh ea99533
Update docs/docs/dev_docs/updating.md
critesjosh 06d3e80
add rahuls feedback
critesjosh 73e0251
Merge
critesjosh 547d586
Update docs/docs/dev_docs/contracts/compiling.md
critesjosh 9ad59d7
Merge branch 'alexg/docs/update-docs' of https://github.com/AztecProt…
critesjosh 0231407
remove unnecessary references
critesjosh 87d4e65
remove extra details
critesjosh c69ad90
add note on aztec-cli update
critesjosh 5a17f5e
update refs to Noir project, npm in quickstart
critesjosh 5583df8
make some improvemnts + refactor update page
rahul-kothari 2d9f58d
Merge branch 'master' into alexg/docs/update-docs
rahul-kothari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,29 +13,7 @@ If you already have some experience with Noir and want to build a cooler contrac | |
|
||
## Install nargo | ||
critesjosh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
`Aztec.nr` is a framework built on top of [Noir](https://noir-lang.org), a zero-knowledge DSL. Nargo is the build tool for Noir, similar to cargo for Rust. We need it for compiling our smart contracts. | ||
|
||
<InstallNargoInstructions /> | ||
|
||
You can check it has been installed correctly by running: | ||
|
||
```bash | ||
aztec-cli get-node-info | ||
``` | ||
|
||
It should print something similar to: | ||
|
||
```bash | ||
➜ ~ aztec-cli get-node-info | ||
|
||
Node Info: | ||
|
||
Version: 1 | ||
Chain Id: 31337 | ||
Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 | ||
Client: [email protected] | ||
Compatible Nargo Version: 0.16.0-aztec.0 | ||
``` | ||
`Aztec.nr` is a framework built on top of [Noir](https://noir-lang.org), a zero-knowledge DSL. [Aztec CLI](../cli/main.md) comes with a built-in Noir compiler. | ||
|
||
## Set up a project | ||
|
||
|
@@ -52,29 +30,21 @@ cd aztec-private-counter | |
mkdir contracts | ||
``` | ||
|
||
Inside `contracts`, create a new Noir project using nargo: | ||
Inside contracts create the following file structure: | ||
|
||
```bash | ||
cd contracts | ||
nargo new counter --contract | ||
``` | ||
|
||
The `contract` flag will create a contract nargo project rather than using vanilla Noir. | ||
|
||
Your file structure should look like this: | ||
|
||
```bash | ||
aztec-private-counter | ||
|-contracts | ||
| |--counter | ||
| | |--src | ||
| | | |--main.nr | ||
| | |Nargo.toml | ||
```tree | ||
. | ||
|-aztec-private-counter | ||
| |-contracts | ||
| | |--counter | ||
| | | |--src | ||
| | | | |--main.nr | ||
| | | |--Nargo.toml | ||
``` | ||
|
||
The file `main.nr` will soon turn into our smart contract! | ||
|
||
Your `Nargo.toml` file should look something like this: | ||
Add the following content to `Nargo.toml`: | ||
|
||
```toml | ||
[package] | ||
|
@@ -84,19 +54,14 @@ authors = [""] | |
compiler_version = "0.16.0" | ||
critesjosh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[dependencies] | ||
``` | ||
|
||
Add the following dependencies under `[dependencies]`: | ||
|
||
```toml | ||
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="#include_aztec_version", directory="yarn-project/aztec-nr/value-note"} | ||
easy_private_state = { git="https://github.com/AztecProtocol/aztec-packages", tag="#include_aztec_version", directory="yarn-project/aztec-nr/easy-private-state"} | ||
``` | ||
|
||
## Define the functions | ||
|
||
Go to `main.nr` and replace the code with this contract initialization: | ||
Go to `main.nr` and start with this contract initialization: | ||
|
||
```rust | ||
contract Counter { | ||
|
@@ -157,7 +122,7 @@ We have annotated this and other functions with `#[aztec(private)]` which are AB | |
|
||
## Incrementing our counter | ||
|
||
Now let’s implement the `increment` functio we defined in the first step. | ||
Now let’s implement the `increment` function we defined in the first step. | ||
|
||
#include_code increment /yarn-project/noir-contracts/src/contracts/counter_contract/src/main.nr rust | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,29 +18,7 @@ We are going to start with a blank project and fill in the token contract source | |
|
||
## Requirements | ||
|
||
You will need to install nargo, the Noir build too. if you are familiar with Rust, this is similar to cargo. | ||
|
||
<InstallNargoInstructions /> | ||
|
||
If you've already installed the `aztec-cli`, as described in the quickstart [here](../getting_started/quickstart.md#cli), you can check which version of Noir is compatible with your version of the CLI and sandbox by running: | ||
|
||
```bash | ||
aztec-cli get-node-info | ||
``` | ||
|
||
It should print something similar to: | ||
|
||
```bash | ||
➜ ~ aztec-cli get-node-info | ||
|
||
Node Info: | ||
|
||
Version: 1 | ||
Chain Id: 31337 | ||
Rollup Address: 0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9 | ||
Client: [email protected] | ||
Compatible Nargo Version: 0.11.1-aztec.0 | ||
``` | ||
You will need to have `aztec-cli` installed in order to compile Aztec.nr contracts. See the [quickstart guide](../getting_started/quickstart.md#cli) for installation instructions. | ||
|
||
When you are running the Sandbox, `aztec-cli`, and compiling contracts with Noir, make sure you are using matching versions--we will be shipping breaking changes so mis-matched versions may not work. | ||
|
||
|
@@ -62,13 +40,7 @@ inside that directory, create a `contracts` folder for the Aztec contracts. | |
cd token_contract_tutorial && mkdir contracts && cd contracts | ||
``` | ||
|
||
Create a new Noir project using nargo. | ||
|
||
```bash | ||
nargo new --contract token_contract | ||
``` | ||
|
||
Your project should look like this: | ||
Create the following file structure | ||
|
||
```tree | ||
. | ||
|
@@ -78,7 +50,7 @@ Your project should look like this: | |
└── main.nr | ||
``` | ||
|
||
Add the following dependencies to your Nargo.toml file, below the package information: | ||
Add the following content to Nargo.toml file: | ||
|
||
```toml | ||
[package] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexghr the sandbox has to running for this command to work, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's two possibilities:
@aztec/aztec-sandbox
listed as a dependency in package.json then it will compare against that version