A QUIC transport for libp2p
A libp2p transport based on the QUIC networking stack.
import { createLibp2p } from 'libp2p'
import { quic } from '@chainsafe/libp2p-quic'
import { multiaddr } from '@multiformats/multiaddr'
const node = await createLibp2p({
transports: [
quic()
]
})
const ma = multiaddr('/ip4/123.123.123.123/udp/1234/quic-v1')
// dial a TCP connection, timing out after 10 seconds
const connection = await node.dial(ma, {
signal: AbortSignal.timeout(10_000)
})
// use connection...
$ npm i @chainsafe/libp2p-quic