Changing new parameters to env variables and updating README

This commit is contained in:
Gabriel Mermelstein 2023-09-21 15:28:39 +03:00 committed by alrevuelta
parent 083051da55
commit bb2271acdc
No known key found for this signature in database
GPG Key ID: F345C9F3CCDB886E
3 changed files with 10 additions and 7 deletions

View File

@ -36,6 +36,8 @@ There are multiple environment variables you can configure to modify behaviour o
* `NWAKU_IMAGE` - the image you want to use for the nwaku container (e.g. `NWAKU_IMAGE=statusteam/nim-waku:v0.19.0-rc.0`)
* `DOMAIN` - domain name pointing to the IP address of your node, when configured the run script will request SSL certs from Let's Encrypt and run Waku node with WebSockets Secure (WSS) options enabled (e.g. `DOMAIN=waku.example.com`)
* `NODEKEY` - this env variable allows you to provide a node key as described in [operators documentation](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure-key.md) (e.g. `NODEKEY=9f439983aa4851346cfe6e17585e426f482871a43626812e23490895cd602c11`)
* `RLN_RELAY_CONTRACT_ADDRESS` - address of the RLN Relay Contract. It defaults to `0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4` on Sepolia testnet
* `ETH_CLIENT_ADDRESS` (**mandatory**) - URL to a WebSockets Ethereum node URL on the same network as the contract address. If you're not running your own node, you can get the URL at Infura with the following [instructions](https://docs.infura.io/networks/ethereum/how-to/choose-a-network)
* `EXTRA_ARGS` - this variable allows you to specify additional or overriding CLI option for the Waku node which will be appended to the `wakunode2` command. (e.g. `EXTRA_ARGS="--store=false --max-connections=3000`)
## Log monitoring and troubleshooting

View File

@ -57,6 +57,8 @@ services:
environment:
DOMAIN: ${DOMAIN}
NODEKEY: ${NODEKEY}
RLN_RELAY_CONTRACT_ADDRESS: ${RLN_RELAY_CONTRACT_ADDRESS:-0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4}
ETH_CLIENT_ADDRESS: ${ETH_CLIENT_ADDRESS}
EXTRA_ARGS: ${EXTRA_ARGS}
<<: *pg_env
volumes:

View File

@ -2,6 +2,11 @@
echo "I am a nwaku node"
if [ -z "${ETH_CLIENT_ADDRESS}" ]; then
echo -e "Missing Eth client address, please refer to README.md for detailed instructions"
exit 1
fi
MY_EXT_IP=$(wget -qO- https://api4.ipify.org)
DNS_WSS_CMD=
@ -41,12 +46,6 @@ if [ "${NODEKEY}" != "" ]; then
NODEKEY=--nodekey=${NODEKEY}
fi
RLN_RELAY_CONTRACT_ADDRESS="0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4" # Sepolia Testnet
RLN_TREE_PATH="/etc/rln_tree"
ETH_CLIENT_ADDRESS= # Add a WebSockets endpoint to your Eth Node or an Infura WebSockets URL
# https://docs.infura.io/networks/ethereum/how-to/choose-a-network
# Make sure to use an URL for the same network than the relay contract
exec /usr/bin/wakunode\
--relay=true\
--topic=/waku/2/default-waku/proto\
@ -79,7 +78,7 @@ exec /usr/bin/wakunode\
--rln-relay-dynamic=true\
--rln-relay-eth-contract-address="${RLN_RELAY_CONTRACT_ADDRESS}"\
--rln-relay-eth-client-address="${ETH_CLIENT_ADDRESS}"\
--rln-relay-tree-path="${RLN_TREE_PATH}"\
--rln-relay-tree-path="/etc/rln_tree"\
${DNS_WSS_CMD}\
${NODEKEY}\
${EXTRA_ARGS}