How can IPFS support cyclic content?

From @magcius on Thu Jun 02 2016 15:33:28 GMT+0000 (UTC)

Let’s say I want to host a website on IPFS and have two web pages, and both of them link to each other.

Since IPFS is content-addressed, that means that each page’s link would have to be a link to the other page’s hash, correct? And since the other web page links to me, I have to find two dependent fixed points of hashes…

I didn’t see any way of doing name to content mapping in IPFS, which is the system that Freenet, etc. all use to solve this problem.


Copied from original issue: https://github.com/ipfs/faq/issues/129

From @harlantwood on Thu Jun 02 2016 15:41:29 GMT+0000 (UTC)

Check out IPNS: https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/QmQwAP9vFjbCtKvD8RkJdCvPHqLQjZfW7Mqbbqx18zd8j7/ipns/readme.md

From @magcius on Thu Jun 02 2016 15:52:13 GMT+0000 (UTC)

Yes, I saw that, but since you only get a single blob per name, I didn’t think it was intended for this use case, but simply to point to an index file. Additionally, you don’t get content permanence — the thing I link to would be the latest version of whatever I publish at my webpage, not the hash at the time of upload.

I was imagining a system where: the entire bundle was the content-addressed unit, and links happened in there based on name. So my website would be the content-addressed, hashable unit, and all HTML pages, bundled resources, etc. would be identified by relative links inside that.

But maybe that’s not how IPFS wants to work.

From @harlantwood on Thu Jun 02 2016 16:17:13 GMT+0000 (UTC)

Works as long as you have relative links, eg: https://ipfs.io/ipfs/QmavE42xtK1VovJFVTVkCR5Jdf761QWtxmvak9Zx718TVr/index.html

From @whyrusleeping on Thu Jun 02 2016 17:33:44 GMT+0000 (UTC)

@magcius relative links in webpages work just fine. the ipfs.io webpage is actually served through ipfs via /ipns/ipfs.io

From @wking on Thu Jun 02 2016 17:39:55 GMT+0000 (UTC)

On Thu, Jun 02, 2016 at 10:33:45AM -0700, Jeromy Johnson wrote:

@magcius relative links in webpages work just fine. the ipfs.io
webpage is actually served through ipfs via /ipns/ipfs.io

This breaks the “my IPFS tooling can walk the graph” without teaching
your tooling about HTML. But if the HTML links only point inside a
directory structure, then being able to walk an IPFS directory
structure is sufficent for a complete snapshot and @magcius’ content
permanence.