multiformats / multicodec

Compact self-describing codecs. Save space by using predefined multicodec tables.
MIT License
341 stars 205 forks source link

Add SRV multiaddr protocol #295

Closed Pandapip1 closed 2 years ago

Pandapip1 commented 2 years ago

See https://github.com/multiformats/multiaddr/pull/143

rvagg commented 2 years ago

@Pandapip1 see the validation failure here (you can run it locally), you'll need to fix up your comment to remove commas at least, try and keep it fairly simple and follow the patterns you can see in there for comments

Pandapip1 commented 2 years ago

As you can tell, this is my first time. Thanks for the feedback!

One quick question: SRV is defined as a record: _service._proto.domain. tcp and udp are the most commonly used values for proto. How would I go about specifying that (for example) in /srv/coolservice/tcp/domain.example.com, the /tcp/domain.example.com is NOT an encapsulated multiaddr?

Pandapip1 commented 2 years ago

try and keep it fairly simple and follow the patterns you can see in there for comments

Another quick question: where do you specify the format of new multiaddr protocols?

MarcoPolo commented 2 years ago

try and keep it fairly simple and follow the patterns you can see in there for comments

Another quick question: where do you specify the format of new multiaddr protocols?

I'd recommend reading https://github.com/multiformats/multiaddr/#interpreting-multiaddrs. Multiaddrs should be interpreted right to left. In this case I think the proper format of something like _ldap._tcp.example.com would be: /dns/example.com/tcp/0/srv/ldap. We interpret the multiaddr right to left, so we first see that this is a srv protocol, and the rest of the multiaddr (the stuff left of srv) makes sense in the context of srv (i.e. this is on example.com and a tcp protocol) (note that tcp/0 is chosen since we aren't specifying a specific tcp port, just that we want tcp).


I'm curious, what's the use case here? I think outlining the use case helps everyone understand the motivation and get on the same page :)

Pandapip1 commented 2 years ago

I'm curious, what's the use case here? I think outlining the use case helps everyone understand the motivation and get on the same page :)

If I'm being honest here, I actually forgot... I'll just close this until I re-remember it.