fix: dns > ext ip

This commit is contained in:
Richard Ramos 2023-05-15 11:49:51 -04:00
parent 9594e54d36
commit 30b9fac6a7
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760

View File

@ -116,10 +116,6 @@ func Execute(options Options) {
nodeOpts = append(nodeOpts, node.WithAdvertiseAddresses(options.AdvertiseAddresses...))
}
if options.Dns4DomainName != "" {
nodeOpts = append(nodeOpts, node.WithDns4Domain(options.Dns4DomainName))
}
if options.ExtIP != "" {
ip := net.ParseIP(options.ExtIP)
if ip == nil {
@ -128,6 +124,10 @@ func Execute(options Options) {
nodeOpts = append(nodeOpts, node.WithExternalIP(ip))
}
if options.Dns4DomainName != "" {
nodeOpts = append(nodeOpts, node.WithDns4Domain(options.Dns4DomainName))
}
libp2pOpts := node.DefaultLibP2POptions
if len(options.AdvertiseAddresses) == 0 {
libp2pOpts = append(libp2pOpts, libp2p.NATPortMap()) // Attempt to open ports using uPNP for NATed hosts.)