Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

feat: add support for client mode #200

Merged
merged 1 commit into from
Jul 10, 2020
Merged

feat: add support for client mode #200

merged 1 commit into from
Jul 10, 2020

Conversation

jacobheun
Copy link
Contributor

This adds the ability for DHT nodes to run in client mode. This means, nodes will not register nor respond to queries on the dht protocol, which nodes should be doing if they are not dialable (browser nodes, nodes behind NATs)

Ideally, this should be dynamic and should be in client mode by default, however, js-libp2p doesn't currently have autoNat support so we can't dynamically determine our dialability.

To keep this backwards compatible clientMode is disabled by default.

I left _clientMode as private for now. In the future we may want to add a setter to allow this to be changed dynamically.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
We should track making this the default on libp2p/js-libp2p-kad-dht#183, or guarantee that we have autoNAT in place

@vasco-santos vasco-santos merged commit 91f6e4f into master Jul 10, 2020
@vasco-santos vasco-santos deleted the feat/client-mode branch July 10, 2020 11:16
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 this pull request may close these issues.

3 participants