Skip to content
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

feat(docs): set up noir contracts in getting-started #1770

Merged
merged 7 commits into from
Sep 5, 2023

Conversation

rahul-kothari
Copy link
Contributor

@rahul-kothari rahul-kothari commented Aug 23, 2023

Fix #1699 - there was no set-up guide for noir contracts on getting started

Don't see a point to explain how to write, compile or deploy when these are already covered in multiple other places

@rahul-kothari rahul-kothari changed the title get started on noir contracts feat(docs): set up noir contracts in getting-started Aug 23, 2023
@rahul-kothari
Copy link
Contributor Author

@dan-aztec once the aztec-cli unbox command is ready, the sandbox.md and noir_contracts.md files in getting-started definitely need updates!

@iAmMichaelConnor
Copy link
Contributor

I think we're 95% sure that the noir-libs/ directory will be branded as a library called 'Aztec.nr'. We could start introducing that name?

@rahul-kothari
Copy link
Contributor Author

@iAmMichaelConnor done on the entire getting-started section

Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall solid section, ive a few minor nits

docs/docs/dev_docs/getting_started/noir.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
:::

### Dependencies
1. 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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would alter this section such that the bullet points are supported by sentences, rather than being sentences.

  1. Nargo
    nargo install instructions ...

  2. Sandbox
    Sandbox installation instructions / link

  3. Starter repo
    Link to starter repo

mkdir contracts
```

All contract projects will reside within this folder.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth noting that it does not need to live in contracts, this is just a style choice

docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved

3. Build the aztec.nr library on your machine.

For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: make an issue to adjust this, we need the library to be hosted elsewhere before launching

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. Removing step 3 entirely, and adding the git repo in toml should be the way to go.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine
For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated -> nargo.toml can now directly talk to a directory in a gh repo!


You are now ready to write your own contracts!

You can replace the content of the generated file `example_contract/src/main.nr` with your contract code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting the current nargo new output is just a main file. We need to tell them to add the contract scope (granted that may be said in the linked next steps section below ) ( if it is ignore this )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like something that should the starter-kit should handle or aztec cli init or just template on gh.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contract scope replalcement is explained in another link

@@ -6,7 +6,7 @@ import Image from "@theme/IdealImage";

## Introduction

The Aztec Sandbox aims to provide a local development system against which you can build and test Noir contracts in a fast, safe, and free environment.
The Aztec Sandbox aims to provide a local development system against which you can build and test Aztec.nr (read "aztec-noir") contracts in a fast, safe, and free environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the Aztec.nr distinction should be made here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Think it is fine to leave it out, readers will figure out when they hit the page named Aztec.nr just a second later.

Copy link
Contributor

@LHerskind LHerskind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent use of . at numbered lists at the end, and think it would be more easily to tell steps apart with a smaller heading instead of the list like that.

docs/docs/dev_docs/getting_started/sandbox.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
@@ -195,6 +195,7 @@ const sidebars = {
"dev_docs/getting_started/noir",
"dev_docs/getting_started/sandbox",
"dev_docs/getting_started/cli",
"dev_docs/getting_started/noir_contracts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordering wise, you could probably move this up above the cli. Logically, would like it to be right after noir, but since you are showing things into sandbox directories probably fine to have it there.

This is more a comment/reflection that something that necessarily needs changing.

@@ -6,7 +6,7 @@ import Image from "@theme/IdealImage";

## Introduction

The Aztec Sandbox aims to provide a local development system against which you can build and test Noir contracts in a fast, safe, and free environment.
The Aztec Sandbox aims to provide a local development system against which you can build and test Aztec.nr (read "aztec-noir") contracts in a fast, safe, and free environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Think it is fine to leave it out, readers will figure out when they hit the page named Aztec.nr just a second later.

noirup -v aztec
```

2. [Have a running sandbox and a code repo to interact with it](./sandbox.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably use a small header rather than the list. When looking over the steps it "vanishes in the crowd". Also would benefit by #1770 (comment).


You are now ready to write your own contracts!

You can replace the content of the generated file `example_contract/src/main.nr` with your contract code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like something that should the starter-kit should handle or aztec cli init or just template on gh.

docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved
docs/docs/dev_docs/getting_started/noir_contracts.md Outdated Show resolved Hide resolved

3. Build the aztec.nr library on your machine.

For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine
For this, clone the `aztec-packages` repository (which is the monorepo where the library resides) and build it anywhere on your machine.

@@ -16,6 +16,8 @@ Noir is designed for accessible and flexible development of provable programs. I
Noir is a public good for developing ZK-provable programs and is independent from building products on the existing Aztec network.
:::

While "Vanilla" Noir will be used to write circuits, we have created a library on top of Noir that will be used to write smart contracts on top of the Aztec Sandbox. Since noir files use the `.nr` extension, we are calling this library "Aztec.nr".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this page a duplicate of the landing page of the proper Noir docs? If so, we should probably replace all the text of this page with a link to Noir's docs.

Copy link
Contributor

@LHerskind LHerskind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the broken link.

@rahul-kothari rahul-kothari merged commit 33eb99d into master Sep 5, 2023
@rahul-kothari rahul-kothari deleted the rk/noir_sc_docs branch September 5, 2023 15:24
PhilWindle pushed a commit that referenced this pull request Sep 5, 2023
🤖 I have created a new Aztec Packages release
---


##
[0.1.0-alpha52](v0.1.0-alpha51...v0.1.0-alpha52)
(2023-09-05)


### Features

* **docs:** set up noir contracts in getting-started
([#1770](#1770))
([33eb99d](33eb99d))


### Bug Fixes

* Complete JS call stacks across ACVM wasm boundaries
([#2013](#2013))
([8e84e46](8e84e46))
* deploy_ecr calculating CONTENT_HASH
([#2024](#2024))
([edee198](edee198))
* Option to fail silently when retrying
([#2015](#2015))
([453c9c1](453c9c1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

noir_contracts in getting started page
4 participants