-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(rln-relay): updated docs (#1993)
- Loading branch information
Showing
4 changed files
with
84 additions
and
38 deletions.
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) |