-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I’ve been adding circuit-relay-server to the libp2p config:
https://github.com/orbitdb/voyager/blob/main/src/utils/libp2p-config.js
The goal was to enable browsers to connect to Voyager so they could discover each other and connect via WebRTC, using a direct connection upgrade with dcutr(). This might be very useful, when consumers running there own Voyager instance on their desktop or self hosted.
This normally simple config change, unfortunately, didn’t work in the end. No reservations could be made by the browsers — as if the circuit-relay was disabled. I initially suspected package incompatibilities, but I found that the exact same config and packages worked fine on a separate relay node.
This led me to suspect that the Voyager protocol might be interfering with the circuit-relay transport service. I started commenting out everything below line 70 in daemon.js:
https://github.com/orbitdb/voyager/blob/main/src/daemon.js#L70
Suddenly, the circuit-relay server started working as expected — it made reservations for two browsers, allowing them to discover and connect to each other. Unfortunately, even in this modified state, dcutr() still didn’t function properly. The two browser nodes disconnected after a 2-minute upgrade timeout.
For now, I’ll have to pause work on this, but I wanted to document it here.