Skip to content

kevaundray/noir-recursion

 
 

Repository files navigation

Noir with Next and Hardhat

Netlify Status

This example uses Next.js as the frontend framework, and Hardhat to deploy and test.

It also features multiple files and different entry points by resolving multiple files and using the entry_point parameter to the compile function.

Getting Started

  1. Install nargo version 0.9.0 with noirup -v 0.9.0

  2. Install dependencies with

yarn
  1. Write circuits in ./circuits/src.

You can read more about writing circuits in Noir on the Noir docs.

  1. Create the verifier contract

Navigate to the .circuits/ directory and run nargo codegen-verifier

  1. Compile your circuit

Compile your circuits with nargo compile main.

  1. Deploy
  • Start a local development EVM at http://localhost:8545, for example with npx hardhat node.
  • Copy ./.env.example to ./.env and add keys for alchemy (to act as a node) and the deployer's private key. Make sure you have funds in this account.
  • Run NETWORK=localhost yarn build to build the project and deploy contracts to the local development chain

You can choose any other network in hardhat.config.ts and deploy there using this NETWORK environment variable. For example, NETWORK=mumbai yarn build or NETWORK=sepolia yarn build. Feel free to contribute with other networks in hardhat.config.ts

Once your contracts are deployed and the build is finished, start the web app with yarn start.

Testing

There is a basic example test file that shows the usage of Noir in a typescript node.js environment. You can run the tests with:

yarn test

About

Quick fork of noir-starter to try Noir recursion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 88.3%
  • TypeScript 11.0%
  • Other 0.7%