From e9ab5b3ef96baafc06fadabd2cc96199f1f972b3 Mon Sep 17 00:00:00 2001 From: Dan Willhite Date: Mon, 18 Sep 2017 15:49:20 -0700 Subject: [PATCH] Update demo-p2p-chat.md --- doc/decent/demo-p2p-chat.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/decent/demo-p2p-chat.md b/doc/decent/demo-p2p-chat.md index 79718caf94..3774411a1c 100644 --- a/doc/decent/demo-p2p-chat.md +++ b/doc/decent/demo-p2p-chat.md @@ -5,3 +5,30 @@ [![GoDoc](https://godoc.org/github.com/attic-labs/noms?status.svg)](https://godoc.org/github.com/attic-labs/noms) [![Slack](http://slack.noms.io/badge.svg)](http://slack.noms.io) +# Demo App: IPFS-based Decentralized Chat + +Demo app code is in the +[p2p](https://github.com/attic-labs/noms/tree/master/samples/go/ipfs-chat/p2p) +directory. To get it up and running take the following steps: +* Use git to clone the noms repository onto your computer: +``` +git clone git@github.com:attic-labs/noms.git or git clone https://github.com/attic-labs/noms.git +``` +* From the noms/samples/go/ipfs-chat/p2p directory, build the program with the following command: +``` +go build +``` +* Run the p2p client with the following command: +``` +mkdir /tmp/noms1 +./p2p client --username= --node-idx=2 /tmp/noms1 >& /tmp/err1 +``` +* Run a second p2p client with the following command: +``` +./p2p client --username= --node-idx=3 /tmp/noms2 >& /tmp/err2 +``` + +Note: the p2p client relies on IPFS for it's pub/sub implementation. The +'node-idx' argument ensures that each IPFS-based node uses a distinct set +of ports. This is useful when running multiple IPFS-based programs on +the same machine.