@@ -77,6 +77,9 @@ fund_escrow() {
7777 GRAPH_TOKEN=$( jq -r ' ."1337".L2GraphToken.address' local-network/horizon.json)
7878 TAP_ESCROW=$( jq -r ' ."1337".Escrow' local-network/tap-contracts.json)
7979
80+ # Override with test values taken from test-assets/src/lib.rs
81+ ALLOCATION_ID=" 0xfa44c72b753a66591f241c7dc04e8178c30e13af" # ALLOCATION_ID_0
82+
8083 if [ -z " $GRAPH_TOKEN " ] || [ -z " $TAP_ESCROW " ] || [ " $GRAPH_TOKEN " == " null" ] || [ " $TAP_ESCROW " == " null" ]; then
8184 echo " Error: Could not read contract addresses from horizon.json or tap-contracts.json"
8285 echo " GRAPH_TOKEN: $GRAPH_TOKEN "
252255docker compose -f docker-compose.yml -f docker-compose.override.yml up --build -d
253256rm docker-compose.override.yml
254257
255- timeout 30 bash -c ' until docker ps | grep indexer | grep -q healthy; do sleep 5; done'
256- timeout 30 bash -c ' until docker ps | grep tap-agent | grep -q healthy; do sleep 5; done'
258+ # Wait for indexer-service and tap-agent to be healthy with better timeouts
259+ echo " Waiting for indexer-service to be healthy..."
260+ timeout 120 bash -c ' until docker ps | grep indexer-service | grep -q healthy; do echo "Still waiting for indexer-service..."; sleep 5; done'
261+
262+ echo " Waiting for tap-agent to be healthy..."
263+ timeout 120 bash -c ' until docker ps | grep tap-agent | grep -q healthy; do echo "Still waiting for tap-agent..."; sleep 5; done'
264+
265+ # Additional check to ensure services are responding
266+ echo " Verifying indexer-service is responding..."
267+ timeout 60 bash -c ' until curl -f http://localhost:7601/health > /dev/null 2>&1; do echo "Waiting for indexer-service health endpoint..."; sleep 3; done'
268+
269+ echo " Verifying tap-agent is responding..."
270+ timeout 60 bash -c ' until curl -f http://localhost:7300/metrics > /dev/null 2>&1; do echo "Waiting for tap-agent metrics endpoint..."; sleep 3; done'
271+
272+ # Wait for indexer to sync with chain before starting gateway
273+ echo " Checking chain and indexer synchronization..."
274+ sleep 10 # Give indexer time to process initial blocks
257275
258276echo " Building gateway image..."
259277source local-network/.env
@@ -275,6 +293,7 @@ if [ ! -f "local-network/subgraph-service.json" ]; then
275293fi
276294
277295# Updated to use the horizon file structure and include tap-contracts.json
296+ # Gateway now generates config with increased max_lag_seconds in gateway/run.sh
278297docker run -d --name gateway \
279298 --network local-network_default \
280299 -p 7700:7700 \
@@ -324,3 +343,9 @@ echo "Images size: $END_IMAGES_SIZE"
324343echo " Containers size: $END_CONTAINERS_SIZE "
325344echo " Volumes size: $END_VOLUMES_SIZE "
326345echo " ==========================================="
346+
347+ # Optional: Start pgAdmin for database inspection
348+ if [ " $START_PGADMIN " = " true" ]; then
349+ echo " Starting pgAdmin for database inspection..."
350+ ./pg_admin.sh
351+ fi
0 commit comments