-
Notifications
You must be signed in to change notification settings - Fork 281
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
Clarify/confirm <src><dst><data>
multistream flow in relay
#12
Comments
Mh yes, thanks for catching this. The semantics of the header are pretty under-specified... It should be exactly as you say above. There's an A-to-R header (dest multiaddr), and an R-to-B header (src multiaddr). (Note that the multicodec now starts in /libp2p though.)
R needs the dest multiaddr to know what to do. It MUST be at least a B doesn't need the src multiaddr, but it's pretty helpful in that it allows to establish the reverse connection. The same peer routing semantics as with the A-to-R header apply. The relay can send a full multiaddr for A, or it can send just /p2p/QmOne which would require peer routing before being able to dial back. |
I think it's good to go 👍 One more explanation addition:
The same peer routing semantics as with the A-to-R header apply. The relay can send a full multiaddr for A, or it can send just I'll think a bit more about the semantics of the header and nested relay connections too (example "Dial QmThree, through a relayed connection to QmTwo" in the current spec). |
This issue is old. Let's converge on #22 |
@lgierth @diasdavid @dignifiedquire
The current spec describes the multistream interaction as
<src><dst><data>
, further defining it as:In order to make sure that this is unambiguous an example might be required, such as:
Peer A
connects to relay (Relay
) and writes the destination address as a header/ipfs/relay/circuit/1.0.0\n/<valid multiaddr of dest node>
Relay
reads the header and the address ofPeer B
from the streamRelay
then connects toPeer B
and writes a header in the form of/ipfs/relay/circuit/1.0.0\n/<valid multiaddr of source node>
Peer B
stores the origin/source address to be able to later dial back (is this the case?)Relay
short circuits the two streamsThis is what I currently have implemented as well, but I still feel that I might be reading the spec incorrectly, so just making sure this is the intended flow. Adding an example like this to the spec might also help future implementors. Please feel free to correct were things are off.
The text was updated successfully, but these errors were encountered: