Conversation
libp2p/__init__.py
Outdated
| # TODO enable support for other host type | ||
| # TODO routing unimplemented | ||
| host = BasicHost(swarm_opt) | ||
| host = RoutedHost(swarm_opt, disc_opt) |
There was a problem hiding this comment.
I think we should still provide the option for only starting a BasicHost. Can we only return a BasicHost if no disc_opt is passed in and a RoutedHost only when a disc_opt is introduced?
libp2p/kademlia/routed_host.py
Outdated
| def get_kad_network(self): | ||
| return self.kad_network | ||
|
|
||
| def kad_listen(self, port, interface='0.0.0.0'): |
There was a problem hiding this comment.
Should we call these functions routed_listen instead of kad_listen since kademlia is not the only way to do routing.
|
Hey folks, we're moving away from the specialised host construction in go-libp2p towards a service-based host construction wired with dependency injection and IoC (inversion of control). See: libp2p/go-libp2p#467. With the modular dialer, instead of wrapping a host within a RoutedHost, attaching a DHT to the host with a peer discovery capability would inject a component in the dialer to resolve addrs from the DHT when a dial is carried out. |
|
Thanks for the heads up @raulk! We will add refactoring this PR using dependency injection and IoC to the roadmap. We should have this done in the next few days! |
zixuanzh
left a comment
There was a problem hiding this comment.
Codecov went down because initialize_default_kademlia is not called in the latest commit. Will land this PR and then open a new one to refactor dependency injection in RoutedHost. Most tests should be added if Codecov is still below expectation.
As per #150, implement RoutedHost