From b95b426c48ce06f12bf79a02129c5cec21a66bdb Mon Sep 17 00:00:00 2001 From: stubbsta Date: Fri, 27 Jun 2025 16:58:35 +0200 Subject: [PATCH] Update to explain the TOken minting and approval process for RLN membership --- .env.example | 4 ++-- README.md | 23 +++++++++++++++++++++-- register_rln.sh | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 8a1a411..85f93fa 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ # RPC URL for accessing testnet via HTTP. -# e.g. https://sepolia.infura.io/v3/123aa110320f4aec179150fba1e1b1b1 -RLN_RELAY_ETH_CLIENT_ADDRESS=https://sepolia.infura.io/v3/ +# e.g. https://linea-sepolia.infura.io/v3/123aa110320f4aec179150fba1e1b1b1 +RLN_RELAY_ETH_CLIENT_ADDRESS=https://linea-sepolia.infura.io/v3/ # Private key of testnet where you have sepolia ETH that would be staked into RLN contract. # Note: make sure you don't use the '0x' prefix. diff --git a/README.md b/README.md index 946c043..7599b0c 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ Ready to use docker-compose to run your own [nwaku](https://github.com/waku-org/ ### 📝 0. Prerequisites You need: -* Linea Sepolia account with some balance <0.01 Eth. Get some [here](https://www.infura.io/faucet/sepolia). -* Then go to https://rln.waku.org/ and follow the instructions to create your membership and export the keystore. +* Linea Sepolia HTTP endpoint. Get one free from [Infura](https://www.infura.io/). +* Linea Sepolia account with some balance <0.01 Eth. You can get some Ethereum Sepolia or Linea Sepolia [here](https://www.infura.io/faucet/sepolia) and Ethereum Sepolia can be bridged to Linea Sepolia [here](https://bridge.linea.build/native-bridge). +* A password to protect your rln membership. `docker-compose` [will read the `./.env` file](https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information-3) from the filesystem. There is `.env.example` available for you as a template to use for providing the above values. The process when working with `.env` files is to copy the `.env.example`, store it as `.env` and edit the values there. @@ -39,6 +40,24 @@ The script is experimental, feedback and pull requests are welcome. The RLN membership is your access key to The Waku Network. Its registration is done onchain, and allows your nwaku node to publish messages in a decentralized and private way, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded). Messages exceeding the rate limit won't be relayed by other peers. +Before registering you need to mint and approve the tokens to pay for the registration. +The simplest way is using Foundry's [cast](https://getfoundry.sh/) tool, which you can install with: + +``` +curl -L https://foundry.paradigm.xyz | bash +foundryup + +``` +Mint the token from your Linea Sepolia account: +``` +cast send 0x185A0015aC462a0aECb81beCc0497b649a64B9ea "mint(address,uint256)" 5000000000000000000 --private-key $PRIVATE_KEY --rpc-url https://sepolia.infura.io/v3/ +``` + +Approve the RLN contract to spend your tokens: +``` +cast send 0x185A0015aC462a0aECb81beCc0497b649a64B9ea "approve(address,uint256)" 0xB9cd878C90E49F797B4431fBF4fb333108CB90e6 5000000000000000000 --private-key $PRIVATE_KEY --rpc-url https://sepolia.infura.io/v3/ +``` + This command will register your membership and store it in `keystore/keystore.json`. Note that if you just want to relay traffic (not publish), you don't need one. diff --git a/register_rln.sh b/register_rln.sh index ec6dc6b..f168b6a 100755 --- a/register_rln.sh +++ b/register_rln.sh @@ -20,7 +20,7 @@ if test -n "${ETH_CLIENT_ADDRESS}"; then exit 1 fi -docker run -v "$(pwd)/keystore":/keystore/:Z wakuorg/nwaku:v0.35.1 generateRlnKeystore \ +docker run -v "$(pwd)/keystore":/keystore/:Z wakuorg/nwaku:v0.36.0 generateRlnKeystore \ --rln-relay-eth-client-address=${RLN_RELAY_ETH_CLIENT_ADDRESS} \ --rln-relay-eth-private-key=${ETH_TESTNET_KEY} \ --rln-relay-eth-contract-address=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6 \