Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Add option to force nat into a specified reachability state #55

Merged
merged 3 commits into from Mar 20, 2020

Conversation

willscott
Copy link
Contributor

The more common way we want to expose "don't run autonat" at the libp2p level is probably "force this node to believe it (is/isn't) natted" rather than "don't run the service or report any reachability. The later better decouples the nat subsystem from other systems like DHT or relaying.

ref: libp2p/go-libp2p#845

.vscode/settings.json Outdated Show resolved Hide resolved
svc.go Outdated
@@ -46,7 +46,7 @@ func newAutoNATService(ctx context.Context, c *config) (*autoNATService, error)
reqs: make(map[peer.ID]int),
}

if c.forceServer {
if c.forceServer || c.forceReachability {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably get rid of the forceServer option, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what if we're forcing "unreachable"? Will we not start in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed. When unreachable, the service object won't be created in autonat.New

svc.go Outdated Show resolved Hide resolved
svc.go Outdated Show resolved Hide resolved
reachability: conf.reachability,
service: service,
}, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else emit unknown?

@Stebalien Stebalien merged commit afa283b into master Mar 20, 2020
@Stebalien Stebalien deleted the feat/override branch March 20, 2020 22:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants