2.4 KiB
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
- An EOA with some ETH to pay for the registration transaction ($PRIVATE_KEY)
- An RPC endpoint to connect to an Ethereum node ($RPC_URL)
Usage
-
First, we compile the binary
make -j12 rln-keystore-generator
This command will fetch the rln static library and link it automatically.
-
Define the arguments you wish to use
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"
-
Dry run the command to ensure better degree of execution
./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. -
Run the keystore generator with the onchain registration
./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
-
You may now use this keystore with wakunode2 or chat2.
Troubleshooting
-
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.