fix(rln-relay): keystore usage (#1750)

* fix(rln-relay): keystore usage

* docs(rln-relay): explicit keystore usage
This commit is contained in:
Aaryamann Challani 2023-05-22 22:06:55 +05:30 committed by GitHub
parent bb9d231bdc
commit 36266b43cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

1
.gitignore vendored
View File

@ -39,7 +39,6 @@ node_modules/
.idea/ .idea/
# RLN / keystore # RLN / keystore
rlnCredentials.txt
rlnKeystore.json rlnKeystore.json
*.tar.gz *.tar.gz

View File

@ -592,7 +592,7 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
chat.prompt = false chat.prompt = false
showChatPrompt(chat) showChatPrompt(chat)
proc registrationHandler(txHash: string) {.gcsafe, closure.} = 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..." echo "rln-relay preparation is in progress..."

View File

@ -159,13 +159,13 @@ quitting...
## How to persist and reuse RLN credential ## 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. 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.
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. If the keystore exists in the path provided, it is used, and will default to the 0th element in the credential array.
Otherwise, the chat client does not generate a new credential and will use, instead, the persisted RLN credential. 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 ```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. Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-private-key` flag.
@ -173,7 +173,7 @@ Note: If you are reusing credentials, you can omit the `rln-relay-eth-account-pr
Therefore, the command to start chat2 would be - Therefore, the command to start chat2 would be -
```bash ```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 # Sample test output