chore: fix merge conflicts and pull useful changes from nwaku

This commit is contained in:
Prem Chaitanya Prathi 2024-01-04 10:34:48 +05:30
commit ed7483d208
No known key found for this signature in database
6 changed files with 34 additions and 16 deletions

10
.env.example Normal file
View File

@ -0,0 +1,10 @@
ETH_CLIENT_ADDRESS=wss://sepolia.infura.io/ws/v3/<key>
ETH_TESTNET_KEY=012345privatekey
RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password"
# Advanced
GO_WAKU_IMAGE=
NODEKEY=
DOMAIN=
EXTRA_ARGS=
RLN_RELAY_CONTRACT_ADDRESS=

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
**/.DS_Store
keystore
postgresql
rln_tree
rln_tree
.env

View File

@ -14,12 +14,15 @@ You need:
* Ethereum Sepolia account with some balance <0.01 Eth. Get some [here](https://www.infura.io/faucet/sepolia).
* A password to protect your rln membership.
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.
```
export ETH_CLIENT_ADDRESS=wss://sepolia.infura.io/ws/v3/YOUR_INFURA_KEY
export ETH_TESTNET_KEY=REPLACE_BY_YOUR_KEY
export KEYSTORE_PASSWORD=PICK_A_PASSWORD
cp .env.example .env
${EDITOR} .env
```
Make sure to **NOT** place any secrets into `.env.example`, as they might be unintentionally published in the Git repository.
**🔑 1. Register RLN membership**
The RLN membership is your access key to The Waku Network. Its registration is done onchain, and allows your go-waku node to publish messages in a decentralized and private way, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded).

View File

@ -47,7 +47,7 @@ services:
environment:
DOMAIN: ${DOMAIN}
NODEKEY: ${NODEKEY}
KEYSTORE_PASSWORD: ${KEYSTORE_PASSWORD}
KEYSTORE_PASSWORD: "${KEYSTORE_PASSWORD}"
ETH_CLIENT_ADDRESS: *eth_client_address
EXTRA_ARGS: ${EXTRA_ARGS}
<<:
@ -119,8 +119,8 @@ services:
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ${PG_DATA_DIR:-./postgresql}:/var/lib/postgresql/data:Z
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- 127.0.0.1:5432:5432
ports: []
# - 127.0.0.1:5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -d db_prod"]
interval: 30s

View File

@ -1,11 +1,16 @@
#!/bin/sh
if test -f ./keystore/keystore.json; then
echo "keystore/keystore.json alredy exists. Use it instead of creating a new one."
if test -f $(pwd)/keystore/keystore.json; then
echo "keystore/keystore.json already exists. Use it instead of creating a new one."
echo "Exiting"
exit 1
fi
if test -f .env; then
echo "Using .env file"
. $(pwd)/.env
fi
# TODO: Set go-waku release when ready
docker run -v $(pwd)/keystore:/keystore/:Z wakuorg/go-waku:v0.9.0 generate-rln-credentials \
@ -13,4 +18,5 @@ docker run -v $(pwd)/keystore:/keystore/:Z wakuorg/go-waku:v0.9.0 generate-rln-c
--eth-account-private-key=${ETH_TESTNET_KEY} \
--eth-contract-address=0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 \
--cred-path=/keystore/keystore.json \
--cred-password=${KEYSTORE_PASSWORD}
--cred-password="${RLN_RELAY_CRED_PASSWORD}"

View File

@ -49,12 +49,12 @@ if [ -n "${NODEKEY}" ]; then
NODEKEY=--nodekey=${NODEKEY}
fi
if [ -n "${RLN_RELAY_CRED_PATH}" ]; then
RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH}
fi
RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH:-/keystore/keystore.json}
if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password=${RLN_RELAY_CRED_PASSWORD}
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password="${RLN_RELAY_CRED_PASSWORD}"
fi
exec /usr/bin/waku\
@ -98,8 +98,6 @@ exec /usr/bin/waku\
--rln-relay-eth-contract-address="${RLN_RELAY_CONTRACT_ADDRESS}"\
--rln-relay-eth-client-address="${ETH_CLIENT_ADDRESS}"\
--rln-relay-tree-path="/etc/rln_tree"\
--rln-relay-cred-password="${KEYSTORE_PASSWORD}"\
--rln-relay-cred-path="/keystore/keystore.json"\
${RLN_RELAY_CRED_PATH}\
${RLN_RELAY_CRED_PASSWORD}\
${DNS_WSS_CMD}\