From b1e09dbf19341a7c816c9d477e6a688a01f6363e Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Thu, 22 Feb 2018 17:37:36 +0200 Subject: [PATCH] Update readmes --- examples/README.md | 1 + examples/multipro/AUTHORS | 2 +- examples/multipro/README.md | 22 ++++++++++++++----- .../README.md | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/README.md b/examples/README.md index 1c416152a..f2e1bd52d 100644 --- a/examples/README.md +++ b/examples/README.md @@ -11,3 +11,4 @@ Let us know if you find any issue or if you want to contribute and add a new tut - [Building an http proxy with libp2p](./http-proxy) - [Protocol Multiplexing with multicodecs](./protocol-multiplexing-with-multicodecs) - [An echo host](./echo) +- [Multicodecs with protobufs](./multipro) \ No newline at end of file diff --git a/examples/multipro/AUTHORS b/examples/multipro/AUTHORS index 4e649b717..70a81f0a5 100644 --- a/examples/multipro/AUTHORS +++ b/examples/multipro/AUTHORS @@ -1,3 +1,3 @@ # This is the official list of authors for copyright purposes. -Aviv Eyal \ No newline at end of file +Aviv Eyal diff --git a/examples/multipro/README.md b/examples/multipro/README.md index 1e3352cfc..c60da8b17 100644 --- a/examples/multipro/README.md +++ b/examples/multipro/README.md @@ -6,23 +6,33 @@ This example expects that you area already familiar with the [echo example](http ## Build -Compile the .proto files using the protobufs go compiler: +Install gx: +```sh +> go get -u github.com/whyrusleeping/gx ``` -protoc --go_out=. ./p2p.proto + +Run GX from the root libp2p source dir: +```sh +>gx install ``` +Build libp2p: +```sh +> make deps +> make +``` -From `multipro` base source folder: +Run from `multipro` directory -``` +```sh > go build ``` ## Usage -``` +```sh > ./multipro ``` @@ -31,7 +41,7 @@ From `multipro` base source folder: The example creates two LibP2P Hosts supporting 2 protocols: ping and echo. -Each protocol consists RPC-style requests and respones and each request and response is a typed protobufs message (and a go data object). +Each protocol consists RPC-style requests and responses and each request and response is a typed protobufs message (and a go data object). This is a different pattern then defining a whole p2p protocol as one protobuf message with lots of optional fields (as can be observed in various p2p-lib protocols using protobufs such as dht). diff --git a/examples/protocol-multiplexing-with-multicodecs/README.md b/examples/protocol-multiplexing-with-multicodecs/README.md index 0001f60be..0b873f51a 100644 --- a/examples/protocol-multiplexing-with-multicodecs/README.md +++ b/examples/protocol-multiplexing-with-multicodecs/README.md @@ -1,4 +1,5 @@ + # Protocol Multiplexing using multicodecs with libp2p This examples shows how to use multicodecs (i.e. json) to encode and transmit information between LibP2P hosts using LibP2P Streams.