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

Use multiaddrs instead of UNIX socket paths for daemon sockets #41

Merged
merged 16 commits into from
Dec 27, 2018

Conversation

mvid
Copy link
Contributor

@mvid mvid commented Dec 6, 2018

No description provided.

@mvid mvid requested a review from bigs December 6, 2018 22:19
@ghost ghost assigned mvid Dec 6, 2018
@ghost ghost added the in progress label Dec 6, 2018
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.

some minor bits but generally seems good

ROADMAP.md Outdated Show resolved Hide resolved
ROADMAP.md Outdated Show resolved Hide resolved
pb/p2pd.proto Outdated Show resolved Hide resolved
specs/CONTROL.md Outdated Show resolved Hide resolved
specs/CONTROL.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

Do we really want this change? It complicates a tad.

package.json Show resolved Hide resolved
@vyzo
Copy link
Collaborator

vyzo commented Dec 7, 2018

I would like to see implementation go together with the spec for this, otherwise we'll have a spec that's incompatible with the implementation.

@mvid mvid force-pushed the feat/multiaddr-spec branch 2 times, most recently from 5e3c761 to 9bdda06 Compare December 11, 2018 00:18
@mvid mvid changed the title Update documentation to refer to multi-addrs instead of unix sockets Update documentation/implementation to use multi-addrs instead of unix sockets Dec 11, 2018
@mvid
Copy link
Contributor Author

mvid commented Dec 11, 2018

@vyzo @bigs This is ready for review

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

You have removed the compiled protobuf; please regenerate with protoc --gogofast_out=. p2pd.proto.

conn.go Outdated Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
daemon.go Outdated Show resolved Hide resolved
daemon.go Outdated Show resolved Hide resolved
dht.go Outdated Show resolved Hide resolved
p2pclient/p2pclient.go Outdated Show resolved Hide resolved
p2pclient/streams.go Outdated Show resolved Hide resolved
p2pd/main.go Outdated Show resolved Hide resolved
p2pd/main.go Outdated Show resolved Hide resolved
stream.go Outdated Show resolved Hide resolved
@vyzo
Copy link
Collaborator

vyzo commented Dec 11, 2018

please refrain from changing code you are not actively working on, especially little things like that :)

the convention is to have 3 groups of imports 1. system imports (unnamed), 2. same package imports (usually named) and 3. gx imports (named).

@mvid
Copy link
Contributor Author

mvid commented Dec 11, 2018

please refrain from changing code you are not actively working on, especially little things like that :)

the convention is to have 3 groups of imports 1. system imports (unnamed), 2. same package imports (usually named) and 3. gx imports (named).

I disabled the inspection, so the import auto-optimization should no longer happen. I have replaced the redundant names. If you would like me to commit my JetBrains configuration so that anyone else who develops with it won't cause automatic import optimization, please let me know.

p2pclient/streams.go Show resolved Hide resolved
p2pd/main.go Show resolved Hide resolved
test/utils.go Show resolved Hide resolved
dht.go Outdated Show resolved Hide resolved
p2pd/main.go Outdated Show resolved Hide resolved
conn.go Outdated
path := *req.StreamHandler.Path
maddr, err := ma.NewMultiaddrBytes(req.StreamHandler.Addr)
if err != nil {
return errorResponseString(err.Error())
Copy link
Collaborator

Choose a reason for hiding this comment

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

return errorResponse(err)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

i believe the error itself implements the error interface

stream.go Outdated Show resolved Hide resolved
@vyzo vyzo mentioned this pull request Dec 12, 2018
3 tasks
pb/p2pd.pb.go Outdated
@@ -3,11 +3,11 @@

package p2pd_pb

import proto "github.com/gogo/protobuf/proto"
import proto "github.com/golang/protobuf/proto"
Copy link
Contributor

Choose a reason for hiding this comment

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

should be generating with gogo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regenerated with protoc --gogofast_out=. p2pd.proto, also committed that line to a .sh

@bigs
Copy link
Contributor

bigs commented Dec 18, 2018

after that small simplification re: error, let's merge

@vyzo
Copy link
Collaborator

vyzo commented Dec 18, 2018

fix pb generation with gogo -- that's pretty important. Also, a conflict has developed in package.json.

@bigs
Copy link
Contributor

bigs commented Dec 18, 2018

gah @vyzo my diff is rendering so oddly. good catch, specifically the gogo bit. i'll look into the gx deps.

@vyzo vyzo changed the title Update documentation/implementation to use multi-addrs instead of unix sockets Use multiaddrs instead of UNIX socket paths for daemon sockets Dec 21, 2018
Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

Documentation changes, the code looks fine.

ROADMAP.md Outdated
those endpoints are converted to writes and reads to/from the stream, allowing
any application to interact with a libp2p network through simple, local IO.
negotiation, and protocol and stream multiplexing. Streams are mapped 1:1 to
connections over streaming transports supported by go-multiaddr-net. Writes and
Copy link
Collaborator

Choose a reason for hiding this comment

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

over streaming transports supported by go-multiaddr-net

That's not good enough, this is an irrelevant implementation detail.
Please specify UNIX domain sockets and tcp.

specs/CONTROL.md Outdated
@@ -21,8 +21,7 @@ There are two pieces to the libp2p daemon:

### Technical Details

The libp2p daemon and client will communicate with each other over a simple Unix
socket based protocol built with [protobuf](https://developers.google.com/protocol-buffers/).
The libp2p daemon and client will communicate with each other over any multiaddr supported protocol with [protobuf](https://developers.google.com/protocol-buffers/).
Copy link
Collaborator

Choose a reason for hiding this comment

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

again here, developer don't care about the multiaddr detail...
"they communicate over a simple socket based protocol" is sufficient.

specs/CONTROL.md Outdated
careful not to read excess bytes from the socket when parsing the daemon
response, otherwise they risk reading into the stream output.
After writing the response message to the address, the daemon begins piping the
newly created stream to the client over the multi-address supported transport.
Copy link
Collaborator

Choose a reason for hiding this comment

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

just socket; wtf is a multiaddress supported transport anyway?

@ghost ghost assigned vyzo Dec 27, 2018
@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

I took it upon myself to fix the documentation issues.

@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

@mvid can you pull and then rebase/squash this to a few commits without delete/undelete flip-flops etc?

nvm, we can merge as is.

@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

Also, it currently doesn't build because of gx dupes issues.

@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

There is an avalanche of errors related to gx deps issues; we'll have to bubble up some changes it seems.

@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

Bubbled up gx updates and resolved the dep dupes.

TBD: testing with gerbil-libp2p.

@vyzo
Copy link
Collaborator

vyzo commented Dec 27, 2018

tested with gerbil-libp2p, everything appears to be in order.

p2pd/main.go Outdated
@@ -110,7 +116,7 @@ func main() {
}

if !*quiet {
fmt.Printf("Control socket: %s\n", *sock)
fmt.Printf("Control multiaddr: %s\n", maddr.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

that's still a socket...

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

this is ready for merge

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