-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added an example for a multi-protocol app using strongly typed data and protobufs #249
Conversation
examples/multipro/protocol.go
Outdated
enc := protobufCodec.Multicodec(nil).Encoder(writer) | ||
err := enc.Encode(data) | ||
if err != nil { | ||
log.Fatal(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.
log.Fatal will halt the program immediately, we would never get to return false
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.
good catch - got rid of all log.Fatal in latest check-in
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 had a rather quick look. I don't see anything wrong or hard to follow. Seems a good example to me, very illustrative!
There are a couple of commented lines and todos which we might want to clean-up, but they don't bother me much.
Thanks!
I'd like to do some cleanups before this can be merged. I will commit here when I think this is 100% ready for merging. For example, unrolling GX imports to their canonical names. ok? |
I can't really get the example to go build when replacing the GX deps with the canonical github repo names. Can one of you guys help me out with that? I assume we don't want code checkins with GX deps correct? |
If you use the canonical github repo, and run |
I'm still having trouble with GX and deps :-( |
@avive I believe your problem is the |
So... Apparently, force-pushing master to a PR will close it. Worse, because this PR was made master to master, it appears that I can't reopen it. New PR: #280. |
use the Resource Manager
Here's a little examples that shows how to build a node with multiple app protocols using protobufs as the wire format. The example creates a node that implements two protocols - ping and echo and the example demonstrate exchanging methods using the two protocols between two peers.