From 164a019d693956f63bfb91a1ac6719754a370fa7 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Fri, 5 May 2023 10:27:26 +0530 Subject: [PATCH] Use provided domain for relay multiaddr in peer config --- app/data/config/watcher-mobymask-v2/start-server.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/data/config/watcher-mobymask-v2/start-server.sh b/app/data/config/watcher-mobymask-v2/start-server.sh index fe263ec4..9ab11fb9 100755 --- a/app/data/config/watcher-mobymask-v2/start-server.sh +++ b/app/data/config/watcher-mobymask-v2/start-server.sh @@ -15,7 +15,13 @@ CERC_DEPLOYED_CONTRACT="${CERC_DEPLOYED_CONTRACT:-${DEFAULT_CERC_DEPLOYED_CONTRA echo "Using L2 RPC endpoint ${CERC_L2_GETH_RPC}" -CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /app/peers/relay-id.json)" +# Use public domain for relay multiaddr in peer config if specified +# Otherwise, use the docker container's host IP +if [ -n "$CERC_RELAY_ANNOUNCE_DOMAIN" ]; then + CERC_RELAY_MULTIADDR="/dns4/${CERC_RELAY_ANNOUNCE_DOMAIN}/tcp/443/wss/p2p/$(jq -r '.id' /app/peers/relay-id.json)" +else + CERC_RELAY_MULTIADDR="/dns4/mobymask-watcher-server/tcp/9090/ws/p2p/$(jq -r '.id' /app/peers/relay-id.json)" +fi # Use contract address from environment variable or set from config.json in mounted volume if [ -n "$CERC_DEPLOYED_CONTRACT" ]; then