-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support .nodeAddress() for /dnsaddr #94
Comments
@hacdias we should add it, it looks like it just wasn't added to the
What do we need to do this for? IIRC the existing transports are handling the dns resolution. |
Hmm... as far as I understood, we need to resolve the |
Ah yes, you're right, we need to resolve the TXT record. We'll need to implement It might be good to do some level of cacheing so we don't need to resolve the address frequently. We can't do a replace after the resolve as the TXT records are mutable, so we need to keep a record of the original address. But the cacheing is probably something that should be handled in PeerBook/PeerInfo anyway. |
Since its DNS, the TXT record will provide a TTL. A good DNS client should do the caching for us. |
The way I see it:
|
I would expect this to throw an error, as it needs to be resolved. The addresses we get from We should really be performing resolution on any resolvable address we learn about before attempting to connect, and then using the resolved addresses to do the connecting. |
I could take a look at this effort. Is there anything else that should be done other than adding |
That should be sufficient. Libp2p will need to get updated to do resolutions as part of the dialing and/or peer discovery pipeline. While I don't think it's necessary for this iteration, we should keep in mind that in the future we may need different resolvers per address type. |
This is blocking js-ipfs from making use of the new bootstrappers see ipfs/js-ipfs#2581 @hacdias did you get anywhere with it? Will you pick it up again? |
@olizilla probably not and I haven't made any further progress on this one... :'( |
From my understanding after reading this and discuss a little bit with @jacobheun , we want the following:
This will unblock Moreover, we need a resolver for |
WebUI/Desktop use js-multiaddr for validating input, which means it is impossible to connect to On DNSAddr resolver for browser contextResolving DNSAddr in browser context is tricky, because initial reaction is that we would like to avoid hard-coding/configuring third party DNS services, such as Cloudflare. We have a nice solution for DNSLink in form of We could have similar endpoint for resolving DNSAddr, but it is introducing tight coupling between multiformats and IPFS API, while dnsaddr is an libp2p thing that does not care about IPFS at all, so entire scheme smells a bit. Even if we do this, there should be a configuration option to override IPFS resolver with a generic DoH endpoint, such as Cloudflare. So.. supporting DoH is already a topic discussed in the context of js-ipfs (ipfs/helia-ipns#53) and it sounds like a safe, vendor-agnostic way of handling DNS resolution in browser context. If we add it to js-multiaddr, there should be an opt-in way to override the default resolver. @vasco-santos @jacobheun is we wanted to unblock this, what would be the next step here? |
There are 2 pieces to this as I see it:
|
@jacobheun Are there any plans to support conversion to a node address from a dns addr? If so, I can take a stab at it and open a PR. If not, why? Should it be done in some other package?
I also wonder since we would need to check the DNS records if it would need to be async or not. Surely we could keep the API sync.
The text was updated successfully, but these errors were encountered: