This example uses Vite as the frontend framework, and Hardhat to deploy and test.
Want to get started in a pinch? Start your project in a free Github Codespace!
-
Install your favorite package manager. We'll use bun but feel free to use
yarn
or others:curl -fsSL https://bun.sh/install | bash
-
Install dependencies:
bun i # "npm i" or "yarn"
-
Run a node
bunx hardhat node
-
Deploy the verifier contract
bun run deploy
-
Run the dev environment
bun dev
You can run the example test file with
bun test
This test shows the basic usage of Noir in a TypeScript Node.js environment. It also starts its own network and deploys the verifier contract.
The default scripting targets a local environment. For convenience, we added some configurations for deployment on various other networks. You can see the existing list by running:
bunx hardhat vars setup
If you want to deploy on any of them, just pass in a private key, for example for the holesky network:
bunx hardhat vars set holesky <your_testnet_private_key>
You can then deploy on that network by passing the --network
flag. For example:
bunx hardhat deploy --network holesky # deploys on holesky
Feel free to add more networks, as long as they're supported by wagmi
(list here). Just make sure you:
- Have funds in these accounts
- Add their configuration in the
networks
property inhardhat.config.cts
- Use the name that wagmi expects (for example
ethereum
won't work, aswagmi
calls itmainnet
)