Skip to content

Commit

Permalink
Merge pull request #108 from 0xkf/origin/feat/refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mhchia authored Sep 26, 2023
2 parents 1fb03c5 + 2366fd0 commit 9b6f8ea
Show file tree
Hide file tree
Showing 15 changed files with 1,051 additions and 6,154 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ const rln = await RLN.createWithContractRegistry({
```

## Example

See [example for both NodeJS](./examples/node/) and [example for browser](./examples/browser/).
See the [example](./examples) that can be run in both NodeJS and browser.

## Tests

Expand Down
20 changes: 15 additions & 5 deletions examples/browser/README.md → examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ In a new terminal, run:
$ npx hardhat node
```

3. Run the web server
3. Run the example in a browser
"Try npm run clean if you've made changes to the code but the web page is not updated"
```bash
$ npm run test

$ npm run browser

...
Available on:
http://127.0.0.1:8080
http://192.168.50.66:8080
Hit CTRL-C to stop the server
```

4. Open the web page at `http://localhost:8080`. You should see the following output in the browser console.
Open the web page at `http://localhost:8080`. You should see the following output in the browser console.
```
Connecting to endpoint at http://localhost:8545
Deploying contracts...
Expand All @@ -43,3 +42,14 @@ Successfully breached rlnAnother's secret=xxx
Successfully slashed rlnAnother
```

4. Run the example in NodeJS
```
$ npm run node
...
Connecting to endpoint at http://localhost:8545
Deploying contracts...
...
Successfully breached rlnAnother's secret=xxx
Successfully slashed rlnAnother
```
Loading

0 comments on commit 9b6f8ea

Please sign in to comment.