logos-messaging-test-query/docker/run_nwaku_store_sqlite_ubuntu.sh
Ivan Folgueira Bande 8e3ed8aa7e Connecting nodes with bootstrap node and adding go-waku store clients
One "go-waku" relay node is responsible for generating
traffic, which in turns creates "insert" events. And another
go-waku node that acts as a store client to generate "store"
requests to both "sqlite" and "postgres" nwaku store nodes.
2023-10-23 22:43:21 +02:00

52 lines
1.4 KiB
Bash

#!/bin/sh
apt-get update
## Install the `dig` command
apt-get install dnsutils -y
apt-get install wget -y
bootstrap_IP=$(dig +short bootstrap)
apt-get install libpq5 -y
chmod +x /usr/bin/wakunode
RETRIES=${RETRIES:=10}
while [ -z "${BOOTSTRAP_ENR}" ] && [ ${RETRIES} -ge 0 ]; do
BOOTSTRAP_ENR=$(wget -O - --post-data='{"jsonrpc":"2.0","method":"get_waku_v2_debug_v1_info","params":[],"id":1}' --header='Content-Type:application/json' http://${bootstrap_IP}:8544/ 2> /dev/null | sed 's/.*"enrUri":"\([^"]*\)".*/\1/');
echo "Bootstrap node not ready in ${bootstrap_IP}, 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
IP=$(hostname -I)
echo "I am sqlite ubuntu. Listening on: ${IP}"
./usr/bin/wakunode\
--relay=true\
--topic=/waku/2/default-waku/proto\
--topic=/waku/2/dev-waku/proto\
--rpc-admin=true\
--keep-alive=true\
--log-level=DEBUG\
--rpc-port=8546\
--rpc-address=0.0.0.0\
--metrics-server=True\
--metrics-server-port=8004\
--metrics-server-address=0.0.0.0\
--max-connections=250\
--dns-discovery=true\
--discv5-discovery=true\
--discv5-enr-auto-update=True\
--discv5-bootstrap-node=${BOOTSTRAP_ENR}\
--nat=extip:${IP}\
--store-message-db-url="sqlite:///data/store.sqlite3"\
--store=true\
--store-message-retention-policy=capacity:4000000