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

feat: allow passing ProvidersInit in KadDHT constructor #404

Merged
merged 6 commits into from
Dec 7, 2022
Merged

feat: allow passing ProvidersInit in KadDHT constructor #404

merged 6 commits into from
Dec 7, 2022

Conversation

joeltg
Copy link
Contributor

@joeltg joeltg commented Nov 29, 2022

The Providers component takes a ProvidersInit object, but there's not actually a way to provide it with one from the KadDHT constructor. This means users aren't able to override the defaults for how long provider records are valid for and how frequently to clean up expired provider records.

Feel free to close this if there's a different way you'd rather do it, or if for some reason it's not allowed on purpose (though I can't imagine why), but it's such a small change I thought I'd just open it as a PR.

Thanks for your time; this would really help me out!

Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

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

LGTM, could you please add a test to ensure we are actually passing the config object to the providers constructor

src/kad-dht.ts Outdated Show resolved Hide resolved
test/kad-dht.spec.ts Outdated Show resolved Hide resolved
test/kad-dht.spec.ts Outdated Show resolved Hide resolved
@achingbrain achingbrain merged commit e64af85 into libp2p:master Dec 7, 2022
@achingbrain
Copy link
Member

Thanks!

github-actions bot pushed a commit that referenced this pull request Dec 7, 2022
## [6.1.0](v6.0.4...v6.1.0) (2022-12-07)

### Features

* allow passing ProvidersInit in KadDHT constructor ([#404](#404)) ([e64af85](e64af85))

### Bug Fixes

* treat /dns, /dns4, and /dns6 addrs as public ([#406](#406)) ([e27747a](e27747a)), closes [#377](#377)
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

🎉 This PR is included in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants