Skip to content

Commit 4e92f74

Browse files
committed
feat: enable hole-punching by default
1 parent 7ccc7f8 commit 4e92f74

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.circleci/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ jobs:
245245
command: |
246246
npm init -y
247247
npm install ipfs@^0.61.0
248-
npm install ipfs-interop@^8.0.0
248+
npm install ipfs-interop@^8.0.10
249249
npm install [email protected]
250250
working_directory: ~/ipfs/go-ipfs/interop
251251
- run:

core/node/libp2p/relay.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opt
6969

7070
func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error) {
7171
return func() (opts Libp2pOpts, err error) {
72-
if flag.WithDefault(false) {
72+
if flag.WithDefault(true) {
7373
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
7576
}
7677
opts.Opts = append(opts.Opts, libp2p.EnableHolePunching())
7778
}

docs/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ to [upgrade to a direct connection](https://github.com/libp2p/specs/blob/master/
13831383
through a NAT/firewall whenever possible.
13841384
This feature requires `Swarm.RelayClient.Enabled` to be set to `true`.
13851385

1386-
Default: `false`
1386+
Default: `true`
13871387

13881388
Type: `flag`
13891389

0 commit comments

Comments
 (0)