This commit is contained in:
stubbsta 2024-12-03 09:15:46 +02:00
parent 0a599c186d
commit 159c21c7dd
No known key found for this signature in database
6 changed files with 324 additions and 190 deletions

View File

@ -12,45 +12,45 @@ services:
# Accounts are hardcoded to 520 with the idea that nwaku nodes use up to 500 for membership registration and the last 20 are used for ad-hoc testing. # Accounts are hardcoded to 520 with the idea that nwaku nodes use up to 500 for membership registration and the last 20 are used for ad-hoc testing.
# The account number and private key pairs of the last 20 accounts can be found in the Register memberships section of the Waku-simulator book. # The account number and private key pairs of the last 20 accounts can be found in the Register memberships section of the Waku-simulator book.
# foundry: foundry:
# image: ghcr.io/foundry-rs/foundry:nightly-9b73e06e1fe376738b92ae081107620291d50188 image: ghcr.io/foundry-rs/foundry:nightly-9b73e06e1fe376738b92ae081107620291d50188
# labels: labels:
# com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# ports: ports:
# - 0.0.0.0:8545:8545 - 0.0.0.0:8545:8545
# command: command:
# - anvil - anvil
# --port=8545 --port=8545
# --host=0.0.0.0 --host=0.0.0.0
# --accounts=520 --accounts=520
# --allow-origin=* --allow-origin=*
# --block-time=3 --block-time=3
# --chain-id=1234 --chain-id=1234
# --silent --silent
# --config-out=/shared/anvil-config.txt --config-out=/shared/anvil-config.txt
# volumes: volumes:
# - privatekeys-volume:/shared - privatekeys-volume:/shared
# networks: networks:
# - simulation - simulation
# contract-repo-deployer: contract-repo-deployer:
# image: node:hydrogen-bullseye image: node:hydrogen-bullseye
# labels: labels:
# com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# environment: environment:
# - PRIVATE_KEY=${PRIVATE_KEY} - PRIVATE_KEY=${PRIVATE_KEY}
# - RPC_URL=${RPC_URL:-http://foundry:8545} - RPC_URL=${RPC_URL:-http://foundry:8545}
# - ETH_FROM=${ETH_FROM} - ETH_FROM=${ETH_FROM}
# - MAX_MESSAGE_LIMIT=${MAX_MESSAGE_LIMIT:-20} - MAX_MESSAGE_LIMIT=${MAX_MESSAGE_LIMIT:-20}
# entrypoint: sh entrypoint: sh
# command: command:
# - '/opt/deploy_rln_contract.sh' - '/opt/deploy_rln_contract.sh'
# volumes: volumes:
# - ./deploy_rln_contract.sh:/opt/deploy_rln_contract.sh - ./deploy_rln_contract.sh:/opt/deploy_rln_contract.sh
# depends_on: depends_on:
# - foundry - foundry
# networks: networks:
# - simulation - simulation
bootstrap: bootstrap:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
@ -80,77 +80,72 @@ services:
replicas: ${NUM_NWAKU_NODES:-5} replicas: ${NUM_NWAKU_NODES:-5}
entrypoint: sh entrypoint: sh
command: command:
- '/opt/run_nwaku_noRLN.sh' - '/opt/run_nwaku.sh'
volumes: volumes:
- ./run_nwaku_noRLN.sh:/opt/run_nwaku_noRLN.sh:Z - ./run_nwaku_noRLN.sh:/opt/run_nwaku.sh:Z
depends_on: depends_on:
- bootstrap - bootstrap
networks: networks:
- simulation - simulation
nwaku_store_pg1: # nwaku_store_pg1:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} # image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure # restart: on-failure
labels: # labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' # com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# ports: # entrypoint: sh
# - 127.0.0.1:60001:60001 # environment:
entrypoint: sh # - POSTGRES_USER=${POSTGRES_USER:-postgres}
environment: # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
- POSTGRES_USER=${POSTGRES_USER:-postgres} # - WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600}
- WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300} # command:
- WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600} # - '/opt/run_nwaku_store_postgres1.sh'
command: # volumes:
- '/opt/run_nwaku_store_postgres1.sh' # - ./run_nwaku_store_postgres1.sh:/opt/run_nwaku_store_postgres1.sh:Z
volumes: # depends_on:
- ./run_nwaku_store_postgres1.sh:/opt/run_nwaku_store_postgres1.sh:Z # postgres1:
depends_on: # condition: service_healthy
postgres1: # networks:
condition: service_healthy # simulation:
networks: # ipv4_address: 10.2.0.100
simulation:
ipv4_address: 10.2.0.100
nwaku_store_pg2:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} # nwaku_store_pg2:
restart: on-failure # image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
labels: # restart: on-failure
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' # labels:
# ports: # com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# - 127.0.0.1:60002:60002 # entrypoint: sh
entrypoint: sh # environment:
environment: # - POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_USER=${POSTGRES_USER:-postgres} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300}
- WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300} # - WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600}
- WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600} # command: ["-c", "sleep 30 && /opt/run_nwaku_store_postgres2.sh"]
command: # volumes:
- '/opt/run_nwaku_store_postgres2.sh' # - ./run_nwaku_store_postgres2.sh:/opt/run_nwaku_store_postgres2.sh:Z
volumes: # depends_on:
- ./run_nwaku_store_postgres2.sh:/opt/run_nwaku_store_postgres2.sh:Z # nwaku_store_pg1:
depends_on: # condition: service_started
nwaku_store_pg1: # postgres2:
condition: service_started # condition: service_healthy
postgres2: # networks:
condition: service_healthy # simulation:
networks: # ipv4_address: 10.2.0.101
simulation:
ipv4_address: 10.2.0.101
# nwaku_store_pg3: # nwaku_store_pg3:
# image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest} # image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
# restart: on-failure # restart: on-failure
# labels: # labels:
# com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}' # com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# ports:
# - 127.0.0.1:60003:60003
# entrypoint: sh # entrypoint: sh
# environment: # environment:
# - POSTGRES_USER=${POSTGRES_USER:-postgres} # - POSTGRES_USER=${POSTGRES_USER:-postgres}
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
# command: # - WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300}
# - '/opt/run_nwaku_store_postgres3.sh' # - WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600}
# command: ["-c", "sleep 60 && /opt/run_nwaku_store_postgres3.sh"]
# volumes: # volumes:
# - ./run_nwaku_store_postgres3.sh:/opt/run_nwaku_store_postgres3.sh:Z # - ./run_nwaku_store_postgres3.sh:/opt/run_nwaku_store_postgres3.sh:Z
# depends_on: # depends_on:
@ -162,6 +157,29 @@ services:
# simulation: # simulation:
# ipv4_address: 10.2.0.102 # ipv4_address: 10.2.0.102
# nwaku_store_pg4:
# image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
# restart: on-failure
# labels:
# com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
# entrypoint: sh
# environment:
# - POSTGRES_USER=${POSTGRES_USER:-postgres}
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
# - WAKU_SYNC_INTERVAL=${WAKU_SYNC_INTERVAL:-300}
# - WAKU_SYNC_RANGE=${WAKU_SYNC_RANGE:-3600}
# command: ["-c", "sleep 85 && /opt/run_nwaku_store_postgres4.sh"]
# volumes:
# - ./run_nwaku_store_postgres4.sh:/opt/run_nwaku_store_postgres4.sh:Z
# depends_on:
# nwaku_store_pg1:
# condition: service_started
# postgres4:
# condition: service_healthy
# networks:
# simulation:
# ipv4_address: 10.2.0.103
# rest-traffic: # rest-traffic:
# image: alrevuelta/rest-traffic:6992bb5 # image: alrevuelta/rest-traffic:6992bb5
# command: # command:
@ -175,99 +193,123 @@ services:
# depends_on: # depends_on:
# - nwaku # - nwaku
postgres1: # postgres1:
# This service is used when the Waku node has the 'store' protocol enabled # # This service is used when the Waku node has the 'store' protocol enabled
# and the store-message-db-url is set to use Postgres # # and the store-message-db-url is set to use Postgres
image: postgres:15.4-alpine3.18 # image: postgres:15.4-alpine3.18
restart: on-failure:5 # restart: on-failure:5
environment: # environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres} # - POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
volumes: # volumes:
- ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z # - ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z # - ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ${PG_DATA_DIR:-./postgresql1}:/var/lib/postgresql/data:Z # - ${PG_DATA_DIR:-./postgresql1}:/var/lib/postgresql/data:Z
command: postgres -c config_file=/etc/postgresql/postgresql.conf # command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports: # ports:
- 0.0.0.0:5432:5432 # - 0.0.0.0:5432:5432
networks: # networks:
- simulation # - simulation
healthcheck: # healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] # test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 30s # interval: 30s
timeout: 60s # timeout: 60s
retries: 5 # retries: 5
start_period: 80s # start_period: 80s
postgres2: # postgres2:
# This service is used when the Waku node has the 'store' protocol enabled # # This service is used when the Waku node has the 'store' protocol enabled
# and the store-message-db-url is set to use Postgres # # and the store-message-db-url is set to use Postgres
image: postgres:15.4-alpine3.18 # image: postgres:15.4-alpine3.18
restart: on-failure:5 # restart: on-failure:5
environment: # environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres} # - POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
volumes: # volumes:
- ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z # - ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z # - ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ${PG_DATA_DIR:-./postgresql2}:/var/lib/postgresql/data:Z # - ${PG_DATA_DIR:-./postgresql2}:/var/lib/postgresql/data:Z
command: postgres -c config_file=/etc/postgresql/postgresql.conf # command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports: # ports:
- 0.0.0.0:5433:5432 # - 0.0.0.0:5433:5432
networks: # networks:
- simulation # - simulation
healthcheck: # healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] # test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 30s # interval: 30s
timeout: 60s # timeout: 60s
retries: 5 # retries: 5
start_period: 80s # start_period: 80s
postgres3: # postgres3:
# This service is used when the Waku node has the 'store' protocol enabled # # This service is used when the Waku node has the 'store' protocol enabled
# and the store-message-db-url is set to use Postgres # # and the store-message-db-url is set to use Postgres
image: postgres:15.4-alpine3.18 # image: postgres:15.4-alpine3.18
restart: on-failure:5 # restart: on-failure:5
environment: # environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres} # - POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
volumes: # volumes:
- ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z # - ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z
- ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z # - ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ${PG_DATA_DIR:-./postgresql3}:/var/lib/postgresql/data:Z # - ${PG_DATA_DIR:-./postgresql3}:/var/lib/postgresql/data:Z
command: postgres -c config_file=/etc/postgresql/postgresql.conf # command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports: # ports:
- 0.0.0.0:5434:5432 # - 0.0.0.0:5434:5432
networks: # networks:
- simulation # - simulation
healthcheck: # healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] # test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 30s # interval: 30s
timeout: 60s # timeout: 60s
retries: 5 # retries: 5
start_period: 80s # start_period: 100s
postgres-exporter: # postgres4:
# Service aimed to scrape information from Postgres and post it to Prometeus # # This service is used when the Waku node has the 'store' protocol enabled
image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0 # # and the store-message-db-url is set to use Postgres
restart: on-failure:5 # image: postgres:15.4-alpine3.18
environment: # restart: on-failure:5
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123} # environment:
- DATA_SOURCE_URI=postgres1:5432/postgres?sslmode=disable # - POSTGRES_USER=${POSTGRES_USER:-postgres}
- DATA_SOURCE_USER=${POSTGRES_USER:-postgres} # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
- DATA_SOURCE_PASS=${POSTGRES_PASSWORD:-test123} # volumes:
- PG_EXPORTER_EXTEND_QUERY_PATH=/etc/pgexporter/queries.yml # - ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf:Z
volumes: # - ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql:Z
- ./monitoring/configuration/postgres-exporter.yml:/etc/pgexporter/postgres-exporter.yml:Z # - ${PG_DATA_DIR:-./postgresql4}:/var/lib/postgresql/data:Z
- ./monitoring/configuration/pg-exporter-queries.yml:/etc/pgexporter/queries.yml:Z # command: postgres -c config_file=/etc/postgresql/postgresql.conf
command: # ports:
# Both the config file and 'DATA_SOURCE_NAME' should contain valid connection info # - 0.0.0.0:5435:5432
- --config.file=/etc/pgexporter/postgres-exporter.yml # networks:
depends_on: # - simulation
postgres1: # healthcheck:
condition: service_healthy # test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
networks: # interval: 30s
- simulation # timeout: 60s
# retries: 5
# start_period: 80s
# postgres-exporter:
# # Service aimed to scrape information from Postgres and post it to Prometeus
# image: quay.io/prometheuscommunity/postgres-exporter:v0.12.0
# restart: on-failure:5
# environment:
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-test123}
# - DATA_SOURCE_URI=postgres1:5432/postgres?sslmode=disable
# - DATA_SOURCE_USER=${POSTGRES_USER:-postgres}
# - DATA_SOURCE_PASS=${POSTGRES_PASSWORD:-test123}
# - PG_EXPORTER_EXTEND_QUERY_PATH=/etc/pgexporter/queries.yml
# volumes:
# - ./monitoring/configuration/postgres-exporter.yml:/etc/pgexporter/postgres-exporter.yml:Z
# - ./monitoring/configuration/pg-exporter-queries.yml:/etc/pgexporter/queries.yml:Z
# command:
# # Both the config file and 'DATA_SOURCE_NAME' should contain valid connection info
# - --config.file=/etc/pgexporter/postgres-exporter.yml
# depends_on:
# postgres1:
# condition: service_healthy
# networks:
# - simulation
prometheus: prometheus:
image: prom/prometheus:latest image: prom/prometheus:latest

