Skip to content

Commit da95d79

Browse files
add QUIC support
Signed-off-by: Marten Seemann <[email protected]>
1 parent b0d9dfc commit da95d79

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

core/core.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import (
2020
"strings"
2121
"time"
2222

23+
24+
// TODO: use gx
25+
quic "github.com/libp2p/go-libp2p-quic-transport"
26+
2327
rp "github.com/ipfs/go-ipfs/exchange/reprovide"
2428
filestore "github.com/ipfs/go-ipfs/filestore"
2529
mount "github.com/ipfs/go-ipfs/fuse/mount"
@@ -247,6 +251,10 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
247251
libp2pOpts = append(libp2pOpts, libp2p.EnableRelay(opts...))
248252
}
249253

254+
if cfg.Experimental.QUIC {
255+
libp2pOpts = append(libp2pOpts, libp2p.Transport(quic.NewTransport))
256+
}
257+
250258
peerhost, err := hostOption(ctx, n.Identity, n.Peerstore, libp2pOpts...)
251259

252260
if err != nil {

docs/experimental-features.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,5 +425,34 @@ run your daemon with the `--enable-namesys-pubsub` flag; enables pubsub.
425425

426426
- [ ] Needs more people to use and report on how well it works
427427
- [ ] Add a mechanism for last record distribution on subscription,
428-
so that we don't have to hit the DHT for the initial resolution.
429-
Alternatively, we could republish the last record periodically.
428+
so that we don't have to hit the DHT for the initial resolution.
429+
Alternatively, we could republish the last record periodically.
430+
431+
432+
433+
## QUIC
434+
435+
### In Version
436+
437+
0.4.18
438+
439+
### State
440+
441+
Experiment, disabled by default
442+
443+
### How to enable
444+
445+
Modify your ipfs config:
446+
447+
```
448+
ipfs config --json Experimental.QUIC true
449+
```
450+
451+
For listening on a QUIC address, add it the swarm addresses, e.g. `/ip4/0.0.0.0/udp/4001/quic`.
452+
453+
454+
### Road to being a real feature
455+
456+
- [ ] The IETF QUIC specification needs to be finalised.
457+
- [ ] Make sure QUIC connections work reliably
458+
- [ ] Make sure QUIC connection offer equal or better performance than TCP connections on real world networks

repo/config/experiments.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ type Experiments struct {
55
UrlstoreEnabled bool
66
ShardingEnabled bool
77
Libp2pStreamMounting bool
8+
QUIC bool
89
}

0 commit comments

Comments
 (0)