Skip to content
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

Implementation #4

Merged
merged 6 commits into from
Sep 13, 2018
Merged

Implementation #4

merged 6 commits into from
Sep 13, 2018

Conversation

vyzo
Copy link
Collaborator

@vyzo vyzo commented Sep 13, 2018

Initial implementation with a unix socket protocol; provides just enough to open connections and streams.

@vyzo vyzo mentioned this pull request Sep 13, 2018
@vyzo vyzo requested review from bigs and Stebalien September 13, 2018 15:10
Copy link
Contributor

@bigs bigs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great. let's get this merged and take it from here

return
}

switch *req.Type {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk if it's necessary for this PR, but we can definitely abstract this to support handler functions of the variety

func (req *pb.Request) *pb.Response

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah well it seems it doesn't perfectly map

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the stream breaks the abstraction. Also, notifications later on.

@vyzo vyzo merged commit 3c37581 into master Sep 13, 2018
@vyzo vyzo deleted the implementation branch September 13, 2018 16:04
@Stebalien
Copy link
Member

Can we somehow extract this transport to a go-libp2p-unix-transport?

@vyzo
Copy link
Collaborator Author

vyzo commented Sep 13, 2018

We could do that I guess, although I am not sure how it would work for the control protocol (that's missing currently!).
Let's get this working first and see how the whole thing crystalizes before adding intra-package complexity.

@Stebalien
Copy link
Member

We could do that I guess, although I am not sure how it would work for the control protocol (that's missing currently!).

My thinking was that we'd have:

  1. Libp2p all the way down.
  2. Open a stream to a control service (and use multistream to do this).

That means applications would have to implement:

  1. The unix transport.
  2. Multistream (it's a dead-simple protocol).

We could also, in theory, make protocol negotiation transport specific (like we've done with stream muxing and security) but we'd have to think carefully about that.

@vyzo
Copy link
Collaborator Author

vyzo commented Sep 13, 2018

Not objecting, just not rushing.
Let's add the control protocol and see how it shapes up, and we can think about extracting a UNIXFS transport later.
But the less applications need to implement, the better.

@Stebalien
Copy link
Member

👍 I'd just also like to optimize for fewer abstractions. That is, if we can get away with reusing existing abstractions, we should. However, we do have to balance that with simplicity and fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants