github.com/jbendotnet/noms@v0.0.0-20190904222105-c43e4293ea92/doc/decent/demo-ipfs-chat.md (about) 1 [Home](../../README.md) » [Use Cases](../../README.md#use-cases) » **Decentralized** » 2 3 [About](about.md) | [Quickstart](quickstart.md) | [Architectures](architectures.md) | [P2P Chat Demo](demo-p2p-chat.md) | **IPFS Chat Demo** 4 <br><br> 5 # Demo App: IPFS-based Decentralized Chat 6 7 This sample app demonstrates backing a P2P noms app by a decentralized blockstore (in this case, IPFS). Data is pulled off the network dynamically as needed - each client doesn't need a complete copy. 8 9 # Build and Run 10 11 Demo app code is in the 12 [ipfs-chat](https://github.com/attic-labs/noms/tree/master/samples/go/decent/ipfs-chat/) 13 directory. To get it up and running take the following steps: 14 15 * Use git to clone the noms repository onto your computer: 16 17 ```shell 18 go get github.com/attic-labs/noms/samples/go/decent/ipfs-chat 19 ``` 20 21 * From the noms/samples/go/decent/ipfs-chat directory, build the program with the following command: 22 23 ```shell 24 go build 25 ``` 26 27 * Run the ipfs-chat client with the following command: 28 29 ```shell 30 ./ipfs-chat client --username <aname1> --node-idx=1 ipfs:/tmp/ipfs1::chat >& /tmp/err1 31 ``` 32 33 * Run a second ipfs-chat client with the following command: 34 35 ```shell 36 ./ipfs-chat client --username <aname2> --node-idx=2 ipfs:/tmp/ipfs2::chat >& /tmp/err2 37 ``` 38 39 If desired, ipfs-chat can be run as a daemon which will replicate all 40 chat content in a local store which will enable clients to go offline 41 without causing data to become unavailable to other clients: 42 43 ```shell 44 ./ipfs-chat daemon --node-idx=3 ipfs:/tmp/ipfs3::chat 45 ``` 46 47 Note: the 'node-idx' argument ensures that each IPFS-based program 48 uses a distinct set of ports. This is useful when running multiple 49 IPFS-based programs on the same machine.