mirror of
https://github.com/logos-messaging/go-waku-compose.git
synced 2026-01-02 13:03:08 +00:00
Refactoring and adding optional rln env variables
This commit is contained in:
parent
91e860220d
commit
1ef2aa5503
10
README.md
10
README.md
@ -15,20 +15,12 @@ cd nwaku-compose
|
|||||||
|
|
||||||
Edit the environment variables present at the beginning of the `docker-compose.yml` file.
|
Edit the environment variables present at the beginning of the `docker-compose.yml` file.
|
||||||
|
|
||||||
Get a node's URL:
|
|
||||||
|
|
||||||
It is required to set the `ETH_CLIENT_ADDRESS` environment variable before starting the instance.
|
It is required to set the `ETH_CLIENT_ADDRESS` environment variable before starting the instance.
|
||||||
|
|
||||||
`ETH_CLIENT_ADDRESS` must be a WebSockets URL for your Ethereum Node.
|
`ETH_CLIENT_ADDRESS` must be a WebSockets URL for your Ethereum Node.
|
||||||
For the current default contract, it must a node for the Sepolia network.
|
For the current default contract, it must be a node for the Sepolia network.
|
||||||
In case you're not running your own node, you can get it from [Infura](https://www.infura.io/)
|
In case you're not running your own node, you can get it from [Infura](https://www.infura.io/)
|
||||||
|
|
||||||
You can set the environment variable from inside the `docker-compose.yml` file or you can simply run
|
|
||||||
|
|
||||||
```console
|
|
||||||
export ETH_CLIENT_ADDRESS=<your_eth_client_address_here>
|
|
||||||
```
|
|
||||||
|
|
||||||
Start everything: `nwaku`, `postgres`, `prometheus`, and `grafana`.
|
Start everything: `nwaku`, `postgres`, `prometheus`, and `grafana`.
|
||||||
```console
|
```console
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
|
|||||||
@ -6,6 +6,13 @@ x-logging: &logging
|
|||||||
max-size: 1000m
|
max-size: 1000m
|
||||||
|
|
||||||
# Environment variable definitions
|
# Environment variable definitions
|
||||||
|
x-eth-client-address: ð_client_address ${ETH_CLIENT_ADDRESS:-} # Add your ETH_CLIENT_ADDRESS after the "-"
|
||||||
|
|
||||||
|
x-rln-environment: &rln_env
|
||||||
|
RLN_RELAY_CONTRACT_ADDRESS: ${RLN_RELAY_CONTRACT_ADDRESS:-0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4}
|
||||||
|
RLN_RELAY_CRED_PATH: ${RLN_RELAY_CRED_PATH:-} # Optional: Add your RLN_RELAY_CRED_PATH after the "-"
|
||||||
|
RLN_RELAY_CRED_PASSWORD: ${RLN_RELAY_CRED_PASSWORD:-} # Optional: Add your RLN_RELAY_CRED_PASSWORD after the "-"
|
||||||
|
|
||||||
x-pg-pass: &pg_pass ${POSTGRES_PASSWORD:-test123}
|
x-pg-pass: &pg_pass ${POSTGRES_PASSWORD:-test123}
|
||||||
x-pg-user: &pg_user ${POSTGRES_USER:-postgres}
|
x-pg-user: &pg_user ${POSTGRES_USER:-postgres}
|
||||||
|
|
||||||
@ -57,10 +64,10 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
DOMAIN: ${DOMAIN}
|
DOMAIN: ${DOMAIN}
|
||||||
NODEKEY: ${NODEKEY}
|
NODEKEY: ${NODEKEY}
|
||||||
RLN_RELAY_CONTRACT_ADDRESS: ${RLN_RELAY_CONTRACT_ADDRESS:-0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4}
|
ETH_CLIENT_ADDRESS: *eth_client_address
|
||||||
ETH_CLIENT_ADDRESS: ${ETH_CLIENT_ADDRESS}
|
|
||||||
EXTRA_ARGS: ${EXTRA_ARGS}
|
EXTRA_ARGS: ${EXTRA_ARGS}
|
||||||
<<: *pg_env
|
<<: *pg_env
|
||||||
|
<<: *rln_env
|
||||||
volumes:
|
volumes:
|
||||||
- ./run_node.sh:/opt/run_node.sh:Z
|
- ./run_node.sh:/opt/run_node.sh:Z
|
||||||
- ./certs:/etc/letsencrypt/:Z
|
- ./certs:/etc/letsencrypt/:Z
|
||||||
|
|||||||
14
run_node.sh
14
run_node.sh
@ -3,7 +3,7 @@
|
|||||||
echo "I am a nwaku node"
|
echo "I am a nwaku node"
|
||||||
|
|
||||||
if [ -z "${ETH_CLIENT_ADDRESS}" ]; then
|
if [ -z "${ETH_CLIENT_ADDRESS}" ]; then
|
||||||
echo -e "Missing Eth client address, please refer to README.md for detailed instructions"
|
echo "Missing Eth client address, please refer to README.md for detailed instructions"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -42,10 +42,18 @@ if [ -n "${DOMAIN}" ]; then
|
|||||||
DNS_WSS_CMD="${WS_SUPPORT} ${WSS_SUPPORT} ${WSS_CERT} ${WSS_KEY} ${DNS4_DOMAIN}"
|
DNS_WSS_CMD="${WS_SUPPORT} ${WSS_SUPPORT} ${WSS_CERT} ${WSS_KEY} ${DNS4_DOMAIN}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${NODEKEY}" != "" ]; then
|
if [ -n "${NODEKEY}" ]; then
|
||||||
NODEKEY=--nodekey=${NODEKEY}
|
NODEKEY=--nodekey=${NODEKEY}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${RLN_RELAY_CRED_PATH}" ]; then
|
||||||
|
RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then
|
||||||
|
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password=${RLN_RELAY_CRED_PASSWORD}
|
||||||
|
fi
|
||||||
|
|
||||||
exec /usr/bin/wakunode\
|
exec /usr/bin/wakunode\
|
||||||
--relay=true\
|
--relay=true\
|
||||||
--topic=/waku/2/default-waku/proto\
|
--topic=/waku/2/default-waku/proto\
|
||||||
@ -81,5 +89,7 @@ exec /usr/bin/wakunode\
|
|||||||
--rln-relay-tree-path="/etc/rln_tree"\
|
--rln-relay-tree-path="/etc/rln_tree"\
|
||||||
${DNS_WSS_CMD}\
|
${DNS_WSS_CMD}\
|
||||||
${NODEKEY}\
|
${NODEKEY}\
|
||||||
|
${RLN_RELAY_CRED_PATH}\
|
||||||
|
${RLN_RELAY_CRED_PASSWORD}\
|
||||||
${EXTRA_ARGS}
|
${EXTRA_ARGS}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user