multiaddr icon indicating copy to clipboard operation
multiaddr copied to clipboard

Adding specification of more protocols

Open ben221199 opened this issue 2 years ago • 6 comments

This pull request adds specifications of more protocols than only dnsaddr.

I think this pull request should be merged when I have added more, but now it is already possible to see the changes and talk about improvements.

ben221199 avatar Aug 21 '22 14:08 ben221199

I think that adding the basis using this pull request is fine. We can add more information for a specific protocol using other pull requests.

@mxinden Also, can you tell me what the binary format of dns, dns4, dns6 and dnsaddr is? Is it already defined? If not, I would suggest the FQDN format with a length-byte for every label.

Also, I have made some other pull requests on this and on other repositories. Hope someone can take a look at those too.

ben221199 avatar Aug 22 '22 11:08 ben221199

@mxinden Also, can you tell me what the binary format of dns, dns4, dns6 and dnsaddr is? Is it already defined? If not, I would suggest the FQDN format with a length-byte for every label.

Hope I understand your question correctly @ben221199. As far as I know it is just the utf-8 byte representation.

https://github.com/multiformats/rust-multiaddr/blob/911b18a51fafdee44a445dc491192f85430fbbbf/src/protocol.rs#L393-L416

mxinden avatar Aug 23 '22 07:08 mxinden

w.write_all(encode::usize(bytes.len(), &mut encode::usize_buffer()))?;

This code above will prefix the data with an unsigned byte, yes.

Are the implementations in this organization authoritive at the moment, or is it still possible to alter the binary format at this time?

ben221199 avatar Aug 23 '22 07:08 ben221199

Okay, I think I added enough protocols for now. I think that, except for maybe some slight changes, this pull request can be merged.

ben221199 avatar Aug 23 '22 17:08 ben221199

Are the implementations in this organization authoritive at the moment, or is it still possible to alter the binary format at this time?

They are used in many production systems, thus I would say yes.

mxinden avatar Aug 26 '22 07:08 mxinden

Above suggestions are applied.

ben221199 avatar Aug 26 '22 08:08 ben221199