content-dht-provide-find | ||
.gitignore | ||
LICENSE | ||
README.md |
libp2p Demos
Demo 1: DHT Peer & Content with Go and JS Nodes
Directory: content-dht-provide-find
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. One connected, each verifies that it can find the other's content via the 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:
First time only:
cd js-dht-test
npm install
Running the Node.js program:
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...6aJ9oRuEzWa
because it is being read in from util/private_key.bin
(a private key marshalled to X.509 generated by util/private-key-gen
). This is to keep the peer id of the bootstrap server stable across invocations.
Demo 2: PubSub
Directory: 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.
TODO: show how to run
Acknowledgements: @jhiesey for DHT (content & peer routing) JS+Go interop, @stebalien for PubSub