probe-lab/go-kademlia

Add libp2p notifee to IpfsDHT

Opened this issue · 1 comments

https://github.com/libp2p/go-libp2p-kad-dht uses the libp2p notifee mechanism to add remote nodes to its routing table and peerstore. A similar mechanism should be implemented on the libp2p endpoint.

https://github.com/libp2p/go-libp2p-kad-dht/blob/978cb74f5fdf846e09d5769bb4dfb9f962135c38/subscriber_notifee.go

As it requires access to the libp2p host and it has an impact on the routing table, there are 2 solutions:

  • pass a routing table to the Libp2pEndpoint builder
  • implement the notifee at the IpfsDHT level, having access to both the routing table and the libp2p host.
iand commented

Will move issue to go-libp2p-kad-dht for KadDHT in v2