-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
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.
some minor bits but generally seems good
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.
Do we really want this change? It complicates a tad.
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. |
5e3c761
to
9bdda06
Compare
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.
You have removed the compiled protobuf; please regenerate with protoc --gogofast_out=. p2pd.proto
.
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. |
conn.go
Outdated
path := *req.StreamHandler.Path | ||
maddr, err := ma.NewMultiaddrBytes(req.StreamHandler.Addr) | ||
if err != nil { | ||
return errorResponseString(err.Error()) |
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.
return errorResponse(err)
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.
Done
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.
i believe the error itself implements the error interface
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" |
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.
should be generating with gogo
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.
Regenerated with protoc --gogofast_out=. p2pd.proto
, also committed that line to a .sh
after that small simplification re: error, let's merge |
fix pb generation with gogo -- that's pretty important. Also, a conflict has developed in package.json. |
gah @vyzo my diff is rendering so oddly. good catch, specifically the gogo bit. i'll look into the gx deps. |
812d852
to
ccd3a40
Compare
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.
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 |
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.
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/). |
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.
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. |
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.
just socket; wtf is a multiaddress supported transport anyway?
I took it upon myself to fix the documentation issues. |
nvm, we can merge as is. |
Also, it currently doesn't build because of gx dupes issues. |
There is an avalanche of errors related to gx deps issues; we'll have to bubble up some changes it seems. |
fbdbe90
to
25b3a7c
Compare
Bubbled up gx updates and resolved the dep dupes. TBD: testing with gerbil-libp2p. |
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()) |
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.
that's still a socket...
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.
this is ready for merge
No description provided.