feat: enable hole-punching by default
Adin Schmahmann committed
May 3, 2022 at 10:10 UTC
7ad6447453856f8a92bdd01fb02dbc9e8038e98c
3 files changed
+5
-4
.circleci/main.yml
+1
-1
@@ -245,7 +245,7 @@ jobs:
245
command: |
246
npm init -y
247
npm install ipfs@^0.61.0
248
- npm install ipfs-interop@^8.0.0
248
+ npm install ipfs-interop@^8.0.10
249
npm install mocha-circleci-reporter@0.0.3
250
working_directory: ~/ipfs/go-ipfs/interop
251
- run:
core/node/libp2p/relay.go
+3
-2
@@ -69,9 +69,10 @@ func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opt
69
70
func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error) {
71
return func() (opts Libp2pOpts, err error) {
72
- if flag.WithDefault(false) {
72
+ if flag.WithDefault(true) {
73
if !hasRelayClient {
74
- log.Fatal("To enable `Swarm.EnableHolePunching` requires `Swarm.RelayClient.Enabled` to be enabled.")
74
+ log.Fatal("Failed to enable `Swarm.EnableHolePunching`, it requires `Swarm.RelayClient.Enabled` to be true.")
75
+ return
76
}
77
opts.Opts = append(opts.Opts, libp2p.EnableHolePunching())
78
}
docs/config.md
+1
-1
@@ -1383,7 +1383,7 @@ to [upgrade to a direct connection](https://github.com/libp2p/specs/blob/master/
1383
through a NAT/firewall whenever possible.
1384
This feature requires `Swarm.RelayClient.Enabled` to be set to `true`.
1385
1386
-Default: `false`
1386
+Default: `true`
1387
1388
Type: `flag`
1389