-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(rln-relay): updated docs #1993
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# rln-keystore-generator | ||
|
||
This document describes how to run and use the `rln-keystore-generator` tool. | ||
It is meant to be used to generate and persist a set of valid RLN credentials to be used with rln-relay. | ||
|
||
## Pre-requisites | ||
|
||
1. An EOA with some ETH to pay for the registration transaction ($PRIVATE_KEY) | ||
2. An RPC endpoint to connect to an Ethereum node ($RPC_URL) | ||
|
||
## Usage | ||
|
||
1. First, we compile the binary | ||
|
||
```bash | ||
make -j12 rln-keystore-generator | ||
``` | ||
This command will fetch the rln static library and link it automatically. | ||
|
||
|
||
2. Define the arguments you wish to use | ||
|
||
```bash | ||
export RPC_URL="https://sepolia.infura.io/v3/..." | ||
export PRIVATE_KEY="0x..." | ||
export RLN_CONTRACT_ADDRESS="0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4" | ||
export RLN_CREDENTIAL_PATH="rlnKeystore.json" | ||
export RLN_CREDENTIAL_PASSWORD="xxx" | ||
``` | ||
|
||
3. Dry run the command to ensure better degree of execution | ||
|
||
```bash | ||
./build/rln_keystore_generator \ | ||
--rln-relay-eth-client-address:$RPC_URL \ | ||
--rln-relay-eth-private-key:$PRIVATE_KEY \ | ||
--rln-relay-eth-contract-address:$RLN_CONTRACT_ADDRESS \ | ||
--rln-relay-cred-path:$RLN_CREDENTIAL_PATH \ | ||
--rln-relay-cred-password:$RLN_CREDENTIAL_PASSWORD | ||
``` | ||
By default, the tool will not execute a transaction. It will execute only if `--execute` is passed in. | ||
|
||
4. Run the keystore generator with the onchain registration | ||
|
||
```bash | ||
./build/rln_keystore_generator \ | ||
--rln-relay-eth-client-address:$RPC_URL \ | ||
--rln-relay-eth-private-key:$PRIVATE_KEY \ | ||
--rln-relay-eth-contract-address:$RLN_CONTRACT_ADDRESS \ | ||
--rln-relay-cred-path:$RLN_CREDENTIAL_PATH \ | ||
--rln-relay-cred-password:$RLN_CREDENTIAL_PASSWORD \ | ||
--execute | ||
``` | ||
|
||
What this does is - | ||
a. generate a set of valid rln credentials | ||
b. registers it to the contract address provided | ||
c. persists the credentials to the path provided | ||
|
||
5. You may now use this keystore with wakunode2 or chat2. | ||
|
||
## Troubleshooting | ||
|
||
1. `KeystoreCredentialNotFoundError` | ||
|
||
``` | ||
KeystoreCredentialNotFoundError: Credential not found in keystore | ||
``` | ||
This is most likely due to multiple credentials present in the same keystore. | ||
To navigate around this, both chat2 and wakunode2 have provided an option to specify the credential index to use (`--rln-relay-membership-index`). | ||
Please use this option with the appropriate tree index of the credential you wish to use. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# rln_keystore_generator | ||
|
||
TODO! | ||
Documentation on running the `rln-keystore-generator` can be found [here](../../docs/tutorial/rln-keystore-generator.md) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we provide
.env.example
with all these env vars (although some having example or empty values) rather than have a bunch of copies of these exports at various places - here, run-with-rln.md, onchain-rln-relay-chat2 has the values too (and could also reference the import/sourcing of.env
)It would potentially help us (you:) ) with keeping all the places referencing these in sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed - follow up pr for this!