@@ -90,15 +90,21 @@ PYTHONPATH="$VGI_RPC_PYTHON_DIR" \
9090PIDS+=(" $! " )
9191RAW_PORT=" $( wait_for_value " $RUN_DIR /raw-worker.log" ' s/^TCP:127\.0\.0\.1:\([0-9][0-9]*\)$/\1/p' ) "
9292
93- " $VGI_IROH_BRIDGE_BIN " --ephemeral --http-upstream " http://127.0.0.1:$HTTP_PORT " \
93+ # Both endpoints run on this host. Supply their addresses explicitly so this
94+ # qualification does not race public discovery or depend on relay availability.
95+ " $VGI_IROH_BRIDGE_BIN " --ephemeral --no-relay --print-direct-addresses \
96+ --http-upstream " http://127.0.0.1:$HTTP_PORT " \
9497 > " $RUN_DIR /http-bridge.log" 2>&1 &
9598PIDS+=(" $! " )
9699HTTP_ENDPOINT=" $( wait_for_value " $RUN_DIR /http-bridge.log" ' /^[0-9a-f][0-9a-f]*$/p' ) "
100+ HTTP_ADDRESS=" $( wait_for_value " $RUN_DIR /http-bridge.log" ' s/^DIRECT://p' ) "
97101
98- " $VGI_IROH_BRIDGE_BIN " --ephemeral --raw-upstream " tcp://127.0.0.1:$RAW_PORT " \
102+ " $VGI_IROH_BRIDGE_BIN " --ephemeral --no-relay --print-direct-addresses \
103+ --raw-upstream " tcp://127.0.0.1:$RAW_PORT " \
99104 > " $RUN_DIR /raw-bridge.log" 2>&1 &
100105PIDS+=(" $! " )
101106RAW_ENDPOINT=" $( wait_for_value " $RUN_DIR /raw-bridge.log" ' /^[0-9a-f][0-9a-f]*$/p' ) "
107+ RAW_ADDRESS=" $( wait_for_value " $RUN_DIR /raw-bridge.log" ' s/^DIRECT://p' ) "
102108
103109if [[ ${# HTTP_ENDPOINT} -ne 64 || ${# RAW_ENDPOINT} -ne 64 ]]; then
104110 echo " bridge emitted an invalid EndpointId" >&2
108114HTTP_RESULT=" $( $HAYBARN :memory: -csv -noheader -c "
109115SET vgi_iroh_connect_timeout_seconds = 7;
110116SET vgi_iroh_io_timeout_seconds = 19;
111- ATTACH 'example' AS remote_a (TYPE vgi, LOCATION 'httpi://${HTTP_ENDPOINT} ');
117+ ATTACH 'example' AS remote_a (TYPE vgi, LOCATION 'httpi://${HTTP_ENDPOINT} ', IROH_NO_RELAY true, IROH_DIRECT_ADDRESSES [' ${HTTP_ADDRESS} '] );
112118SELECT remote_a.main.double(21);
113119SELECT remote_a.main.whoami(1);
114120SET vgi_iroh_connect_timeout_seconds = 11;
115121SET vgi_iroh_io_timeout_seconds = 23;
116- ATTACH 'example' AS remote_b (TYPE vgi, LOCATION 'httpi://${HTTP_ENDPOINT} ');
122+ ATTACH 'example' AS remote_b (TYPE vgi, LOCATION 'httpi://${HTTP_ENDPOINT} ', IROH_NO_RELAY true, IROH_DIRECT_ADDRESSES [' ${HTTP_ADDRESS} '] );
117123SELECT remote_b.main.whoami(1);
118124" ) "
119125grep -Fxq ' 42' <<< " $HTTP_RESULT"
@@ -126,23 +132,22 @@ if [[ "$(wc -l <<<"$HTTP_PRINCIPALS" | tr -d ' ')" != "2" ]] || \
126132fi
127133
128134RAW_RESULT=" $( $HAYBARN :memory: -csv -noheader -c "
129- ATTACH 'example' AS remote (TYPE vgi, LOCATION 'iroh://${RAW_ENDPOINT} ');
135+ ATTACH 'example' AS remote (TYPE vgi, LOCATION 'iroh://${RAW_ENDPOINT} ', IROH_NO_RELAY true, IROH_DIRECT_ADDRESSES [' ${RAW_ADDRESS} '] );
130136SELECT remote.main.double(21);
131137SELECT sum(i) FROM remote.main.sequence(10000) t(i);
132138" ) "
133139grep -Fxq ' 42' <<< " $RAW_RESULT"
134140grep -Fxq ' 49995000' <<< " $RAW_RESULT"
135141
136- # vgi_catalogs() builds the same default Iroh configuration ATTACH does (no
137- # options: scoped TYPE iroh secret, else an ephemeral identity), so discovery
138- # works over both Iroh transports without an ATTACH. The named iroh_* options
139- # mirror ATTACH's.
142+ # vgi_catalogs() resolves identities the same way ATTACH does (scoped TYPE iroh
143+ # secret, else an ephemeral identity). Exercise both transports without an
144+ # ATTACH, including relay options with an explicit direct destination.
140145CATALOGS_RESULT=" $( $HAYBARN :memory: -csv -noheader -c "
141- SELECT 'raw', catalog FROM vgi_catalogs('iroh://${RAW_ENDPOINT} ');
142- SELECT 'http', catalog FROM vgi_catalogs('httpi://${HTTP_ENDPOINT} ');
143- SELECT 'http_opts', catalog FROM vgi_catalogs('httpi://${HTTP_ENDPOINT} ', iroh_no_relay := false, iroh_relay_urls := []);
146+ SELECT 'raw', catalog FROM vgi_catalogs('iroh://${RAW_ENDPOINT} ', iroh_no_relay := true, iroh_direct_addresses := [' ${RAW_ADDRESS} '] );
147+ SELECT 'http', catalog FROM vgi_catalogs('httpi://${HTTP_ENDPOINT} ', iroh_no_relay := true, iroh_direct_addresses := [' ${HTTP_ADDRESS} '] );
148+ SELECT 'http_opts', catalog FROM vgi_catalogs('httpi://${HTTP_ENDPOINT} ', iroh_no_relay := false, iroh_relay_urls := [], iroh_direct_addresses := [' ${HTTP_ADDRESS} '] );
144149CREATE SECRET iroh_raw (TYPE iroh, SCOPE 'iroh://${RAW_ENDPOINT} ', SECRET_KEY '$( printf ' %064x' 7) ');
145- SELECT 'raw_secret', catalog FROM vgi_catalogs('iroh://${RAW_ENDPOINT} ');
150+ SELECT 'raw_secret', catalog FROM vgi_catalogs('iroh://${RAW_ENDPOINT} ', iroh_no_relay := true, iroh_direct_addresses := [' ${RAW_ADDRESS} '] );
146151" ) "
147152for label in raw http http_opts raw_secret; do
148153 if ! grep -Fxq " ${label} ,example" <<< " $CATALOGS_RESULT" ; then
0 commit comments