-
Notifications
You must be signed in to change notification settings - Fork 85
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
[DISCUSSION] Add mediachain protocol code #27
Conversation
Multiaddr should just go as far as providing the information of the location of a process and the protocol that is at the transport layer that is required to use to that node, these can go from IP+TCP to proxy setups or even dynamic addressing like /dns/name /ipns/name to fetch the IP. One important thing to note is that although we see a lot of All of that being said and focusing on answering your need:
Here is a quick example of this "protocol multiplexing" multistream enabled handshake - https://github.com/ipfs/js-libp2p-ipfs/tree/master/examples/echo, you can see that we mount two new protocols, one "echo" and another "hello world", on top of all of the other libp2p protocols that work underneath and get abstracted away. You can do this in IPFS nodes too :) |
Hi @diasdavid, thanks for the explanation -- registering as protocol handler makes sense. Does this mean that
I get that specifying the supported protocols in a multiaddr can get awkward in a plurality situation (and as things change over time etc) but I wonder if there's human-friendly way to annotate a multiaddr to make its intended function clear at a glance |
Force-pushed with |
Looks like However, that field is DEPRECATED and I can't find a deprecation notice/relevant commit due to file moves. I also can't seem to find an enumeration of which protocols are supported by a standard IPFS node (for example, bitswap) -- this might be because "handle" and "protocol" are very generic terms 😞 |
@parkan removed that "deprecation notice", that is a old code comment (1,5 years old) not valid anymore https://github.com/libp2p/js-libp2p-identify/blob/master/src/message.js#L26 These are the protocols that are being mounted on connections inside IPFS: https://github.com/libp2p/specs/blob/master/7-properties.md#757-protocol-multicodecs |
@diasdavid excellent, this is very helpful. I think we just need to mount kad, in addition to our own protocols and the defaults, and we'll be all set. One remaining small thing is the agent/protocol versions:
const LibP2PVersion = "ipfs/0.1.0" // this is ProtocolVersion
const ClientVersion = "go-libp2p/3.3.4" // this is AgentVersion The comment here suggests AgentVersion should be
|
Shipping 1.2 of mediachain today with more correct multiaddr support. So far using a |
paging @jbenet about /p2p/ multiaddrs (call follow-up) |
We should be switching our multiaddrs from We should prep the upgrade path to that in another issue. |
Sorry this has been laying around for a while. I agree we should switch I'm ready to merge this but should we make the code 420 as it's practically the same as |
@parkan changing the code now would probably be a breaking change for you eh? |
420 makes sense due to adjacency, yeah How breaking this will be depends -- if we store the multiaddrs as text strings , presumably we'll still be able to dial peers? |
Ah, that makes it a piece of cake since you're only ever dealing with Cool, wanna update the PR? I can take care of the change in go-multiaddr (I'm poking on that for /dns and /relay anyhow). |
Nevermind, I included it in #34 ❤️ |
Awesome! Closing this. |
Following up on discussion here, I thought doing this via PR would be most illustrative.
The goal is to add support for well-formed mediachain multiaddrs, which I am picturing as
Questions brought up about this approach in IRC and elsewhere:
$protocol/$data
tuples?/secio/QmfWapjgngSkeaA5B34YaYGdVPNocUP72hMoCmosdJVzoK/mc
instead? why isn't IPFS/secio/QmfWapjgngSkeaA5B34YaYGdVPNocUP72hMoCmosdJVzoK/ipfs
? is the commonly used/ipfs/Q...
form a kind of alias/shorthand?http://...
for/http/w3c.org/http/2
)?I'm beginning to think that we do want a multistream protocol on top of secio transport, but I don't understand the relationship sufficiently to make a judgement. FWIW our nodes do not currently support bitswap (though supporting this is a long-term goal).