ipfs-deploy icon indicating copy to clipboard operation
ipfs-deploy copied to clipboard

Use the git data structure directly rather than importing to IPFS

Open daviddias opened this issue 6 years ago • 1 comments

As an idea for consideration: What if you don't have to convert your files into MerkleDAGs and just used the git structure directly?

One of the cool tricks that IPFS can do is resolve any kind of hash linked data structure. This means that you can save the users a step by avoiding the ipfs add and instead just resolve the git hash as a file system and resolve the published version of the website as the git hash.

With this, then to load any website, effectively you would just need to do something such as ipfs.io/git/<githash> and IPFS would resolve and distribute it through the network.

If this all sounds like jibba jabba at first glance, I do have some urls to clarify, namely:

  • The IPLD Talk that explains the idea beyond the InterPlanetary Linked Data
  • Traversing IPLD graphs examples. These examples show how to pick traverse nodes from a graph, including git graphs.
  • IGiS, the InterPlanetary Git Service. A Web app that allows you to traverse git repos that are fetched through IPFS (note: apparently the version that is published has some spider webs to be cleaned up, I've ping @magik6k (the author) to see if he can check in) (note2: I also know that @magik6k has multiple recorded demos, once I find them, I'll link them here :))

daviddias avatar May 21 '19 16:05 daviddias

I had some vague idea about IPLD but I didn't think it could be as easy as /git/githash. This is really cool!

In the case of SSGs like Gatsby, the build files aren't usually committed to the repo. I don't see why not do it though, or maybe have a separate repo for build files. That would make the whole deployment history/rollback thing a lot easier.

I would still like ipfs-deploy to work with normal files or browser-based content in the future, so don't want to make git a hard dependency. But we can certainly detect its presence and provide better integration.

I didn't know about IGiS, but something like it has been on my mind for a long time. Very exciting!

I've been meaning to work a graphql interface on top of isomorphic-git to make it easier to generate a github-like web view of a repository with Gatsby (and to add git metadata to websites as well such as pulling creation and last update dates from git instead of duplicating them in the frontmatter; and showing edit history in a friendly, wiki-like way). I haven't played with IGiS yet but I really like the direction it's going!

agentofuser avatar May 22 '19 02:05 agentofuser