Can anyone be bothered to explain to me how this works?
I know that IPFS is some sort of distributed content-addressable thingy. So I expected that ipfs.io would deliver some JS to my browser, which would get it to look-up some distributed hash table in order to find peers with the content (a la torrents).
However I'm not running JS and that page loads just fine. So how does it work?
The ipfs.io url is a public IPFS gateway, ie. bunch of IPFS nodes running on servers and "caching" content to be served through that domain. From that perspective, you're not accessing the content through the IPFS protocol but through http like any website. It's a public service operated by the IPFS community, but underneath it does all the "...get it to look-up some distributed hash table in order to find peers with the content (a la torrents)".
However, if you install the IPFS client (https://dist.ipfs.io/#go-ipfs), you can get the blog post peer-to-peer through IPFS by running `ipfs get QmY2LufsW3v6AfxTTkp6SGqDGa5AeJhSZXH8RSsdiao4Ds`. Note how the hash in the ipfs.io url is the hash of the content stored in IPFS.
I think it depends on what the use case for IPFS is. Many use it "server-side" to just transfer and store files, so a "native client" makes a lot of sense. The IPFS devs always recognized the importance of the browser though and as such js-ipfs (https://github.com/ipfs/js-ipfs) has always been a first-class implementation of IPFS. With js-ipfs, the IPFS protocol works in the browser and can be embedded to JavaScript applications in a way that doesn't "require a new client".
Highly recommend to read into IPFS and how it works to understand the various use cases and possibilities. A good starting point would be https://ipfs.io/ and https://github.com/ipfs/ipfs.
There is already a Javascript implementation [1], but it is not feasible to setup a full IPFS node in every browser tab that loads an IPFS resource. Instead you can use ipfs-companion [2], a browser extension that lets you easily load IPFS resources in your browser. While it can use the Javascript implementation, this is not recommended as it is currently pretty resource heavy [3].
Very interesting stuff ,
I'm following ipfs for a while now , and using the browser sessions as full nodes is an exciting idea.
One thing I wonder about ,
Is the browser -> ipfs node communication can be done via webrtc (I think the post refer to websocket)?
So the data sync can happen between browsers .
I did play with webtorrent for a while , and achieved a similar behavior using webrtc .
I had one nodejs server , and multiple browser sessions .
It worked well for video streaming peer to peer (poc level )
Browser IPFS to desktop IPFS communication can happen via websockets or webrtc right now, since those are the transports the browser currently offers us.
The stack we're using for networking is libp2p, a peer-to-peer framework, which has bunch of implementations for different transports. You can see the full list of those here: https://libp2p.io/implementations/#transports
Currently, most browser-apps using IPFS prefers websockets as it's using a lot less resources compared to webrtc, but once webrtc-quic[0] is ready for prime-time, it would be easy to write a transport for that and hopefully will be a lot more efficient than the current webrtc implementations.
I doubt the usefullness of orbitDb. Ipfs-nodes only store and distribute content which they have accessed before. When you have a database with user-based data, noone except yourself will distribute it. This means you could have the same distribution with plain webrtc instead of height-ping ipfs.
It's true that availability is not "automatic" as per the software itself (rarely is in P2P networks). To make sure the data stays online (whether IPFS or OrbitDB), one needs to make sure there are enough nodes serving the data. In OrbitDB the replication protocol will make sure the full database is downloaded and served upon opening the database and as all db-data is IPFS-data, the db will be served just like any content on IPFS. So for example, for an application built with OrbitDB and IPFS, one would probably want to run some nodes themselves to "pin" (IPFS parlance) the databases and serve them to the network.
Not quite. The data structures for the "database" part are more complex than a single json structure. Each update to the database is an "individual json" which get linked together using an append-only log CRDT (https://github.com/orbitdb/ipfs-log) and you'd essentially serve that log. So instead of "one big json", it's "many small jsons" and the state (view) of the database gets calculated from those small jsons.
Although with webrtc you still need a signaling server and a turn/stun server. It would be interesting to try getting the webrtc stack to work fully serverless by using js-ipfs to exchange ip for stun and then do signaling using js-ipfs with websockets. Then you could open up peer channels to exchange data without using js-ipfs but by using it for the initiation and signaling layers you could potentially setup a pure p2p video chat system or file sharing system.
True, currently we always need some sort of signalling server to be able to connect to browser<>browser peers but once you done that, you can connect directly to other browsers (truly P2P in the browser).
Now, if we can have js-ipfs and go-ipfs nodes on desktop automatically act as signalling servers (if you start with a `--server` flag or something), we'll be able to decentralize the need for signalling servers as well, and remove another point of centralization. Getting us closer to the goal as well.
Maybe in the future we'll be able to have TCP/UDP sockets in the browser, but we'll see when/if that happens.
It’s too bad that the flowering of distributed hash table / content-addressable storage research & development nearly precisely coincided with Internet Explorer’s ossification of web standards, or maybe we’d have had something like IPFS built into every browser 15 years ago.