Skip to content
Closed
Changes from all 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
27 changes: 24 additions & 3 deletions docs/versioned_docs/version-v0.30.0/tutorials/noirjs_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

:::

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down