logos-messaging-simulator/run_nwaku_store_postgres2.sh

46 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2024-07-08 11:56:11 +02:00
#!/bin/sh
IP=$(ip a | grep "inet " | grep -Fv 127.0.0.1 | sed 's/.*inet \([^/]*\).*/\1/')
echo "I am a nwaku store node"
RETRIES=${RETRIES:=10}
while [ -z "${BOOTSTRAP_ENR}" ] && [ ${RETRIES} -ge 0 ]; do
BOOTSTRAP_ENR=$(wget -qO- http://bootstrap:8645/debug/v1/info --header='Content-Type:application/json' 2> /dev/null | sed 's/.*"enrUri":"\([^"]*\)".*/\1/');
echo "Bootstrap node not ready, retrying (retries left: ${RETRIES})"
sleep 1
RETRIES=$(( $RETRIES - 1 ))
done
if [ -z "${BOOTSTRAP_ENR}" ]; then
echo "Could not get BOOTSTRAP_ENR and none provided. Failing"
exit 1
fi
echo "Using bootstrap node: ${BOOTSTRAP_ENR}"
exec /usr/bin/wakunode\
2024-10-22 12:45:05 +02:00
--relay=false\
--lightpush=true\
2024-10-01 10:19:35 +02:00
--max-connections=50\
2024-07-08 11:56:11 +02:00
--rest=true\
--rest-address=0.0.0.0\
--rest-port=8645\
--dns-discovery=true\
--discv5-discovery=true\
--discv5-enr-auto-update=True\
2024-10-22 12:45:05 +02:00
--log-level=TRACE\
2024-07-08 11:56:11 +02:00
--metrics-server=True\
--metrics-server-address=0.0.0.0\
--discv5-bootstrap-node=${BOOTSTRAP_ENR}\
2024-10-01 10:19:35 +02:00
--pubsub-topic=/waku/2/rs/16/32\
--cluster-id=16\
2024-10-22 12:45:05 +02:00
--ports-shift=0\
2024-07-08 11:56:11 +02:00
--store=true\
2024-12-03 09:15:46 +02:00
--store-message-retention-policy=size:40MB\
2024-10-08 13:35:34 +02:00
--nat=extip:${IP}\
2024-10-01 10:19:35 +02:00
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres2:5432/postgres"\
--store-sync=true\
2024-12-03 09:15:46 +02:00
--store-sync-interval=${WAKU_SYNC_INTERVAL}\
--store-sync-range=${WAKU_SYNC_RANGE}\
2024-10-01 10:19:35 +02:00
--nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942daa3