Skip to content

Commit

Permalink
fix(rln-relay): keystore usage (#1750)
Browse files Browse the repository at this point in the history
* fix(rln-relay): keystore usage

* docs(rln-relay): explicit keystore usage
  • Loading branch information
rymnc committed May 22, 2023
1 parent bb9d231 commit 36266b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ node_modules/
.idea/

# RLN / keystore
rlnCredentials.txt
rlnKeystore.json
*.tar.gz

Expand Down
2 changes: 1 addition & 1 deletion apps/chat2/chat2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
chat.prompt = false
showChatPrompt(chat)
proc registrationHandler(txHash: string) {.gcsafe, closure.} =
echo "You are registered to the rln membership contract, find details of your registration transaction in https://goerli.etherscan.io/tx/0x", txHash
echo "You are registered to the rln membership contract, find details of your registration transaction in https://sepolia.etherscan.io/tx/", txHash

echo "rln-relay preparation is in progress..."

Expand Down
12 changes: 6 additions & 6 deletions docs/tutorial/onchain-rln-relay-chat2.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,21 @@ quitting...

## How to persist and reuse RLN credential

You may pass the `rln-relay-cred-path` config option to specify a path for 1) persisting RLN credentials and 2) retrieving persisted RLN credentials.
RLN credential is persisted in the `rlnCredentials.txt` file under the specified path.
If this file does not already exist under the supplied path, then a new credential is generated and persisted in the `rlnCredentials.txt` file.
Otherwise, the chat client does not generate a new credential and will use, instead, the persisted RLN credential.
You may pass the `rln-relay-cred-path` config option to specify a path to a file for 1) persisting RLN credentials and 2) retrieving persisted RLN credentials.

If the keystore exists in the path provided, it is used, and will default to the 0th element in the credential array.
If the keystore does not exist in the path provided, a new keystore will be created and added to the directory it was supposed to be in.

```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:your_eth_private_key --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-account-private-key:your_private_key --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./rlnKeystore.json --rln-relay-cred-password:your_password
```

Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-private-key` flag.

Therefore, the command to start chat2 would be -

```bash
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./
./build/chat2 --fleet:test --content-topic:/toy-chat/3/mingde/proto --rln-relay:true --rln-relay-dynamic:true --rln-relay-eth-contract-address:0x9C09146844C1326c2dBC41c451766C7138F88155 --rln-relay-eth-client-address:your_sepolia_node --ports-shift=1 --rln-relay-cred-path:./rlnKeystore.json --rln-relay-cred-password:your_password
```

# Sample test output
Expand Down

0 comments on commit 36266b4

Please sign in to comment.