diff --git a/.env.example b/.env.example index d15dc4f..afb6987 100644 --- a/.env.example +++ b/.env.example @@ -15,4 +15,5 @@ NWAKU_IMAGE= NODEKEY= DOMAIN= EXTRA_ARGS= -RLN_RELAY_CONTRACT_ADDRESS= \ No newline at end of file +RLN_RELAY_CONTRACT_ADDRESS= +STORAGE_SIZE= \ No newline at end of file diff --git a/ADVANCED.md b/ADVANCED.md index 1956e87..ffa1ed4 100644 --- a/ADVANCED.md +++ b/ADVANCED.md @@ -15,6 +15,7 @@ There are multiple environment variables you can configure to modify behaviour o * `RLN_RELAY_CRED_PASSWORD` - password for encrypting RLN credentials * `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`) * `CERTS_DIR` - allows you to define a path where SSL certificates are/will be stored. It needs to follow the directory structure produced by Certbot in `/etc/letsencrypt` +* `STORATE_SIZE` - overrides the default allowed DB size of waku message storage service. Current default is 1GB. (e.g. `STORAGE_SIZE=2GB` or `STORAGE_SIZE=3500MB`) ## Log monitoring and troubleshooting diff --git a/docker-compose.yml b/docker-compose.yml index 14a734f..c77543f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,7 @@ services: RLN_RELAY_CRED_PASSWORD: "${RLN_RELAY_CRED_PASSWORD}" ETH_CLIENT_ADDRESS: *eth_client_address EXTRA_ARGS: ${EXTRA_ARGS} + STORAGE_SIZE: ${STORAGE_SIZE} <<: - *pg_env - *rln_env diff --git a/run_node.sh b/run_node.sh index bd05181..0bebe2d 100644 --- a/run_node.sh +++ b/run_node.sh @@ -46,7 +46,6 @@ if [ -n "${NODEKEY}" ]; then NODEKEY=--nodekey=${NODEKEY} fi - RLN_RELAY_CRED_PATH=--rln-relay-cred-path=${RLN_RELAY_CRED_PATH:-/keystore/keystore.json} @@ -54,6 +53,12 @@ if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password="${RLN_RELAY_CRED_PASSWORD}" fi +STORE_RETENTION_POLICY=--store-message-retention-policy=size:1GB} + +if [ -n "${STORAGE_SIZE}" ]; then + STORE_RETENTION_POLICY=--store-message-retention-policy=size:"${STORAGE_SIZE}" +fi + exec /usr/bin/wakunode\ --relay=true\ --pubsub-topic=/waku/2/rs/1/0\ @@ -88,7 +93,6 @@ exec /usr/bin/wakunode\ --nat=extip:"${MY_EXT_IP}"\ --store=true\ --store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/postgres"\ - --store-message-retention-policy=time:86400\ --rln-relay=true\ --rln-relay-dynamic=true\ --rln-relay-eth-contract-address="${RLN_RELAY_CONTRACT_ADDRESS}"\ @@ -98,5 +102,6 @@ exec /usr/bin/wakunode\ ${RLN_RELAY_CRED_PASSWORD}\ ${DNS_WSS_CMD}\ ${NODEKEY}\ + ${STORE_RETENTION_POLICY}\ ${EXTRA_ARGS}