News for hackers. Stuff that matters.
Re:IPFS is the Distributed Web by TimJRobinson on Sunday October 23, 2016 @04:39AM (#12772613)
So I've been thinking about creating a basic site running on IPFS and here's my dillema. The hash of each page is a sha256 of the contents right? So lets say you have 3 pages A, B and C, A links to B, B links to C, C links to A. How do you create all 3 pages with correct links to each other?

When you create page A you have to have the SHA of page B, but then to create page B you have to have the SHA of page C and finally to create it you need the SHA of page A. You get into this cyclical loop where you can't generate any page and link to others. What is the solution to this problem?

Re:IPFS is the Distributed Web by kirushik on Sunday October 23, 2016 @05:01AM (#12772666)
Well, IPFS allows you to upload trees of files to a single IPFS node. So you just create three webpages, put them into a single folder and use `ipfs add` on this folder. Your webpages will be available with relative links, being exposed at addresses like `/ipfs/<Sha>/page_a.html` and `/ipfs/<Sha>/page_b.html`.

Under the hood those pages will be standalone ipfs Duke nodes with separate hash addresses, and your root folder will be actually a set of pointers to those hash addresses — but you don't need to keep that in mind when uploading a site.

Re:IPFS is the Distributed Web by kirushik on Sunday October 23, 2016 @05:04AM (#12772673)
One can also study ipfs project websites (ipfs.io, dist.ipfs.io and so on). Those are just static bunches of files (html and resources) hosted in ipfs and served with a standard ipfs gateway (located on gateway.ipfs.io address). Gateway just looks up _dnslink TXT records for corresponding domains, and serves files from the ipfs hash address specified there.
Re:IPFS is the Distributed Web by avodonosov on Sunday October 23, 2016 @04:55AM (#12772650)
Two pages would be enough for that example
Re:IPFS is the Distributed Web by nicolagreco on Sunday October 23, 2016 @10:44AM (#12773763)
This is about IPLD (so data linking to each other instead of files, but the concepts are the same): https://github.com/ipfs/pm/blob/master/meeting-notes/2016-09...

Also, you can use relative paths :P

Re:IPFS is the Distributed Web by solipsism on Sunday October 23, 2016 @04:58AM (#12772664)
I just googled "ipfs cyclic link" and the answer is in the first result. How long have you been thinking about this "dilemma"?