Skip to content

Commit 907518b

Browse files
authored
test: add @chainsafe/libp2p-quic to interop suite (#3044)
Tests the experimental quic transport from @chainsafe/libp2p-quic
1 parent a7ab9a4 commit 907518b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

interop/node-version.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"onlyDial": true
1010
},
1111
"webrtc",
12-
"webrtc-direct"
12+
"webrtc-direct",
13+
"quic-v1"
1314
],
1415
"secureChannels": ["noise", "tls"],
1516
"muxers": ["yamux", "mplex"]

interop/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"@chainsafe/libp2p-noise": "^16.0.0",
22+
"@chainsafe/libp2p-quic": "^1.0.5",
2223
"@chainsafe/libp2p-yamux": "^7.0.1",
2324
"@libp2p/circuit-relay-v2": "^3.1.3",
2425
"@libp2p/identify": "^3.0.12",

interop/test/fixtures/get-libp2p.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable complexity */
22

33
import { noise } from '@chainsafe/libp2p-noise'
4+
import { quic } from '@chainsafe/libp2p-quic'
45
import { yamux } from '@chainsafe/libp2p-yamux'
56
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'
67
import { identify } from '@libp2p/identify'
@@ -82,6 +83,12 @@ export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
8283
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/wss`]
8384
}
8485
break
86+
case 'quic-v1':
87+
options.transports = [quic()]
88+
options.addresses = {
89+
listen: isDialer ? [] : [`/ip4/${IP}/udp/0/quic-v1`]
90+
}
91+
break
8592
default:
8693
throw new Error(`Unknown transport: ${TRANSPORT ?? '???'}`)
8794
}
@@ -91,6 +98,7 @@ export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
9198
switch (TRANSPORT) {
9299
case 'webtransport':
93100
case 'webrtc-direct':
101+
case 'quic-v1':
94102
skipSecureChannel = true
95103
skipMuxer = true
96104
break

0 commit comments

Comments
 (0)