2023-04-06 09:47:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2023-04-11 10:51:03 +00:00
|
|
|
CERC_RELAY_NODES="${CERC_RELAY_NODES:-${DEFAULT_CERC_RELAY_NODES}}"
|
|
|
|
|
2023-04-12 12:47:13 +00:00
|
|
|
# If not set (or []), check the mounted volume for relay peer id
|
|
|
|
if [ -z "$CERC_RELAY_NODES" ] || [ "$CERC_RELAY_NODES" = "[]" ]; then
|
|
|
|
echo "CERC_RELAY_NODES not provided, taking from the mounted volume"
|
|
|
|
CERC_RELAY_NODES="[\"/ip4/127.0.0.1/tcp/9090/ws/p2p/$(jq -r '.id' /peers/relay-id.json)\"]"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Using CERC_RELAY_NODES $CERC_RELAY_NODES"
|
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
# Use yq to create config.yml with environment variables
|
|
|
|
yq -n ".relayNodes = strenv(CERC_RELAY_NODES)" > /config/config.yml
|
2023-04-06 09:47:00 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
/scripts/start-serving-app.sh
|