quic: remove experimental status and add it to the default config
@RubenKelevra committed
May 22, 2020 at 03:48 UTC
2dc1f691f1bb98cadd7e7867cb924ce69f126751
14 files changed
+23
-58
Dockerfile
+2
@@ -73,6 +73,8 @@ COPY --from=0 /usr/lib/*-linux-gnu*/libcrypto.so* /usr/lib/
73
74
# Swarm TCP; should be exposed to the public
75
EXPOSE 4001
76
+# Swarm UDP; should be exposed to the public
77
+EXPOSE 4001/udp
78
# Daemon API; must not be exposed publicly but to client services under you control
79
EXPOSE 5001
80
# Web Gateway; can be exposed publicly with a proxy, e.g. as https://ipfs.example.org
README.md
+4
-4
@@ -344,7 +344,7 @@ IPFS files that will persist when you restart the container.
344
345
Start a container running ipfs and expose ports 4001, 5001 and 8080:
346
347
- docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
347
+ docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
348
349
Watch the ipfs log:
350
@@ -376,16 +376,16 @@ Stop the running container:
376
377
When starting a container running ipfs for the first time with an empty data directory, it will call `ipfs init` to initialize configuration files and generate a new keypair. At this time, you can choose which profile to apply using the `IPFS_PROFILE` environment variable:
378
379
- docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
379
+ docker run -d --name ipfs_host -e IPFS_PROFILE=server -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
380
381
It is possible to initialize the container with a swarm key file (`/data/ipfs/swarm.key`) using the variables `IPFS_SWARM_KEY` and `IPFS_SWARM_KEY_FILE`. The `IPFS_SWARM_KEY` creates `swarm.key` with the contents of the variable itself, whilst `IPFS_SWARM_KEY_FILE` copies the key from a path stored in the variable. The `IPFS_SWARM_KEY_FILE` **overwrites** the key generated by `IPFS_SWARM_KEY`.
382
383
- docker run -d --name ipfs_host -e IPFS_SWARM_KEY=<your swarm key> -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
383
+ docker run -d --name ipfs_host -e IPFS_SWARM_KEY=<your swarm key> -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
384
385
The swarm key initialization can also be done using docker secrets **(requires docker swarm or docker-compose)**:
386
387
cat your_swarm.key | docker secret create swarm_key_secret -
388
- docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
388
+ docker run -d --name ipfs_host --secret swarm_key_secret -e IPFS_SWARM_KEY_FILE=/run/secrets/swarm_key_secret -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 4001:4001/udp -p 127.0.0.1:8080:8080 -p 127.0.0.1:5001:5001 ipfs/go-ipfs:latest
389
390
### Troubleshooting
391
core/core_test.go
+2
-2
@@ -20,7 +20,7 @@ func TestInitialization(t *testing.T) {
20
{
21
Identity: id,
22
Addresses: config.Addresses{
23
- Swarm: []string{"/ip4/0.0.0.0/tcp/4001"},
23
+ Swarm: []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"},
24
API: []string{"/ip4/127.0.0.1/tcp/8000"},
25
},
26
},
@@ -28,7 +28,7 @@ func TestInitialization(t *testing.T) {
28
{
29
Identity: id,
30
Addresses: config.Addresses{
31
- Swarm: []string{"/ip4/0.0.0.0/tcp/4001"},
31
+ Swarm: []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"},
32
API: []string{"/ip4/127.0.0.1/tcp/8000"},
33
},
34
},
core/node/builder.go
+1
-1
@@ -140,7 +140,7 @@ func defaultRepo(dstore repo.Datastore) (repo.Repo, error) {
140
}
141
142
c.Bootstrap = cfg.DefaultBootstrapAddresses
143
- c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001"}
143
+ c.Addresses.Swarm = []string{"/ip4/0.0.0.0/tcp/4001", "/ip4/0.0.0.0/udp/4001/quic"}
144
c.Identity.PeerID = pid.Pretty()
145
c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb)
146
core/node/groups.go
-1
@@ -130,7 +130,6 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option {
130
maybeProvide(libp2p.BandwidthCounter, !cfg.Swarm.DisableBandwidthMetrics),
131
maybeProvide(libp2p.NatPortMap, !cfg.Swarm.DisableNatPortMap),
132
maybeProvide(libp2p.AutoRelay, cfg.Swarm.EnableAutoRelay),
133
- maybeProvide(libp2p.QUIC, cfg.Experimental.QUIC),
133
autonat,
134
connmgr,
135
ps,
core/node/libp2p/transport.go
+1
-1
@@ -8,7 +8,7 @@ import (
8
tls "github.com/libp2p/go-libp2p-tls"
9
)
10
11
-var DefaultTransports = simpleOpt(libp2p.DefaultTransports)
11
+var DefaultTransports = simpleOpt(libp2p.ChainOptions(libp2p.DefaultTransports, libp2p.Transport(libp2pquic.NewTransport)))
12
var QUIC = simpleOpt(libp2p.Transport(libp2pquic.NewTransport))
13
14
func Security(enabled bool) interface{} {
docs/config.md
+3
-1
@@ -200,7 +200,9 @@ Default:
200
```json
201
[
202
"/ip4/0.0.0.0/tcp/4001",
203
- "/ip6/::/tcp/4001"
203
+ "/ip6/::/tcp/4001",
204
+ "/ip6/0.0.0.0/udp/4001/quic",
205
+ "/ip6/::/udp/4001/quic"
206
]
207
```
208
docs/examples/go-ipfs-as-a-library/main.go
+5
@@ -300,12 +300,17 @@ func main() {
300
301
// IPFS Cluster Pinning nodes
302
"/ip4/138.201.67.219/tcp/4001/p2p/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA",
303
+ "/ip4/138.201.67.219/udp/4001/quic/p2p/QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA",
304
"/ip4/138.201.67.220/tcp/4001/p2p/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i",
305
+ "/ip4/138.201.67.220/udp/4001/quic/p2p/QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i",
306
"/ip4/138.201.68.74/tcp/4001/p2p/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR",
307
+ "/ip4/138.201.68.74/udp/4001/quic/p2p/QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR",
308
"/ip4/94.130.135.167/tcp/4001/p2p/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE",
309
+ "/ip4/94.130.135.167/udp/4001/quic/p2p/QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE",
310
311
// You can add more nodes here, for example, another IPFS node you might have running locally, mine was:
312
// "/ip4/127.0.0.1/tcp/4010/p2p/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L",
313
+ // "/ip4/127.0.0.1/udp/4010/quic/p2p/QmZp2fhDLxjYue2RiUvLwT9MWdnbDxam32qYFnGmxZDh5L",
314
}
315
316
go connectToPeers(ctx, ipfs, bootstrapNodes)
docs/examples/library-experimental-features/README.md
-2
@@ -56,8 +56,6 @@ func createTempRepo(ctx context.Context) (string, error) {
56
cfg.Experimental.Libp2pStreamMounting = true
57
// https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#p2p-http-proxy
58
cfg.Experimental.P2pHttpProxy = true
59
- // https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#quic
60
- cfg.Experimental.QUIC = true
59
// https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#strategic-providing
60
cfg.Experimental.StrategicProviding = true
61
docs/experimental-features.md
-30
@@ -22,7 +22,6 @@ the above issue.
22
- [Plugins](#plugins)
23
- [Directory Sharding / HAMT](#directory-sharding--hamt)
24
- [IPNS PubSub](#ipns-pubsub)
25
-- [QUIC](#quic)
25
- [AutoRelay](#autorelay)
26
- [Strategic Providing](#strategic-providing)
27
- [Graphsync](#graphsync)
@@ -463,35 +462,6 @@ run your daemon with the `--enable-namesys-pubsub` flag; enables pubsub.
462
- [ ] Needs more people to use and report on how well it works
463
- [ ] Pubsub enabled as a real feature
464
466
-## QUIC
467
-
468
-### In Version
469
-
470
-0.4.18
471
-
472
-### State
473
-
474
-Candidate, disabled by default but it will be enabled by default in 0.6.0.
475
-
476
-### How to enable
477
-
478
-Modify your ipfs config:
479
-
480
-```
481
-ipfs config --json Experimental.QUIC true
482
-```
483
-
484
-For listening on a QUIC address, add it to the swarm addresses, e.g. `/ip4/0.0.0.0/udp/4001/quic`.
485
-
486
-
487
-### Road to being a real feature
488
-
489
-- [ ] The IETF QUIC specification needs to be finalized.
490
-- [ ] Make sure QUIC connections work reliably
491
-- [ ] Make sure QUIC connection offer equal or better performance than TCP connections on real-world networks
492
-- [ ] Finalize libp2p-TLS handshake spec.
493
-
494
-
465
## AutoRelay
466
467
### In Version
docs/file-transfer.md
+5
@@ -46,7 +46,9 @@ addresses (like the example below), then your nodes are online.
46
"PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb6znj3LQZKP1+X81exf+vbnqNCMtHjZ5RKTCm7Fytnfe+AI1fhs9YbZdkgFkM1HLxmIOLQj2bMXPIGxUM+EnewN8tWurx4B3+lR/LWNwNYcCFL+jF2ltc6SE6BC8kMLEZd4zidOLPZ8lIRpd0x3qmsjhGefuRwrKeKlR4tQ3C76ziOms47uLdiVVkl5LyJ5+mn4rXOjNKt/oy2O4m1St7X7/yNt8qQgYsPfe/hCOywxCEIHEkqmil+vn7bu4RpAtsUzCcBDoLUIWuU3i6qfytD05hP8Clo+at+l//ctjMxylf3IQ5qyP+yfvazk+WHcsB0tWueEmiU5P2nfUUIR3AgMBAAE=",
47
"Addresses": [
48
"/ip4/127.0.0.1/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8",
49
+ "/ip4/127.0.0.1/udp/4001/quic/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8",
50
"/ip4/192.168.2.131/tcp/4001/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8",
51
+ "/ip4/192.168.2.131/udp/4001/quic/p2p/QmTNwsFkLAed15kQEC1ZJWPfoNbBQnMFojfJKQ9sZj1dk8",
52
],
53
"AgentVersion": "go-ipfs/0.4.11-dev/",
54
"ProtocolVersion": "ipfs/0.1.0"
@@ -90,8 +92,11 @@ Example output of addresses might look something like this:
92
93
```
94
/ip4/127.0.0.1/tcp/4001
95
+/ip4/127.0.0.1/udp/4001/quic
96
/ip4/192.168.2.133/tcp/4001
97
+/ip4/192.168.2.133/udp/4001/quic
98
/ip4/88.157.217.196/tcp/63674
99
+/ip4/88.157.217.196/udp/63674/quic
100
```
101
102
In this case, we can see a localhost (127.0.0.1) address, a LAN address (the
test/sharness/t0125-twonode.sh
-6
@@ -89,12 +89,6 @@ test_expect_success "set up tcp testbed" '
89
iptb testbed create -type localipfs -count 2 -force -init
90
'
91
92
-# Enable quic but don't use it yet.
93
-test_expect_success "enable QUIC experiment" '
94
- ipfsi 0 config --json Experimental.QUIC true &&
95
- ipfsi 1 config --json Experimental.QUIC true
96
-'
97
-
92
# test multiplex muxer
93
echo "Running advanced tests with mplex"
94
export LIBP2P_MUX_PREFS="/mplex/6.7.0"
test/sharness/t0142-testfilter.sh
-5
@@ -21,11 +21,6 @@ test_expect_success 'filter 127.0.0.0/24 on node 1' '
21
'
22
23
for i in $(seq 0 $(( NUM_NODES - 1 ))); do
24
- test_expect_success 'enable quic for node $i' '
25
- echo "$i"
26
- ipfsi $i config --json Experimental.QUIC true
27
- '
28
-
24
test_expect_success "change IP for node $i" '
25
ipfsi $i config --json "Addresses.Swarm" \
26
"[\"/ip4/127.0.$i.1/tcp/0\",\"/ip4/127.0.$i.1/udp/0/quic\",\"/ip4/127.0.$i.1/tcp/0/ws\"]"
test/sharness/t0190-quic-ping.sh
-5
@@ -11,11 +11,6 @@ test_expect_success 'init iptb' '
11
iptb testbed create -type localipfs -count 2 -init
12
'
13
14
-test_expect_success "enable QUIC experiment" '
15
- ipfsi 0 config --json Experimental.QUIC true &&
16
- ipfsi 1 config --json Experimental.QUIC true
17
-'
18
-
14
addr1='"[\"/ip4/127.0.0.1/udp/0/quic/\"]"'
15
addr2='"[\"/ip4/127.0.0.1/udp/0/quic/\"]"'
16
test_expect_success "add QUIC swarm addresses" '