Open guillaumemichel opened 1 year ago
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:
Libp2pEndpoint
IpfsDHT
Will move issue to go-libp2p-kad-dht for KadDHT in v2
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:
Libp2pEndpoint
builderIpfsDHT
level, having access to both the routing table and the libp2p host.