3 ms·
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 yo
by TimJRobinson 10y ago
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?
- avodonosov 10y agoTwo pages would be enough for that example
- solipsism 10y agoI just googled "ipfs cyclic link" and the answer is in the first result. How long have you been thinking about this "dilemma"?
- kirushik 10y agoWell, 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.
- kirushik 10y agoOne 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.
- deleted 10y ago[deleted]
- nicolagreco 10y agoThis 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-12-IPLD-refining-call-2.md#application-level-cycles https://github.com/ipfs/pm/blob/master/meeting-notes/2016-09... Also, you can use relative paths :P