Skip to content

Commit

Permalink
feat: enable hole-punching by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed May 3, 2022
1 parent 7ccc7f8 commit 4e92f74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ jobs:
command: |
npm init -y
npm install ipfs@^0.61.0
npm install ipfs-interop@^8.0.0
npm install ipfs-interop@^8.0.10
npm install [email protected]
working_directory: ~/ipfs/go-ipfs/interop
- run:
Expand Down
5 changes: 3 additions & 2 deletions core/node/libp2p/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opt

func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error) {
return func() (opts Libp2pOpts, err error) {
if flag.WithDefault(false) {
if flag.WithDefault(true) {
if !hasRelayClient {
log.Fatal("To enable `Swarm.EnableHolePunching` requires `Swarm.RelayClient.Enabled` to be enabled.")
log.Fatal("Failed to enable `Swarm.EnableHolePunching`, it requires `Swarm.RelayClient.Enabled` to be true.")
return
}
opts.Opts = append(opts.Opts, libp2p.EnableHolePunching())
}
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ to [upgrade to a direct connection](https://github.com/libp2p/specs/blob/master/
through a NAT/firewall whenever possible.
This feature requires `Swarm.RelayClient.Enabled` to be set to `true`.

Default: `false`
Default: `true`

Type: `flag`

Expand Down

0 comments on commit 4e92f74

Please sign in to comment.