diff --git a/vite-hardhat/README.md b/vite-hardhat/README.md index 21eacdc..de1e5ab 100644 --- a/vite-hardhat/README.md +++ b/vite-hardhat/README.md @@ -14,9 +14,7 @@ Want to get started in a pinch? Start your project in a free Github Codespace! In the meantime, follow these simple steps to work on your own machine: 1. Install [yarn](https://yarnpkg.com/) (tested on yarn v1.22.19) - 2. Install [Node.js >20.10 (latest LTS)](https://nodejs.org/en) (tested on v18.17.0) - 3. Install [noirup](https://noir-lang.org/getting_started/nargo_installation/#option-1-noirup) with ```bash @@ -46,13 +44,11 @@ cd circuits nargo codegen-verifier ``` -A file named `plonk_vk.sol` should appear in the `circuits/contracts/with_foundry` folder. +A file named `plonk_vk.sol` should appear in the `circuit/contracts/noirstarter` folder. ### Test locally -1. Copy `vite-hardhat/.env.example` to a new file `vite-hardhat/.env`. - -2. Start a local development EVM at with +1. Start a local development EVM at with ```bash npx hardhat node @@ -64,7 +60,7 @@ A file named `plonk_vk.sol` should appear in the `circuits/contracts/with_foundr anvil ``` -3. Run the [example test file](./test/index.test.ts) with +2. Run the [example test file](./test/index.test.ts) with ```bash yarn test @@ -91,29 +87,29 @@ The test demonstrates basic usage of Noir in a TypeScript Node.js environment. 3. Build the project and deploy contracts to the local development chain with ```bash - NETWORK=localhost yarn build + yarn build ``` - > **Note:** If the deployment fails, try removing `yarn.lock` and reinstalling dependencies with - > `yarn`. - 4. Once your contracts are deployed and the build is finished, you can preview the built website with ```bash yarn preview ``` -### Deploy on networks +### Deploy on testnets + +For convenience, we added two configurations for deployment on various testnets. You can find them in `hardhat.config.cts`. -You can choose any other network in `hardhat.config.ts` and deploy there using this `NETWORK` -environment variable. +To deploy on these testnets, copy the `.env.example` and add your own [alchemy](https://www.alchemy.com/) keys for these networks. -For example, `NETWORK=mumbai yarn build` or `NETWORK=sepolia yarn build`. +Then, prepend your commands with your desired network in a `NETWORK` environment variable. For example, to deploy on sepolia: -Make sure you: +```bash +NETWORK=sepolia yarn build` +``` -- Update the deployer private keys in `vite-hardhat/.env` -- Have funds in the deployer account -- Add keys for alchemy (to act as a node) in `vite-hardhat/.env` +Feel free to add more networks, just make sure you: -Feel free to contribute with other networks in `hardhat.config.ts` +- Add deployer private keys and alchemy API keys in `vite-hardhat/.env` +- Have funds in these accounts +- Add a configuration in `hardhat.config.cts` diff --git a/vite-hardhat/package.json b/vite-hardhat/package.json index a8ebaa9..e8df0d7 100644 --- a/vite-hardhat/package.json +++ b/vite-hardhat/package.json @@ -8,7 +8,7 @@ "dev": "yarn prep && hardhat compile && yarn deploy && vite", "build": "hardhat compile && yarn deploy && vite build", "preview": "vite preview", - "deploy": "hardhat compile && NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only' hardhat run --network ${NETWORK} scripts/deploy.ts", + "deploy": "hardhat compile && NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only' hardhat run --network ${NETWORK:-localhost} scripts/deploy.ts", "test": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only' hardhat test" }, "dependencies": { diff --git a/vite-hardhat/test/index.ts b/vite-hardhat/test/index.ts index a89a4c4..17564be 100644 --- a/vite-hardhat/test/index.ts +++ b/vite-hardhat/test/index.ts @@ -9,7 +9,7 @@ import { CompiledCircuit, ProofData } from '@noir-lang/types'; import { join, resolve } from 'path'; async function getCircuit() { - const basePath = resolve(join('./circuits')); + const basePath = resolve(join('./circuit')); const fm = createFileManager(basePath); const result = await compile(fm); if (!('program' in result)) { diff --git a/vite-hardhat/utils/addresses.json b/vite-hardhat/utils/addresses.json index 87e1ffb..943f7c9 100644 --- a/vite-hardhat/utils/addresses.json +++ b/vite-hardhat/utils/addresses.json @@ -1 +1 @@ -{"chainId":31337,"verifier":"0x322813fd9a801c5507c9de605d63cea4f2ce6c44"} \ No newline at end of file +{"chainId":31337,"verifier":"0x7a2088a1bfc9d81c55368ae168c2c02570cb814f"} \ No newline at end of file