libp2p / go-libp2p-circuit

Circuit Switching for libp2p
MIT License
48 stars 16 forks source link

What's the difference between `OptActive`, `OptHop` and `OptDiscovery`? #52

Closed cannium closed 5 years ago

cannium commented 5 years ago

I can see OptDiscovery and OptHop are set in go-ipfs, but their meanings are ambiguous to me, and the config cfg.Swarm.DisableRelay seems not very Orthogonal. Also, OptActive seems never used, but there's an error related: https://github.com/libp2p/go-libp2p-circuit/blob/f83937ed3384bb289ba39ee0c4f428f26013390a/relay.go#L291-L294 Could someone kindly explain the intentions of these options?

vyzo commented 5 years ago

OptActive is an option to allow relays to actively dial target hosts. It's not used in ipfs currently, because it has security implications, but it may be useful in some network topologies.

cannium commented 5 years ago

I recall previously /p2p-circuit/p2p/xxx could use a random relay node, is it related to OptActive?

vyzo commented 5 years ago

No, this is enabled with OptDiscovery.