View File

@ -20,9 +20,11 @@ scrape_configs:
- waku-simulator_nwaku_store_pg1_1:8008 - waku-simulator_nwaku_store_pg1_1:8008
- waku-simulator_nwaku_store_pg2_1:8008 - waku-simulator_nwaku_store_pg2_1:8008
- waku-simulator_nwaku_store_pg3_1:8011 - waku-simulator_nwaku_store_pg3_1:8011
- waku-simulator_nwaku_store_pg4_1:8011
- waku-simulator_postgres1_1:8008 - waku-simulator_postgres1_1:8008
- waku-simulator_postgres2_1:8008 - waku-simulator_postgres2_1:8008
- waku-simulator_postgres3_1:8008 - waku-simulator_postgres3_1:8008
- waku-simulator_postgres4_1:8008
- waku-simulator_nwaku_1:8008 - waku-simulator_nwaku_1:8008
- waku-simulator_nwaku_2:8008 - waku-simulator_nwaku_2:8008
- waku-simulator_nwaku_3:8008 - waku-simulator_nwaku_3:8008

View File

@ -38,10 +38,9 @@ exec /usr/bin/wakunode\
--ports-shift=0\ --ports-shift=0\
--nat=extip:${IP}\ --nat=extip:${IP}\
--store=true\ --store=true\
--store-message-retention-policy=size:1Gb\ --store-message-retention-policy=size:40MB\
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres1:5432/postgres"\ --store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres1:5432/postgres"\
--store-sync=true\ --store-sync=true\
--store-sync-interval=300\ --store-sync-interval=${WAKU_SYNC_INTERVAL}\
--store-sync-range=3600\ --store-sync-range=${WAKU_SYNC_RANGE}\
--store-sync-relay-jitter=0\
--nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942daa1 --nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942daa1

View File

@ -37,11 +37,10 @@ exec /usr/bin/wakunode\
--cluster-id=16\ --cluster-id=16\
--ports-shift=0\ --ports-shift=0\
--store=true\ --store=true\
--store-message-retention-policy=size:1GB\ --store-message-retention-policy=size:40MB\
--nat=extip:${IP}\ --nat=extip:${IP}\
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres2:5432/postgres"\ --store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres2:5432/postgres"\
--store-sync=true\ --store-sync=true\
--store-sync-interval=300\ --store-sync-interval=${WAKU_SYNC_INTERVAL}\
--store-sync-range=3600\ --store-sync-range=${WAKU_SYNC_RANGE}\
--store-sync-relay-jitter=0\
--nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942daa3 --nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942daa3

View File

@ -0,0 +1,46 @@
#!/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\
--relay=false\
--lightpush=true\
--max-connections=50\
--rest=true\
--rest-address=0.0.0.0\
--rest-port=8645\
--dns-discovery=true\
--discv5-discovery=true\
--discv5-enr-auto-update=True\
--log-level=TRACE\
--metrics-server=True\
--metrics-server-address=0.0.0.0\
--discv5-bootstrap-node=${BOOTSTRAP_ENR}\
--pubsub-topic=/waku/2/rs/16/32\
--cluster-id=16\
--ports-shift=3\
--store=true\
--store-message-retention-policy=size:40MB\
--nat=extip:${IP}\
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres3:5432/postgres"\
--store-sync=true\
--store-sync-interval=${WAKU_SYNC_INTERVAL}\
--store-sync-range=${WAKU_SYNC_RANGE}\
--nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942da5b

View File

@ -0,0 +1,46 @@
#!/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\
--relay=true\
--lightpush=true\
--max-connections=50\
--rest=true\
--rest-address=0.0.0.0\
--rest-port=8645\
--dns-discovery=true\
--discv5-discovery=true\
--discv5-enr-auto-update=True\
--log-level=TRACE\
--metrics-server=True\
--metrics-server-address=0.0.0.0\
--discv5-bootstrap-node=${BOOTSTRAP_ENR}\
--pubsub-topic=/waku/2/rs/16/32\
--cluster-id=16\
--ports-shift=3\
--store=true\
--store-message-retention-policy=size:40MB\
--nat=extip:${IP}\
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres3:5432/postgres"\
--store-sync=true\
--store-sync-interval=${WAKU_SYNC_INTERVAL}\
--store-sync-range=${WAKU_SYNC_RANGE}\
--nodekey=5978783f8b1a16795032371fff7a526af352d9dca38179af7d71c0122942aa5b