Skip to content

Commit 295a78b

Browse files
committed
test: add new setting to services configuration
1 parent d07134a commit 295a78b

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

contrib/indexer-service/start.sh

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,43 @@ cat /opt/.env
1010

1111
# Extract GraphTallyCollector address from horizon.json
1212
stdbuf -oL echo "🔍 DEBUG: Extracting GraphTallyCollector address from horizon.json..."
13-
GRAPH_TALLY_VERIFIER=$(jq -r '."1337".GraphTallyCollector.address' /opt/horizon.json)
14-
stdbuf -oL echo "🔍 DEBUG: GraphTallyCollector address: $GRAPH_TALLY_VERIFIER"
1513

16-
TAP_VERIFIER=$(jq -r '."1337".TAPVerifier.address' /opt/contracts.json)
17-
stdbuf -oL echo "🔍 DEBUG: TAPVerifier address: $TAP_VERIFIER"
14+
subgraph_service=$(jq -r '."1337".SubgraphService.address' /opt/subgraph-service.json)
15+
16+
# Handle mixed format - try with .address first, fallback to direct value
17+
graph_tally_verifier=$(jq -r '."1337".GraphTallyCollector.address // ."1337".GraphTallyCollector' /opt/horizon.json)
18+
stdbuf -oL echo "🔍 DEBUG: GraphTallyCollector address: $graph_tally_verifier"
19+
20+
# For your indexer-agent script, update the extraction:
21+
tap_verifier=$(jq -r '."1337".TAPVerifier' /opt/contracts.json)
22+
stdbuf -oL echo "🔍 DEBUG: TAPVerifier address: $tap_verifier"
23+
24+
allocation_id_tracker=$(jq -c '."1337".AllocationIDTracker' /opt/contracts.json)
25+
escrow=$(jq -c '."1337".Escrow' /opt/contracts.json)
1826

1927
# Override with test values taken from test-assets/src/lib.rs
2028
ALLOCATION_ID="0xfa44c72b753a66591f241c7dc04e8178c30e13af" # ALLOCATION_ID_0
2129

