File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 9
9
"onlyDial" : true
10
10
},
11
11
" webrtc" ,
12
- " webrtc-direct"
12
+ " webrtc-direct" ,
13
+ " quic-v1"
13
14
],
14
15
"secureChannels" : [" noise" , " tls" ],
15
16
"muxers" : [" yamux" , " mplex" ]
Original file line number Diff line number Diff line change 19
19
},
20
20
"devDependencies" : {
21
21
"@chainsafe/libp2p-noise" : " ^16.0.0" ,
22
+ "@chainsafe/libp2p-quic" : " ^1.0.5" ,
22
23
"@chainsafe/libp2p-yamux" : " ^7.0.1" ,
23
24
"@libp2p/circuit-relay-v2" : " ^3.1.3" ,
24
25
"@libp2p/identify" : " ^3.0.12" ,
Original file line number Diff line number Diff line change 1
1
/* eslint-disable complexity */
2
2
3
3
import { noise } from '@chainsafe/libp2p-noise'
4
+ import { quic } from '@chainsafe/libp2p-quic'
4
5
import { yamux } from '@chainsafe/libp2p-yamux'
5
6
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'
6
7
import { identify } from '@libp2p/identify'
@@ -82,6 +83,12 @@ export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
82
83
listen : isDialer ? [ ] : [ `/ip4/${ IP } /tcp/0/wss` ]
83
84
}
84
85
break
86
+ case 'quic-v1' :
87
+ options . transports = [ quic ( ) ]
88
+ options . addresses = {
89
+ listen : isDialer ? [ ] : [ `/ip4/${ IP } /udp/0/quic-v1` ]
90
+ }
91
+ break
85
92
default :
86
93
throw new Error ( `Unknown transport: ${ TRANSPORT ?? '???' } ` )
87
94
}
@@ -91,6 +98,7 @@ export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
91
98
switch ( TRANSPORT ) {
92
99
case 'webtransport' :
93
100
case 'webrtc-direct' :
101
+ case 'quic-v1' :
94
102
skipSecureChannel = true
95
103
skipMuxer = true
96
104
break
You can’t perform that action at this time.
0 commit comments