Coder Social home page Coder Social logo

shresthagrawal / learnp2p Goto Github PK

View Code? Open in Web Editor NEW
26.0 5.0 6.0 18.49 MB

https://learnp2p.org

Home Page: https://jslibp2p-chat-tutorial.vercel.app

License: MIT License

JavaScript 76.52% CSS 20.20% HTML 3.28%
libp2p js-libp2p workshop tutorial jslibp2p-chat js

learnp2p's People

Contributors

acolytec3 avatar adnantium avatar apopiak avatar arikan avatar chadsr avatar deerdear avatar dependabot[bot] avatar gnunicorn avatar hcastano avatar henrisota avatar jamesray1 avatar jiyilanzhou avatar joepetrowski avatar jokyash avatar joshorndorff avatar kaichaosun avatar koushiro avatar ltfschoen avatar luke-rucker avatar nczhu avatar pepyakin avatar prateekreddy avatar robbepop avatar seabornlee avatar shawntabrizi avatar shresthagrawal avatar stefie avatar tokyoweb3 avatar vasa-develop avatar yjhmelody avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

learnp2p's Issues

Sections on the kad-dht / Kademlia in general contain misleading information on node lookups

There seems to be some confusion between the original "vanilla" design of Kademlia and S/Kademlia, which are iterative in their node lookup process and the version coined R/Kademlia which utilises a recursive lookup design.

Currently in section 4, chapter 1 (DHTs), this section is incorrect. Secondly in chapter 3 (Kademlia) this section also hints towards the use of recursive node lookups.

The libp2p implementations xx-libp2p-kad-dht currently follow the original iterative lookup algorithm and extend it in parallel following from S/Kademlia, whereas the documentation indicates something recursive, similar to R/Kademlia.

I'm in the process of updating these parts with information that I see as correct according to the iterative lookup algorithm used in xx-libp2p-kad-dht and will happily accept feedback!

Edit: Some further clarification from a core dev which confirms this.

Edit 2: My (maybe COVID infested) brain made a git mess, so I made a clean PR. Ignore the reference to 33 and instead look to PR #34. Apologies.

Prudent Additions to the Workshop Literature

There are a few additional contents that I wish to add to the Js-Libp2p-Chat-Tutorial Literature.

  • Add Introduction to p2p networks in 0/introduction.md. For making it more beginner-friendly, before the use of libp2p is stated, an Introduction to peer to peer networks should be added along with a small portion of the difference between p2p networks & client-server networks.
  • Addition of Difference in different types of transport in 1/introduction.md. Here, by brief (& beginner) explanation of why certain transport protocols are used over others, the use of libp2p could be more emphasized.
  • Addition of another Markdown/Section for complete beginners to get them updated starting from Web 2 to decentralized web to IPFS & IPLD with Libp2p at the last. It will also include the basic terminologies of the web and how it works. Those who are already familiar can simply proceed with the tutorial whereas others who are complete beginners can understand the basic concepts.

Fill out chapter 6 - Pub/sub

  • Explain pubsub and overview of floodsub vs gossipsub
  • Cover how to subscribe to a topic
  • Explain message handling on pubsub

Issue running 2.3 without secio

In #11 we discovered that the support for Plaintext as an default encryption was removed. And running the bootstrap code 2.2-finished-code.js and then running the code 2.3-finished-code.js which just dials to the bootstrap throws the following error:

(node:67986) UnhandledPromiseRejectionWarning: AggregateError:
    Error: protocol selection failed
        at module.exports (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/multistream-select/src/select.js:50:17)
        at async Upgrader._encryptOutbound (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/upgrader.js:361:36)
        at async Upgrader.upgradeOutbound (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/upgrader.js:168:11)
        at async ClassIsWrapper.dial (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p-tcp/src/index.js:42:18)
        at async TransportManager.dial (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/transport-manager.js:87:14)
        at async /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/libp2p/src/dialer/dial-request.js:58:18
        at async /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:53:19
    at maybeSettle (/Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:31:11)
    at /Users/shresthagrawal/Desktop/study/libp2p/jslibp2p-chat-tutorial/assets/node_modules/p-some/index.js:69:23
(node:67986) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:67986) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  • either use the secio and tell the user that they will learn about it in next chapter
  • or tell the user about the error and put it as connection to build up for the next chapter
  • or find some solution that makes it not throw the error in the first place

Merge the bootstrap and node code

It is hard for the user to sparely update two codes which are almost the same. Can we merge both the code and to choose take --botstrap as an input in the shell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.