-
Notifications
You must be signed in to change notification settings - Fork 66
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
[WIP] feat: adding p2p-circuit proto #41
Conversation
src/protocols-table.js
Outdated
@@ -42,7 +42,8 @@ Protocols.table = [ | |||
[477, 0, 'ws'], | |||
[478, 0, 'wss'], | |||
[275, 0, 'libp2p-webrtc-star'], | |||
[276, 0, 'libp2p-webrtc-direct'] | |||
[276, 0, 'libp2p-webrtc-direct'], | |||
[277, 0, 'p2p-circuit'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length should be V
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the code is 290 as per https://github.com/multiformats/multiaddr/blob/master/protocols.csv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't, so far, considered multiaddrs that are 'pseudo-encapsulate' other multiaddrs as if the other multiaddrs are part of size of the one that 'pseudo-encapsulates'. See the webrtc-star example or even ws.
I can understand the reasoning, it can be open for discussion, but the parsing is not made for that case right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgierth @diasdavid @whyrusleeping
After making the change to a V in [277, V, 'p2p-circuit']
, odd number multiaddrs break, so a valid address such as /p2p-circuit/ipfs/QmDest
is not a valid address anymore (at least in JS). What is the reason for making it a variable length addr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! For the record: 0 was correct!
Ah, great catch! Didn't see the table before. Should the proto name in the table be changed to |
Oh actually yes, great catch too! Wanna take care of that? |
Yep |
|
||
bs58.decode(b58str) | ||
return b58str | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice util :) //cc @dignifiedquire @haadcode @victorbjelkholm
needs tests