Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow configurable validators and selectors to the dht #288

Merged

Conversation

vasco-santos
Copy link
Member

Allow configurable validators and selectors. Users of libp2p with libp2p-kad-dht must be able to set their own validators and selectors.

For instance, this is important for js-ipfs to use /ipns/ namespaces in the DHT

@ghost ghost assigned vasco-santos Nov 29, 2018
@ghost ghost added the status/in-progress In progress label Nov 29, 2018
@vasco-santos vasco-santos force-pushed the feat/allow-configurable-validators-and-selectors-to-dht branch from 830dd76 to c931c46 Compare November 29, 2018 11:50
@jacobheun jacobheun mentioned this pull request Nov 29, 2018
src/index.js Outdated
datastore: this.datastore
datastore: this.datastore,
validators: this._config.dht.validators || {},
selectors: this._config.dht.selectors || {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason these can't just be null, instead of creating an empty object?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I am also doing this in kad-dht, I will change it now! Thanks :)

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

Looks good!

@jacobheun jacobheun merged commit 7d12eb9 into master Nov 29, 2018
@ghost ghost removed the status/in-progress In progress label Nov 29, 2018
@jacobheun jacobheun deleted the feat/allow-configurable-validators-and-selectors-to-dht branch November 29, 2018 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants