feat: add support for .env
This commit is contained in:
parent
62cc2c1f10
commit
20f91f4242
|
@ -0,0 +1,3 @@
|
|||
ETH_CLIENT_ADDRESS=wss://sepolia.infura.io/ws/v3/<key>
|
||||
ETH_TESTNET_KEY=012345privatekey
|
||||
RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password"
|
|
@ -2,3 +2,4 @@
|
|||
keystore
|
||||
postgresql
|
||||
rln_tree
|
||||
.env
|
||||
|
|
|
@ -17,7 +17,7 @@ You need:
|
|||
```
|
||||
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
|
||||
export RLN_RELAY_CRED_PASSWORD=PICK_A_PASSWORD
|
||||
```
|
||||
|
||||
**🔑 1. Register RLN membership**
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
if test -f ./keystore/keystore.json; then
|
||||
if test -f $(pwd)/keystore/keystore.json; then
|
||||
echo "keystore/keystore.json alredy 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 nwaku release when ready instead of quay
|
||||
|
||||
|
||||
|
||||
docker run -v $(pwd)/keystore:/keystore/:Z wakuorg/nwaku:v0.21.3 generateRlnKeystore \
|
||||
--rln-relay-eth-client-address=${ETH_CLIENT_ADDRESS} \
|
||||
--rln-relay-eth-private-key=${ETH_TESTNET_KEY} \
|
||||
--rln-relay-eth-contract-address=0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 \
|
||||
--rln-relay-cred-path=/keystore/keystore.json \
|
||||
--rln-relay-cred-password=${KEYSTORE_PASSWORD} \
|
||||
--rln-relay-cred-password="'"${RLN_RELAY_CRED_PASSWORD}"'" \
|
||||
--execute
|
||||
|
|
10
run_node.sh
10
run_node.sh
|
@ -46,12 +46,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/wakunode\
|
||||
|
@ -95,8 +95,6 @@ exec /usr/bin/wakunode\
|
|||
--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}\
|
||||
|
|
Loading…
Reference in New Issue