From 3a8b10fe591b00c2e5543f8626ab68f231c9ad88 Mon Sep 17 00:00:00 2001 From: stubbsta Date: Mon, 30 Jun 2025 09:13:08 +0200 Subject: [PATCH] Update README and env example --- .env.example | 10 +++++++++- README.md | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 85f93fa..2d4e314 100644 --- a/.env.example +++ b/.env.example @@ -2,11 +2,19 @@ # 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. +# Account of testnet where you have Linea Sepolia ETH that would be staked into RLN contract. +ETH_TESTNET_ACCOUNT= + +# Private key of testnet where you have Linea Sepolia ETH that would be staked into RLN contract. # Note: make sure you don't use the '0x' prefix. # e.g. 0116196e9a8abed42dd1a22eb63fa2a5a17b0c27d716b87ded2c54f1bf192a0b ETH_TESTNET_KEY= +# Address of the RLN contract on Linea Sepolia. +RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6 +# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership. +TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea + # Password you would like to use to protect your RLN membership. RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password" diff --git a/README.md b/README.md index 471052e..32c6c94 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ Ready to use docker-compose to run your own [nwaku](https://github.com/waku-org/ You need: * 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). +* 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) +* If you have Ethereum Sepolia, it 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. @@ -48,14 +50,14 @@ curl -L https://foundry.paradigm.xyz | bash foundryup ``` -Mint the token from your Linea Sepolia account: +Mint the token used to pay for RLN Membership registration from your Linea Sepolia account (This is a generic ERC20 token used for testnet only): ``` -cast send 0x185A0015aC462a0aECb81beCc0497b649a64B9ea "mint(address,uint256)" 5000000000000000000 --private-key $PRIVATE_KEY --rpc-url https://sepolia.infura.io/v3/ +cast send $TOKEN_CONTRACT_ADDRESS "mint(address,uint256)" $ETH_TESTNET_ACCOUNT 5000000000000000000 --private-key $ETH_TESTNET_KEY --rpc-url $RLN_RELAY_ETH_CLIENT_ADDRESS ``` -Approve the RLN contract to spend your tokens: +Approve the RLN contract to spend tokens on behalf of your account: ``` -cast send 0x185A0015aC462a0aECb81beCc0497b649a64B9ea "approve(address,uint256)" 0xB9cd878C90E49F797B4431fBF4fb333108CB90e6 5000000000000000000 --private-key $PRIVATE_KEY --rpc-url https://sepolia.infura.io/v3/ +cast send $TOKEN_CONTRACT_ADDRESS "approve(address,uint256)" $RLN_RELAY-ETH-CONTRACT-ADDRESS 5000000000000000000 --private-key $ETH_TESTNET_KEY --rpc-url $RLN_RELAY_ETH_CLIENT_ADDRESS ``` This command will register your membership and store it in `keystore/keystore.json`.