fix(webRTC): Upgrading to new package, adding required config

This commit is contained in:
Chris Troutner
2024-08-29 11:00:07 -07:00
parent fe91f4b875
commit f311a3b9c6
3 changed files with 271 additions and 302 deletions
+261 -282
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -34,7 +34,7 @@
"@libp2p/keychain": "4.1.5",
"@libp2p/logger": "4.0.20",
"@libp2p/tcp": "9.1.5",
"@libp2p/webrtc": "4.0.34",
"@libp2p/webrtc": "4.1.7",
"@libp2p/websockets": "8.2.0",
"@multiformats/multiaddr": "12.3.0",
"axios": "0.27.2",
+9 -19
View File
@@ -175,25 +175,15 @@ class IpfsAdapter {
console.log('Helia (IPFS) node IS NOT configured as Circuit Relay')
}
// Configure transports
let transports
if (process.env.CONNECT_PREF === 'direct') {
transports = [
tcp(),
webSockets(),
webRTC()
]
} else {
transports = [
tcp(),
webSockets(),
circuitRelayTransport({
discoverRelays: 3,
reservationConcurrency: 3
}),
webRTC()
]
}
const transports = [
tcp(),
webSockets(),
circuitRelayTransport({
discoverRelays: 3,
reservationConcurrency: 3
}),
webRTC()
]
// libp2p is the networking layer that underpins Helia
const libp2p = await this.createLibp2p({