How does IPFS work offline?

I don’t exactly understand when it says “IPFS works offline”. Can anyone elaborate for me?

Where are you getting the quote that “IPFS works offline”? I’d be interested to know the context.

There are two ways I’m aware of that it works offline.

  1. If you’ve accessed a piece of content over IPFS and it’s still cached on your node, you can access it exactly the same way as before with no network connection

  2. If you have a subset of IPFS nodes that can connect to each other but not to the Internet, IPFS will still work

1 Like

It’s in the whitepaper of Filecoin.

IPFS has proven the utility of content-addressing by decentralizing the web itself, serving billions of files used across a global peer-to-peer network. It liberates data from silos, survives network partitions, works offline, routes around censorship, and gives permanence to digital information.

Could you elaborate the second point? What are possible ways to connect without the Internet?

An example would be computers on a LAN. They don’t require a connection to the Internet in order for IPFS to work between them. Another example could be computers in a mesh network that doesn’t have a connection to the Internet.

How does an ipfs mesh network work? I can’t find anything about it. It would need different bootstrap servers, and a local DHT I would think. I didn’t know that it was possible.

Mesh networks aren’t specific to IPFS (example). The general theme is that don’t rely on centralized ISPs and instead rely more on P2P connections. Even in more traditional networks if someone disables connections leaving a country to the larger internet but the computers within the country can communicate with each, I think it could be said that those computers within the country are offline in a sense.

Any node can act as a bootstrap node. If something is added to save peers you’ve seen before as potential bootstrap servers for later (which I think I’ve seen an open issue for) instead of relying on the ones hosted by Protocol Labs, then nodes wouldn’t even necessarily need access to the default bootstrap nodes and things would be more likely to automatically keep working. Otherwise, users would need to manually point to an ad-hoc bootstrap node they can reach.

1 Like

Thanks! That makes more sense. That save peers thing sounds good, do you have a link? It seems it would be very useful for that to be enabled by default on nodes.

Agreed! Here’s the GitHub issue for it: https://github.com/ipfs/go-ipfs/issues/3926.

It might not be what the document writer meant, but I also imagine it to mean that if you create a site or file and add it to ipfs, and other nodes host it, then it will remain available even when the originating node is offline, so long as at least one other node continues to host it during that time.

Thanks! I was thinking, if I was running an offline mesh network, and could just redirect all bootstrap node requests to redirect to my local node I’m using for bootstrapping the mesh. A bit hacky, but it should work.

You can just add the local address of your node as a bootstrap node address in the config file.