Skip to content

Commit 90d10b5

Browse files
deps(dev): bump @libp2p/interop from 11.0.0 to 12.1.0 (#2582)
* deps(dev): bump @libp2p/interop from 11.0.0 to 12.1.0 Bumps [@libp2p/interop](https://github.com/libp2p/interop) from 11.0.0 to 12.1.0. - [Release notes](https://github.com/libp2p/interop/releases) - [Changelog](https://github.com/libp2p/interop/blob/main/CHANGELOG.md) - [Commits](libp2p/interop@v11.0.0...v12.1.0) --- updated-dependencies: - dependency-name: "@libp2p/interop" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: configure addresses --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <alex@achingbrain.net>
1 parent 62e3225 commit 90d10b5

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

packages/integration-tests/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@libp2p/interface": "^1.3.1",
5050
"@libp2p/interface-compliance-tests": "^5.4.4",
5151
"@libp2p/interface-internal": "^1.2.1",
52-
"@libp2p/interop": "^11.0.0",
52+
"@libp2p/interop": "^12.1.0",
5353
"@libp2p/kad-dht": "^12.0.16",
5454
"@libp2p/logger": "^4.0.12",
5555
"@libp2p/mdns": "^10.0.23",

packages/integration-tests/test/interop.ts

+23-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createClient } from '@libp2p/daemon-client'
88
import { createServer } from '@libp2p/daemon-server'
99
import { floodsub } from '@libp2p/floodsub'
1010
import { identify } from '@libp2p/identify'
11-
import { interopTests } from '@libp2p/interop'
11+
import { UnsupportedError, interopTests } from '@libp2p/interop'
1212
import { kadDHT, passthroughMapper } from '@libp2p/kad-dht'
1313
import { logger } from '@libp2p/logger'
1414
import { mplex } from '@libp2p/mplex'
@@ -46,7 +46,15 @@ async function createGoPeer (options: SpawnOptions): Promise<Daemon> {
4646
if (options.noListen === true) {
4747
opts.push('-noListenAddrs')
4848
} else {
49-
opts.push('-hostAddrs=/ip4/127.0.0.1/tcp/0')
49+
if (options.transport == null || options.transport === 'tcp') {
50+
opts.push('-hostAddrs=/ip4/127.0.0.1/tcp/0')
51+
} else if (options.transport === 'webtransport') {
52+
opts.push('-hostAddrs=/ip4/127.0.0.1/udp/0/quic-v1/webtransport')
53+
} else if (options.transport === 'webrtc-direct') {
54+
opts.push('-hostAddrs=/ip4/127.0.0.1/udp/0/webrtc-direct')
55+
} else {
56+
throw new UnsupportedError()
57+
}
5058
}
5159

5260
if (options.encryption != null) {
@@ -122,7 +130,7 @@ async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
122130
const opts: Libp2pOptions<ServiceMap> = {
123131
peerId,
124132
addresses: {
125-
listen: options.noListen === true ? [] : ['/ip4/127.0.0.1/tcp/0']
133+
listen: []
126134
},
127135
transports: [tcp(), circuitRelayTransport()],
128136
streamMuxers: [],
@@ -132,6 +140,18 @@ async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
132140
}
133141
}
134142

143+
if (options.noListen !== true) {
144+
if (options.transport == null || options.transport === 'tcp') {
145+
opts.addresses?.listen?.push('/ip4/127.0.0.1/tcp/0')
146+
} else {
147+
throw new UnsupportedError()
148+
}
149+
}
150+
151+
if (options.transport === 'webtransport' || options.transport === 'webrtc-direct') {
152+
throw new UnsupportedError()
153+
}
154+
135155
const services: ServiceFactoryMap = {
136156
identify: identify()
137157
}

0 commit comments

Comments
 (0)