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
36 comments
[ 6.8 ms ] story [ 71.2 ms ] threadWhat 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/
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?
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.
There's a nice p2p and kappa database primer here: https://github.com/kappa-db/workshop
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
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
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 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.
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?
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
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)
I recommend Indy's courses for getting the map of the territory: https://www.coursera.org/instructor/indygupta
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.
Examples: - https://github.com/maxmcd/webtty - https://github.com/rtctunnel/rtctunnel
But it's probably good enough for most P2P applications (I saw someone building P2P CDNs with it !!!)
http://datproject.org/ 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/
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
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.
As a rust dev I would recommend Rust-Web3
https://github.com/tomusdrw/rust-web3
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.
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.
*Disclaimer: Sawwit is one of my hobby projects