Browse Source

Update readmes

pull/280/head
Aviv Eyal 7 years ago
committed by Steven Allen
parent
commit
b1e09dbf19
  1. 1
      examples/README.md
  2. 2
      examples/multipro/AUTHORS
  3. 22
      examples/multipro/README.md
  4. 1
      examples/protocol-multiplexing-with-multicodecs/README.md

1
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)

2
examples/multipro/AUTHORS

@ -1,3 +1,3 @@
# This is the official list of authors for copyright purposes.
Aviv Eyal <aviveyal07@gmail.com>
Aviv Eyal <aviveyal07@gmail.com>

22
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).

1
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.

Loading…
Cancel
Save