pubky / pkarr

Public Key Addressable Resource Records (sovereign TLDs)
https://app.pkarr.org
MIT License
153 stars 17 forks source link

Do not open UDP socket when using PkarrClient only for relay things #61

Closed rklaehn closed 4 months ago

rklaehn commented 4 months ago

Currently, as far as I can see PkarrClient will always contain a Dht when built with the dht feature flag.

That means that it opens a random UDP port even if you want to use PkarrClient only for e.g. relay_put.

It would be great if you could configure in the builder whether to use the dht at all, independent of the feature flag.

Nuhvi commented 4 months ago

independent of the feature flag.

Ok, didn't consider that. It will be a bit annoying to keep checking an Option<Dht>, but will try it. I am already trying Arc<Mutex<LruCache>> so might as well.

Nuhvi commented 4 months ago

V2 now has a separate relay client, and all things dht can be disabled by disabling default features and only using relay feature

But would love if you take a look and confirm that.