6 ms·
Ask HN: Can you recommend a modern, accessible P2P framework/library?
I'm interested in building p2p applications.
I've checked into IPFS, GNUnet, Freenet, libp2p, and a few more.
My main tools are Rust and Python.
I haven't found anything (I could be reading things wrong of course) that I can directly build GUI applications on top of, with great documentation, and minimal head banging.
Does anyone have experience building p2p apps? Can you recommend/suggest a route to take?
Definitely don't want to have to implement my own thing.
Thanks
- Strom 8y agoPeer-to-peer is such a wide term that can mean pretty much anything, e.g. micro loans of money to people in need. It can be viewed just as a way of doing things. So in that sense, all you need is a socket connection to get going. What are you looking to build more specifically? News sharing? Video chat? File sharing? If you're looking for file sharing, then a decent solution might be to use BitTorrent via the libtorrent library. https://www.libtorrent.org/ https://www.libtorrent.org/
- rayvy 8y ago> What are you looking to build more specifically? I think this is my problem. I don't have an idea of anything I want to build specifically, I kinda just want to hack around on something. My approach to learning new things is to usually read a bit, download it/import it and just start trying things. But that doesn't seem like a practical route when trying to build p2p applications?
- lucideer 8y ago> I kinda just want to hack around on something. If this is where you're at, and you don't mind too much learning a new language (js), or porting, the SSB community is very accessible from a social/personal perspective, and there's plenty of small, simple hackable ideas being tossed around discussions on the network for implementing.
- fenwick67 8y agoSecure Scuttlebutt, DAT and Cabal are working p2p apps that can help expose you to the way things can work. Personally, I wrote frontends for two of those and it's helped me understand them better. These are all written in Nodejs, though. There's a nice p2p and kappa database primer here: https://github.com/kappa-db/workshop https://github.com/kappa-db/workshop
- rolleiflex 8y agoWhen I was building Aether [1] I had to build mine from scratch in Go. It all depends on your needs. Generally speaking, P2P is not a concept that you can abstract into a library. you have to make your app very deeply integrate with it, because it will present you challenges, limitations (and opportunities) that you have to respond to. There is no such thing as taking a regular app and porting it to P2P. [1] https://getaether.net https://getaether.net
- faleidel 8y agoWow, the now version of Aether looks nice! I remember trying your project 3/4 years ago? I'll re-try Aether when I get home.
- rolleiflex 8y agoThank you! It’s been a long road. ;)
- rklaehn 8y agoNot sure what exactly you are looking for, but I find IPFS / libp2p pretty easy to use once you know the basic concepts. For a simple web based GUI app you can use the js version of IPFS or interact with a locally running go-IPFS node using a pretty simple REST api. Once you got your feet wet, or if you have a more demanding use case, you can use libp2p directly, from js, go or rust. Since you mentioned rust: https://github.com/libp2p/rust-libp2p https://github.com/libp2p/rust-libp2p libp2p could be described as an attempt to implement a common networking stack for the distributed web. IPFS builds on libp2p, as does filecoin. I work for a company https://www.actyx.io/en https://www.actyx.io/en that does industrial applications based on IPFS / libp2p, so I use IPFS every day. Obviously it is bleeding edge technology with a lot of rough edges. But I find the current state and the rate of improvement quite promising.
- fenwick67 8y agolibp2p looks useful but my problem with it (at a glance) has been, "how do I make this into a program?". When I look at a list of ~10 different modules, and let's say I want to implement a secure chat program, I have no idea where to start. Is there a good primer on something like this?
- rayvy 8y ago> "how do I make this into a program?". This! It looks unbelievably promising, but still very much a work in progress, with no deploy-able examples. Can't wait to see what it turns into though
- devttyeu 8y agoThere is a repo with simple examples to help get started - https://github.com/libp2p/go-libp2p-examples https://github.com/libp2p/go-libp2p-examples People in IRC channels - #libp2p @ freenode (or #ipfs) - should be able to answer most of your other questions (I work for PL, on go-ipfs and occasionally libp2p)
- jwhitlark 8y agoP2P isn't a single thing. But if you know more about what you want to do, you can usually find libraries to do it with. I recommend Indy's courses for getting the map of the territory: https://www.coursera.org/instructor/indygupta https://www.coursera.org/instructor/indygupta
- therein 8y agoI remember Indranil Gupta. He was my professor for Distributed Systems in college. He was also my academic advisor but that's just a symbolic thing at my college. Kinda like an "ask this professor stuff about the CS curriculum at this school if you feel like it" arrangement. He had early lectures but made them fun so I ended up not minding it. If the Coursera follows the same curriculum, I remember it being a pretty comprehensive introduction.
- jwhitlark 8y agoHow cool. I only know of him from these courses, but it was a fantastic intro and overview of distributed systems.
- nikhilsaraf9 8y agoI recently learned about Holochain which is a P2P framework for building scalable distributed apps. You may find it useful: https://holochain.org https://holochain.org
- joefourier 8y agoIf you want real-time data-transmission (for chat, audio or video), what about WebRTC? It's primarily intended to be used in browsers, but there's nothing theoretically preventing you from just using a Python library (e.g. https://github.com/jlaine/aiortc https://github.com/jlaine/aiortc ) that implements the protocols if you wanted.
- PhilippGille 8y agoNot just chat, audio and video. There's a data channel as well. Examples: - https://github.com/maxmcd/webtty https://github.com/maxmcd/webtty - https://github.com/rtctunnel/rtctunnel https://github.com/rtctunnel/rtctunnel
- GFischer 8y agoIt's not entirely P2P, you need a server for initial connectivity. But it's probably good enough for most P2P applications (I saw someone building P2P CDNs with it !!!)
- nielsbjerg 8y agoThis guy mad a lot of easy to use libraries https://github.com/mafintosh https://github.com/mafintosh in nodejs, so don't know if they are useful to you
- morphle 8y agoI would suggest https://www.tribler.org/IPv8/ https://www.tribler.org/IPv8/ has most features you need.
- notrhodey 8y agoThere is definitely plenty of things to play around with an experiment in the Dat ecosystem, however their Rust platform is still early stages. http://datproject.org/ http://datproject.org/ https://github.com/datrs https://github.com/datrs I'm working on a P2P app built atop Dat right now myself, archiving of police radio using software-defined radio and Dat Hypercores. Maybe the codebase can give you some ideas / inspiration, this is developer-preview level for sure: https://radiowitness.hashbase.io/ https://radiowitness.hashbase.io/
- mempko 8y agoI built one called Firestr. Check http://firestr.com http://firestr.com I didn't use a framework and built it from scratch. Maybe there is some code there that can help you understand how this stuff works. The whole app is an environment to make p2p apps in Lua with a built in editor. Not sure there is anything easier than firestr to build p2p apps. Check out the Lua code for some examples here https://github.com/mempko/firestr/tree/master/example_apps https://github.com/mempko/firestr/tree/master/example_apps
- sprucely 8y agoSeveral have been mentioned already, but I'll add one more rust library to the mix: https://github.com/maidsafe/crust https://github.com/maidsafe/crust
- rayvy 8y agoI actually emailed one of the contributors from crust and unfortunately the impression I got is that it's still very much a work in progress (but good if you want to actively contribute to the project I guess)
- kc1116 8y agoCheck out ZeroMQ
- kc1116 8y ago0MQ
- gammateam 8y agoOrbit-Db for IPFS Its just Node.js You won't be bottlenecked by the language if you are using P2P services. If you want threads, spin up another compute instance, and your provider will do that for you.
- rotund_ursine 8y agoDAT and IPFS
- max_ 8y agoHi there Ethereum has a suit of P2P platform like Swarm (https://medium.com/coinmonks/setting-up-a-multi-node-private-ethereum-swarm-network-without-a-blockchain-e3fd55873887 https://medium.com/coinmonks/setting-up-a-multi-node-private...) , an alternative to IPFS & Wisper for messaging they call Web3 As a rust dev I would recommend Rust-Web3 https://github.com/tomusdrw/rust-web3 https://github.com/tomusdrw/rust-web3
- villgax 8y agoCheckout WebRTC!
- zxcmx 8y agoLeft-field option; embed zerotier SDK. They do a better job selling it than I could: https://www.zerotier.com/blog/zerotier-sdk.shtml https://www.zerotier.com/blog/zerotier-sdk.shtml Probably some head-banging required to get it to link/load/run (I see there's an open ticket for Python). Would likely need to do a little bit of c/c++ to get that working properly. Benefit is, you would then never need to touch the p2p layer again and you could just be doing web development if that's your thing.
- usgroup 8y agoIf you’re not familiar with the principals of p2p generally and the kind of problems you get into I’d start with building a simple DHT based solution using something like the Chord protocol: https://en.m.wikipedia.org/wiki/Chord_(peer-to-peer) https://en.m.wikipedia.org/wiki/Chord_(peer-to-peer) This will teach you all about adhoc networking, routing, the limitations of different architectures and so on. You could also tackle a real use case like distributed key value storage as a learning device. What you’ll need ultimately will strongly depend on what you intend to build with it.
- really3452 8y agoIf you are interested in building p2p applications on top of block chains checkout http://github.com/geo-gs/sawwit http://github.com/geo-gs/sawwit *Disclaimer: Sawwit is one of my hobby projects
- j88439h84 8y agoNot quite finished, but by glyph https://github.com/twisted/vertex https://github.com/twisted/vertex