diff --git a/docs/versioned_docs/version-v0.30.0/tutorials/noirjs_app.md b/docs/versioned_docs/version-v0.30.0/tutorials/noirjs_app.md index 3dd9fe7d2b0..7546bffcb0b 100644 --- a/docs/versioned_docs/version-v0.30.0/tutorials/noirjs_app.md +++ b/docs/versioned_docs/version-v0.30.0/tutorials/noirjs_app.md @@ -14,9 +14,9 @@ You can find the complete app code for this guide [here](https://github.com/noir :::note -Feel free to use whatever versions, just keep in mind that Nargo and the NoirJS packages are meant to be in sync. For example, Nargo 0.27.x matches `noir_js@0.27.x`, etc. +Feel free to use whatever versions, just keep in mind that Nargo and the NoirJS packages are meant to be in sync. For example, Nargo 0.30.x matches `noir_js@0.30.x`, etc. -In this guide, we will be pinned to 0.27.0. +In this guide, we will be pinned to 0.30.0. ::: @@ -124,7 +124,7 @@ export default defineConfig({ Now that our stage is set, install the necessary NoirJS packages along with our other dependencies: ```bash -npm install && npm install @noir-lang/backend_barretenberg@0.27.0 @noir-lang/noir_js@0.27.0 +npm install && npm install @noir-lang/backend_barretenberg@0.30.0 @noir-lang/noir_js@0.30.0 npm install rollup-plugin-copy --save-dev ``` @@ -267,6 +267,27 @@ const noir = new Noir(circuit, backend); // } ``` +You can also first resolve and load the circuit this way: + +First, import the necessary packages and don't forget to add: + +```ts +import { readFileSync } from 'fs'; +``` +Then: + +```ts +// try { +let noir: Noir; +const circuitFile = readFileSync(resolve(__dirname, '../target/circuit.json'), 'utf-8'); +const circuit = JSON.parse(circuitFile); +const backend = new BarretenbergBackend(circuit); +noir = new Noir(circuit, backend); +// } +``` + + + :::note For the remainder of the tutorial, everything will be happening inside the `try` block