From d31cd93956cd81454036b79fb622fdac1e6bb47c Mon Sep 17 00:00:00 2001 From: Mike Goelzer Date: Sun, 9 Sep 2018 06:44:43 -0700 Subject: [PATCH] Updated readme --- README.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.txt b/README.txt index 9510b9f..6aececd 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,36 @@ +# libp2p Demos +## Demo 1: DHT Peer & Content with Go and JS Nodes + +**What it demonstrates:** A new DHT is created by the Go program `dht-interop`. In a separate terminal or machine, a Node.js program connects to this DHT. + +**First terminal:** +``` +cd content-dht-provide-find +make +./dht-interop +``` + +**Second terminal:** run the command printed out by dht-interop, replacing 127.0.0.1 with the IP of the server where dht-interop is listening. Example: + +``` +node js-dht-test/index.js /ip4/127.0.0.1/tcp/9876/ipfs/QmehVYruznbyDZuHBV4vEHESpDevMoAovET6aJ9oRuEzWa +``` + +Note that the node ID of `dht-interop` is always `Qm...RuEzWa` because it is being read in from `util/private_key.bin` (an X.509 private key generated by `util/private-key-gen`). + + +## Demo 2: PubSub + +**What it demonstrates**: Two Go nodes are created and run a chat server using a shared PubSub topic. **TODO**: Should be a Go node and a JS node, once I get the two Go nodes version working. + + +_Acknowledgements: @jhiesey for DHT (content & peer routing) JS+Go interop, @stebalien for PubSub_ + + + + +-------------------------------------------- util/private-key-gen -> private_key.bin (marshalled private key that is used for stable peer id of bootstrap server)