-
Notifications
You must be signed in to change notification settings - Fork 60
Usage Example #36
Comments
Hello @ajayrao80 For now, I can forward you to the Let me know if you could understand how to use it. I would really like to have an example in the README.md, as well as an example with some running code. If you are willing to help after understanding how to use this implementation, I would be really grateful if you create a PR with some examples. |
@vasco-santos I might be up for helping with this, since I am currently evaluating whether I can use If so, I can write up an example with my usecase. |
Hey @chris-asl In this issue, I would like to have a simple usage example first. It would be great if you could collaborate! |
So, a dummy application that uses the DHT for storing a <key, value> from a node and reading it from another one, would do? |
yes, that would be great! |
Add a basic usage example whereby the client code runs on top of each libp2p DHT node. The idea is that each user has its own deaddrop, identified by her UserId (on the DHT identifiers namespace), where other users can leave messages to. The demo instantiates three application (and thus DHT) nodes. Bootstrap is handled by having an "always-on" node where others can connect to. In real world examples, this would not suffice, as a discovery mechanism needs to be in place (either by using the RandomWalk peer discovery or by switching any implementations of libp2p/interface-peer-discovery). Once the nodes are instantiated and connected, thus forming a single DHT, one deaddrop application (userA) writes a message for userB. Then, userB reads her messages (after having been informed about the message through off-channel means). For this example to make sense, any sent message is encrypted using the recipient's public key, so that only she can read them, by decrypting them with her private key. Resolves libp2p#36. Signed-off-by: Chris Aslanoglou <[email protected]>
Came across this while looking for an usage example. Wondering if any example is available for reference? |
@chris-asl created a PR with an example that you can have a look #69 Meanwhile, we will be switching all the codebase to use async await/iterators and, as the API's will change, we did not get the example merged yet. |
Thank you @vasco-santos . Does this package work in browser? |
It should work, but it is not highly tested yet. But we are working on integrating this in |
@KrishnaPG I can happily report it does work in the browser 😸 |
That is great news. Thank you @kumavis |
I couldn't find a clear usage example/documentation. Can anyone help me out?
The text was updated successfully, but these errors were encountered: