2025-08-26 20:40:11 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Docker entrypoint script for waku-browser-tests
|
|
|
|
|
# Handles CLI arguments and converts them to environment variables
|
2025-09-03 22:34:58 -07:00
|
|
|
# Supports reading discovered addresses from /etc/addrs/addrs.env (10k sim pattern)
|
|
|
|
|
|
|
|
|
|
# Check if address file exists and source it
|
|
|
|
|
if [ -f "/etc/addrs/addrs.env" ]; then
|
|
|
|
|
echo "Sourcing discovered addresses from /etc/addrs/addrs.env"
|
|
|
|
|
source /etc/addrs/addrs.env
|
|
|
|
|
if [ -n "$addrs1" ]; then
|
|
|
|
|
export WAKU_LIGHTPUSH_NODE="$addrs1"
|
|
|
|
|
echo "Using discovered lightpush node: $WAKU_LIGHTPUSH_NODE"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2025-08-26 20:40:11 -07:00
|
|
|
|
|
|
|
|
# Parse command line arguments
|
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
|
case $1 in
|
|
|
|
|
--cluster-id=*)
|
|
|
|
|
export WAKU_CLUSTER_ID="${1#*=}"
|
|
|
|
|
echo "Setting WAKU_CLUSTER_ID=${WAKU_CLUSTER_ID}"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
--shard=*)
|
|
|
|
|
export WAKU_SHARD="${1#*=}"
|
|
|
|
|
echo "Setting WAKU_SHARD=${WAKU_SHARD}"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2025-09-03 22:34:58 -07:00
|
|
|
--lightpushnode=*)
|
|
|
|
|
export WAKU_LIGHTPUSH_NODE="${1#*=}"
|
|
|
|
|
echo "Setting WAKU_LIGHTPUSH_NODE=${WAKU_LIGHTPUSH_NODE}"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2025-09-04 19:24:43 -07:00
|
|
|
--enr-bootstrap=*)
|
|
|
|
|
export WAKU_ENR_BOOTSTRAP="${1#*=}"
|
|
|
|
|
echo "Setting WAKU_ENR_BOOTSTRAP=${WAKU_ENR_BOOTSTRAP}"
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2025-08-26 20:40:11 -07:00
|
|
|
*)
|
|
|
|
|
# Unknown argument, keep it for the main command
|
|
|
|
|
break
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# If no specific command is provided, use the default CMD
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
|
set -- "npm" "run" "start:server"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Execute the main command
|
|
|
|
|
exec "$@"
|