Skip to content

Commit 4afe9d7

Browse files
committed
fix: F8 stage 5 — call delivery_module start after createNode (node never bound, so no multiaddr was ever logged; cf. linux-full flow) + subscribe both agents to the discovery topic before stage 6
1 parent d799d93 commit 4afe9d7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/demo-f8-testnet.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ st "STAGE 4: set agent A per_tx_limit=50 (so a 5 LEZ pay is autonomous, an 80 is
8282

8383
st "STAGE 5: local Waku — two delivery nodes, B statically connects to A"
8484
"$LC" --config-dir ~/cfgA call delivery_module createNode '{"logLevel":"ERROR","mode":"Core","relay":true,"clusterId":16,"numShardsInNetwork":8,"tcpPort":60010,"discv5UdpPort":60011,"restPort":60012,"metricsServerPort":60013,"websocketPort":60014}' >~/nodeA.log 2>&1
85-
# the multiaddr is logged by the daemon, not returned by the RPC — poll daemonA.log (cf. demo-f8-linux-full.sh)
85+
"$LC" --config-dir ~/cfgA call delivery_module start >/dev/null 2>&1; sleep 6
86+
# the node logs its multiaddr only after `start`, into the RUNNING daemon's stdout log
87+
# (boot() restarts once, so the live log is the newest ~/daemonA*.log — cf. demo-f8-linux-full.sh:126)
8688
APID=""
87-
for k in $(seq 1 15); do APID=$(grep -oE '/p2p/16Uiu2[A-Za-z0-9]+' ~/daemonA.log 2>/dev/null | head -1 | sed 's#/p2p/##'); [ -n "$APID" ] && break; sleep 2; done
89+
for k in $(seq 1 15); do APID=$(grep -ohE '/p2p/16Uiu2[A-Za-z0-9]+' $(ls -t ~/daemonA*.log 2>/dev/null) 2>/dev/null | head -1 | sed 's#/p2p/##'); [ -n "$APID" ] && break; sleep 2; done
8890
say "agent A waku peer id: ${APID:-NONE}"
89-
[ -n "$APID" ] || { say "STAGE5_FAIL: no waku peer id in daemonA.log"; }
91+
[ -n "$APID" ] || { say "STAGE5_FAIL: no waku peer id in daemonA logs"; }
9092
"$LC" --config-dir ~/cfgB call delivery_module createNode "{\"logLevel\":\"ERROR\",\"mode\":\"Core\",\"relay\":true,\"clusterId\":16,\"numShardsInNetwork\":8,\"tcpPort\":60020,\"discv5UdpPort\":60021,\"restPort\":60022,\"metricsServerPort\":60023,\"websocketPort\":60024,\"staticnodes\":[\"/ip4/127.0.0.1/tcp/60010/p2p/$APID\"]}" >~/nodeB.log 2>&1
91-
sleep 6
93+
"$LC" --config-dir ~/cfgB call delivery_module start >/dev/null 2>&1; sleep 8
94+
"$LC" --config-dir ~/cfgA call delivery_module subscribe "$TOPIC" >/dev/null 2>&1
95+
"$LC" --config-dir ~/cfgB call delivery_module subscribe "$TOPIC" >/dev/null 2>&1; sleep 8
9296

9397
st "STAGE 6: agents discover each other (F8)"
9498
PC=0

0 commit comments

Comments
 (0)