2230
# Get network subgraph deployment ID
2331
stdbuf -oL echo "🔍 DEBUG: Fetching network subgraph deployment ID..."
24-
NETWORK_DEPLOYMENT=$(curl -s --max-time 10 "http://graph-node:8000/subgraphs/name/graph-network" \
32+
network_deployment=$(curl -s --max-time 10 "http://graph-node:8000/subgraphs/name/graph-network" \
2533
-H 'content-type: application/json' \
2634
-d '{"query": "{ _meta { deployment } }"}' | jq -r '.data._meta.deployment' 2>/dev/null)
27-
stdbuf -oL echo "🔍 DEBUG: Network deployment result: $NETWORK_DEPLOYMENT"
35+
stdbuf -oL echo "🔍 DEBUG: Network deployment result: $network_deployment"
2836

2937
# Get escrow subgraph deployment ID
3038
stdbuf -oL echo "🔍 DEBUG: Fetching escrow subgraph deployment ID..."
31-
ESCROW_DEPLOYMENT=$(curl -s --max-time 10 "http://graph-node:8000/subgraphs/name/semiotic/tap" \
39+
escrow_deployment=$(curl -s --max-time 10 "http://graph-node:8000/subgraphs/name/semiotic/tap" \
3240
-H 'content-type: application/json' \
3341
-d '{"query": "{ _meta { deployment } }"}' | jq -r '.data._meta.deployment' 2>/dev/null)
34-
stdbuf -oL echo "🔍 DEBUG: Escrow deployment result: $ESCROW_DEPLOYMENT"
42+
stdbuf -oL echo "🔍 DEBUG: Escrow deployment result: $escrow_deployment"
3543

3644
# Run basic connectivity tests
3745
stdbuf -oL echo "Testing graph-node endpoints..."
3846
curl -s "http://graph-node:8000" >/dev/null && stdbuf -oL echo "Query endpoint OK" || stdbuf -oL echo "Query endpoint FAILED"
3947
curl -s "http://graph-node:8030/graphql" >/dev/null && stdbuf -oL echo "Status endpoint OK" || stdbuf -oL echo "Status endpoint FAILED"
4048

41-
stdbuf -oL echo "Using GraphTallyCollector address: $GRAPH_TALLY_VERIFIER"
49+
stdbuf -oL echo "Using GraphTallyCollector address: $graph_tally_verifier"
4250
stdbuf -oL echo "Using test Indexer address: $RECEIVER_ADDRESS"
4351
stdbuf -oL echo "Using test Account0 address: $ACCOUNT0_ADDRESS"
4452

@@ -56,20 +64,20 @@ query_url = "http://graph-node:8000"
5664
status_url = "http://graph-node:8030/graphql"
5765
5866
[subgraphs.network]
59-
query_url = "http://graph-node:8000/subgraphs/name/graph-network"$(if [ -n "$NETWORK_DEPLOYMENT" ] && [ "$NETWORK_DEPLOYMENT" != "null" ]; then echo "
60-
deployment_id = \"$NETWORK_DEPLOYMENT\""; fi)
67+
query_url = "http://graph-node:8000/subgraphs/name/graph-network"$(if [ -n "$network_deployment" ] && [ "$network_deployment" != "null" ]; then echo "
68+
deployment_id = \"$network_deployment\""; fi)
6169
recently_closed_allocation_buffer_secs = 60
6270
syncing_interval_secs = 30
6371
6472
[subgraphs.escrow]
65-
query_url = "http://graph-node:8000/subgraphs/name/semiotic/tap"$(if [ -n "$ESCROW_DEPLOYMENT" ] && [ "$ESCROW_DEPLOYMENT" != "null" ]; then echo "
66-
deployment_id = \"$ESCROW_DEPLOYMENT\""; fi)
73+
query_url = "http://graph-node:8000/subgraphs/name/semiotic/tap"$(if [ -n "$escrow_deployment" ] && [ "$escrow_deployment" != "null" ]; then echo "
74+
deployment_id = \"$escrow_deployment\""; fi)
6775
syncing_interval_secs = 30
6876
6977
[blockchain]
7078
chain_id = 1337
71-
receipts_verifier_address = "${TAP_VERIFIER}"
72-
receipts_verifier_address_v2 ="${GRAPH_TALLY_VERIFIER}"
79+
receipts_verifier_address = "${tap_verifier}"
80+
receipts_verifier_address_v2 ="${graph_tally_verifier}"
7381
7482
[service]
7583
free_query_auth_token = "freestuff"
@@ -108,6 +116,7 @@ ${ACCOUNT0_ADDRESS} = "http://tap-aggregator:${TAP_AGGREGATOR}"
108116
# - If Horizon contracts not detected: Remain in legacy mode (V1 receipts only)
109117
# When disabled: Pure legacy mode, no Horizon detection performed
110118
enabled = true
119+
subgraph_service_address = "${subgraph_service}"
111120
EOF
112121

113122
stdbuf -oL echo "Starting indexer-service with config:"

contrib/tap-agent/start.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ cat /opt/.env
1212
# Extract GraphTallyCollector address from horizon.json
1313
stdbuf -oL echo "🔍 DEBUG: Extracting GraphTallyCollector address from horizon.json..."
1414

15-
GRAPH_TALLY_VERIFIER=$(jq -r '."1337".GraphTallyCollector.address' /opt/horizon.json)
16-
stdbuf -oL echo "🔍 DEBUG: GraphTallyCollector address: $GRAPH_TALLY_VERIFIER"
15+
subgraph_service=$(jq -r '."1337".SubgraphService.address' /opt/subgraph-service.json)
16+
graph_tally_verifier=$(jq -r '."1337".GraphTallyCollector.address // ."1337".GraphTallyCollector' /opt/horizon.json)
17+
stdbuf -oL echo "🔍 DEBUG: GraphTallyCollector address: $graph_tally_verifier"
1718

19+
# For your indexer-agent script, update the extraction:
1820
stdbuf -oL echo "🔍 DEBUG: Extracting TAP address from contracts.json..."
19-
TAP_VERIFIER=$(jq -r '."1337".TAPVerifier.address' /opt/contracts.json)
20-
stdbuf -oL echo "🔍 DEBUG: TAPVerifier address: $TAP_VERIFIER"
21+
tap_verifier=$(jq -r '."1337".TAPVerifier' /opt/contracts.json)
22+
stdbuf -oL echo "🔍 DEBUG: TAPVerifier address: $tap_verifier"
2123

2224
# Override with test values taken from test-assets/src/lib.rs
2325
ALLOCATION_ID="0xfa44c72b753a66591f241c7dc04e8178c30e13af" # ALLOCATION_ID_0
@@ -89,7 +91,7 @@ fi
8991

9092
stdbuf -oL echo "🔍 DEBUG: Escrow subgraph deployment ID: $ESCROW_DEPLOYMENT"
9193

92-
stdbuf -oL echo "🔍 DEBUG: Using GraphTallyCollector address: $GRAPH_TALLY_VERIFIER"
94+
stdbuf -oL echo "🔍 DEBUG: Using GraphTallyCollector address: $graph_tally_verifier"
9395
stdbuf -oL echo "🔍 DEBUG: Using Indexer address: $RECEIVER_ADDRESS"
9496
stdbuf -oL echo "🔍 DEBUG: Using Account0 address: $ACCOUNT0_ADDRESS"
9597

@@ -125,8 +127,8 @@ syncing_interval_secs = 30
125127
126128
[blockchain]
127129
chain_id = 1337
128-
receipts_verifier_address = "${TAP_VERIFIER}"
129-
receipts_verifier_address_v2 = "${GRAPH_TALLY_VERIFIER}"
130+
receipts_verifier_address = "${tap_verifier}"
131+
receipts_verifier_address_v2 = "${graph_tally_verifier}"
130132
131133
[service]
132134
host_and_port = "0.0.0.0:${INDEXER_SERVICE}"
@@ -164,6 +166,7 @@ ${ACCOUNT0_ADDRESS} = "http://tap-aggregator:${TAP_AGGREGATOR}"
164166
# - If Horizon contracts not detected: Remain in legacy mode (V1 receipts only)
165167
# When disabled: Pure legacy mode, no Horizon detection performed
166168
enabled = true
169+
subgraph_service_address = "${subgraph_service}"
167170
EOF
168171

169172
stdbuf -oL echo "Starting tap-agent with config:"

0 commit comments

Comments
 (0)