-
Notifications
You must be signed in to change notification settings - Fork 448
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
Chore/add typedefs peerstore book template 2 #831
Conversation
* feat: auto relay * fix: leverage protoBook events to ask relay peers if they support hop * chore: refactor disconnect * chore: do not listen on a relayed conn * chore: tweaks * chore: improve _listenOnAvailableHopRelays logic * chore: default value of 1 to maxListeners on auto-relay
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
BREAKING CHANGE: pubsub signing policy properties were changed according to libp2p-interfaces changes to a single property. The emitSelf option default value was also modified to match the routers value
* feat: custom dialer addr sorter * chore: use libp2p utils sorter via addressBook getMultiaddrsForPeer * chore: use new libp2p utils * chore: apply suggestions from code review Co-authored-by: Jacob Heun <jacobheun@gmail.com> Co-authored-by: Jacob Heun <jacobheun@gmail.com>
* chore: auto relay example * chore: update examples to use process arguments * chore: add test setup for node tests and test for auto-relay * chore: apply suggestions from code review * chore: do not use promise for multiaddrs event on example
* chore: update websockets
Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
Added a commit merging in the new updates of the base types branch to check this |
66b9abd
to
222bb7b
Compare
671ba33
to
e014fee
Compare
src/upgrader.js
Outdated
@@ -231,6 +231,7 @@ class Upgrader { | |||
const { stream, protocol } = await mss.handle(Array.from(this.protocols.keys())) | |||
log('%s: incoming stream opened on %s', direction, protocol) | |||
if (this.metrics) this.metrics.trackStream({ stream, remotePeer, protocol }) | |||
// @ts-ignore - metadata seems to be required |
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.
Fixed on libp2p/js-libp2p-interfaces#74
This looks good to me! However, a new issue appeared as a result of this update...
This only happens with the new ts. If you look into the dist on |
Yes, this sounds good! I will add it to the follow up list to not block this anymore. |
1d3492f
to
2e7f49e
Compare
Discussion continued in #830 |
This pull request does following:
@vasco-santos one other thing I want to call out here is that this change turns
StreamHandler
into non generic, that is because it usesCircuitPB
encode / decode which in turn expects concrete structs. I am however not exactly sure I got all the details right, specifically:CircuitRelay
protobuf all fields are optional.CircuitRequest
with all fields (butcode
) mandatory.StreamHandler
seems to always containcode & type
StreamHandler
are assumed to havetype
srcPeer
,dstPeer
.Which is what were reflected in the StreamHandler API reads return
CircuitRequest
s with all the mandatory fields and writes takeCircuitMessage
s with all the optional fields. However I am guessing thatCircuitMessage
in fact is more of a union of different message types where each corresponds toType
enum and has different subset of fields & probably each must have some subset of the the fields and that is why protobuf just marks them all optional.If above hypothesis is correct it would make much more sense to represent each
message
type via actual type definition with it's fields and representCircuitMessage
as a type union. It would be good to sync up on this to fix those details up.