I want to build a decentralized, reddit-like system using P2P. What existing p2p library should I base it on?

前端 未结 3 1668
无人共我
无人共我 2021-01-31 22:39

I want to build a decentralized, reddit-like system using P2P. Basically, I want to retain the basic capabilities of reddit, but make it decentralized, to make it more robust an

相关标签:
3条回答
  • 2021-01-31 23:17

    I haven't had a chance to use it, but Telehash seems to have been made for this kind of application. Peer2Peer apps have a particular challenge dealing with the restrictions of firewalls... since Telehash is based on UDP, it's well suited for hole-punching through firewalls.

    EDIT for static_rtti's comment:

    If code velocity is a requirement libjingle has a lot of effort going into it, but is primarily geared towards XMPP. You can port off parts of the ICE code and at least get hole-punching. See the libjingle architecture overview for details about their implementation.

    0 讨论(0)
  • 2021-01-31 23:18

    Disclaimer: warning, self-promotion here !!!

    Have you considered JXTA's latest release? It is probably sufficient for what you want to do. Else, we are working on a new P2P framework called Chaupal, but it is not operational yet.

    EDIT

    There is also what I call the quick-and-dirty UDP solution (which is not so dirty after all, I should call it minimal).

    1. Just implement one server with a public address and start listening for UPD.
    2. Peers located behind NATs contact the server which can read how their private IP address has been translated into a public IP address from the received datagrams.
    3. You send that information back to the peer who can forward it to other peers. The server can also help exchanging this information between peers.
    4. Then peers can communicate directly (one-to-one) by sending datagrams to these translated addresses.

    Simple, easy to implement, but does not cover for lost datagrams, replays, out-of-order etc... (i.e., the typical stuff that TCP solves for you at the IP stack level).

    0 讨论(0)
  • 2021-01-31 23:23

    Check out CouchDB. It's a decentralized web app platform that uses an HTTP API. People have used it to create "CouchApps" which are decentralized CouchDB-based applications that can spread in a viral nature to other CouchDB servers. All you need to know to write CouchApps is Javascript and learn the CouchDB API. You can read this free online book to learn more: http://guide.couchdb.org

    The secret sauce to CouchDB is a Master-to-Master replication protocol that lets information spread like a virus. When I attended the first CouchConf, they demonstrated how efficient this is by throwing a "Couch Party" (which is where you have a room full of people replicating to the person next to them simulating an ad hoc network).

    Also, all the code that makes a CouchApp work is public by default in special entities known as Design Documents.

    P.S. I've been thinking of doing a similar project, but I don't have a lot of time to devote to it at the moment. GOD SPEED MY BOY!

    0 讨论(0)
提交回复
热议问题