You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Deploy the necessary contracts: verifier (the mock proof verifier since it's not yet generated), ERC20 token, and the RLN contract
5
+
2. Create a RLN instance `rln`, and demonstrate how to `register`, `createProof`, `verifyProof`, `withdraw`, and `releaseWithdrawal`.
6
+
3. Create a RLN instance `rlnAnother` and demonstrate how to slash a spammer. `rlnAnother` simply `register` and send more proofs than they should. `rln` can detect the spam by examine the output from `saveProof`. If the status of the output is BREACH, the secret is leaked. `rln` can use the recovered secret to slash the spammer by calling `slash`.
7
+
8
+
To install and run the example, follow the steps below.
9
+
10
+
1. Install the project
11
+
```bash
12
+
$ npm install
13
+
```
14
+
15
+
2. Run a local testing RPC
16
+
Here we use a hardhat node. If the RPC is not listening `http://localhost:8545`, you need to change the `url` in [config.ts](./src/configs.ts).
17
+
18
+
In a new terminal, run:
19
+
```bash
20
+
$ npx hardhat node
21
+
```
22
+
23
+
3. Run the web server
24
+
```bash
25
+
$ npm run test-browser
26
+
27
+
28
+
...
29
+
Available on:
30
+
http://127.0.0.1:8080
31
+
http://192.168.50.66:8080
32
+
Hit CTRL-C to stop the server
33
+
```
34
+
35
+
4. Open the web page at `http://localhost:8080`. You should see the following output in the browser console.
0 commit comments