Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

interface-dht and kad-dht QueryEvents type #409

Closed
tabcat opened this issue Jun 2, 2023 · 2 comments · May be fixed by #410
Closed

interface-dht and kad-dht QueryEvents type #409

tabcat opened this issue Jun 2, 2023 · 2 comments · May be fixed by #410

Comments

@tabcat
Copy link
Contributor

tabcat commented Jun 2, 2023

The exported QueryEvents type from @libp2p/interfaces-dht and @libp2p/kad-dht are not equal.

interface-dht:

export type QueryEvent = SendingQueryEvent | PeerResponseEvent | FinalPeerEvent | QueryErrorEvent | ProviderEvent | ValueEvent | AddingPeerEvent | DialingPeerEvent

kad-dht:
https://github.com/libp2p/js-libp2p-kad-dht/blame/2af3a0cad4e718b6bdf3b4a9b114d9f4b4860653/src/index.ts#L149

divergence stems from change in kad-dht https://github.com/libp2p/js-libp2p-kad-dht/pull/472/files

maschad added a commit to maschad/js-libp2p-interfaces that referenced this issue Jun 3, 2023
@p-shahi
Copy link
Member

p-shahi commented Jun 6, 2023

Update: we plan to deprecate the interfaces-dht and this will happen as a part of libp2p/js-libp2p#824
But for now, we'll go with #410

@achingbrain
Copy link
Member

@libp2p/interfaces-dht is too broad in it's attempt to define what a DHT is, instead the types from @libp2p/kad-dht should be used when a KAD DHT is configured.

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 a pull request may close this issue.

3 participants