Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 69 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,131 @@
<div align="center">
<a href="https://aztec.network">
<img src="https://github.com/AztecProtocol/aztec-packages/blob/master/docs/static/img/aztec-logo.9cde8ae1.svg" alt="Aztec Protocol Logo" width="300">
</a>
</div>

# Aztec Starter

This repo is meant to be a starting point for writing Aztec contracts and tests.

You can find the Easy Private Voting contract in `./src/main.nr`. A simple integration test is in `./src/test/index.test.ts`.
You can find the **Easy Private Voting contract** in `./src/main.nr`. A simple integration test is in `./src/test/index.test.ts`.

The corresponding tutorial can be found in the [Aztec docs here](https://docs.aztec.network/tutorials/codealong/contract_tutorials/private_voting_contract).

## Getting Started
<div align="center">

[![GitHub Repo stars](https://img.shields.io/github/stars/AztecProtocol/aztec-packages?logo=github&color=yellow)](https://github.com/AztecProtocol/aztec-packages/stargazers)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make it more clear that this info is for the aztec-packages repo and not this starter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for the confusion! I had submitted two PRs and must have mixed up some details. I've now corrected it to clearly reference the appropriate repository. Thanks for catching that, and I appreciate the review!

[![GitHub forks](https://img.shields.io/github/forks/AztecProtocol/aztec-packages?logo=github&color=blue)](https://github.com/AztecProtocol/aztec-packages/network/members)
[![GitHub last commit](https://img.shields.io/github/last-commit/AztecProtocol/aztec-packages?logo=git)](https://github.com/AztecProtocol/aztec-packages/commits/main)
[![License](https://img.shields.io/github/license/AztecProtocol/aztec-packages?logo=open-source-initiative)](https://github.com/AztecProtocol/aztec-packages/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/924442927399313448?logo=discord&color=5865F2)](https://discord.gg/aztec)
[![Twitter Follow](https://img.shields.io/twitter/follow/aztecnetwork?style=flat&logo=twitter)](https://x.com/aztecnetwork)

</div>

---

Use node version 18.
## 🚀 **Getting Started**

Use **Node.js version 18**.

[Start your codespace from the codespace dropdown](https://docs.github.com/en/codespaces/getting-started/quickstart).

Get the sandbox, aztec-cli and other tooling with this command:
Get the **sandbox, aztec-cli, and other tooling** with this command:

```bash
```bash
bash -i <(curl -s https://install.aztec.network)
```

Install the correct version of the toolkit with:

```bash
```bash
aztec-up 0.70.0
```

Start the sandbox with:

```bash
```bash
aztec start --sandbox
```
---

## Install packages
## 📦 **Install Packages**

```bash
```bash
yarn install
```
---

## Compile
## 🏗 **Compile**

```bash
aztec-nargo compile
```bash
aztec-nargo compile
```
or

or

```bash
```bash
yarn compile
```

## Codegen
---

## 🔧 **Codegen**

Generate the contract artifact json and typescript interface
Generate the **contract artifact JSON** and TypeScript interface:

```bash
```bash
yarn codegen
```
---

## Test
## 🧪 **Test**

Make sure the sandbox is running before running tests.
**Make sure the sandbox is running before running tests.**

```bash
```bash
aztec start --sandbox
```

Then test with:

```bash
```bash
yarn test
```

Testing will run the Typescript tests defined in `index.test.ts` file in the `./src/test` directory, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/guides/developer_guides/smart_contracts/testing) tests defined in [`first.nr`](./src/test/first.nr) (and imported at the top of the contract file with `mod test;`).
Testing will run the **TypeScript tests** defined in `index.test.ts` inside `./src/test`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/guides/developer_guides/smart_contracts/testing) tests defined in [`first.nr`](./src/test/first.nr) (imported in the contract file with `mod test;`).

## Error resolution
---

### Update Nodejs and Noir dependencies
## ❗ **Error Resolution**

```bash
### 🔄 **Update Node.js and Noir Dependencies**

```bash
yarn update
```

### Update Contract
### 🔄 **Update Contract**

Get the contract code from the monorepo. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo.
Get the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo.

```bash
```bash
yarn update
```

You may need to update permissions with:

```bash
```bash
chmod +x update_contract.sh
```


### 💬 Join the Community:
<p align="left">
<a href="https://t.me/aztec_network](https://t.me/AztecAnnouncements_Official">
<img src="https://img.shields.io/badge/Telegram-26A5E4?logo=telegram&logoColor=white&style=for-the-badge" alt="Telegram">
</a>
<a href="https://discord.gg/aztec">
<img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white&style=for-the-badge" alt="Discord">
</a>
<a href="https://x.com/aztecnetwork">
<img src="https://img.shields.io/badge/Twitter-000000?logo=x&logoColor=white&style=for-the-badge" alt="Twitter (X)">
</a>
</p>
Loading