feat: enable hole-punching by default

This commit is contained in:
Adin Schmahmann 2022-05-03 10:10:13 -04:00
parent be1acfa1c5
commit 7ad6447453
3 changed files with 5 additions and 4 deletions

View File

@ -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 mocha-circleci-reporter@0.0.3
working_directory: ~/ipfs/go-ipfs/interop
- run:

View File

@ -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())
}

View File

@ -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`