-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs: added some small verbage to the README for "Resolve through IPLD grap… #1253
docs: added some small verbage to the README for "Resolve through IPLD grap… #1253
Conversation
…hs" with the dag API related to git
@@ -18,6 +18,9 @@ This tutorial goes through several operations over IPLD graphs using the [DAG AP | |||
## [traverse through a slice of the ethereum blockchain](./eth.js) | |||
|
|||
## [traverse through a git repo](./git.js) | |||
The example objects contained in "git-objects" have already been decompressed with zlib. An example of how to do this: | |||
|
|||
$ cat .git/objects/7d/df25817f57c2090a9568cdb17106a76dad7d04 | zlib-flate -uncompress > 7ddf25817f57c2090a9568cdb17106a76dad7d04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the jsipfs block put
with respective arguments. //cc @vmx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diasdavid Did you mean jsipfs dag put
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did really meant block put
as what @datafatmunger is doing is putting an already serialized node from git into ipfs, therefore block put
rather than dag put
which would try to serialize it again.
Essentially, what I'm suggesting is to show how to do this step -- https://github.com/datafatmunger/js-ipfs/blob/3ea1a195ec04d0be2da8abe6d543a553764e5d5c/examples/traverse-ipld-graphs/git.js#L41 -- through the CLI.
@datafatmunger did you get my comment? |
I did. I just don't quite understand it. :-) Your tutorial included already decompressed git object files, so I was just including instructions on how someone could create similar files. Following your comment ... I could, of course, put a block on ipfs ... but then I lose the ipld data structure, no? Maybe jsipfs is now doing something like the go ipfs extension in mentioned in the irc thread pasted above with the "-f git" arguments, and maybe that's what you mean in your comment: "with respective arguments", but I don't know what those arguments are. |
@diasdavid can you elaborate here or approve so we can merge and address changes at a later date? |
datafatmunger vmx & daviddias i realized the folly of my earlier attempts of the ipld git tutorial was that the files in the git-objects directory of the example have already been decompressed via zlib ... i should have cat'd those files hours ago, but since they have hash names i assumed they came strait out of .git/objects :-P
daviddias datafatmunger: oh, that should be part of the README of the example. Wanna add that step?
vmx datafatmunger: do i understand correctly that git objects or compressed by default and you need to uncompress them before you use them with ipfs/ipld?
datafatmunger yes they are compressed by default ...
...
datafatmunger and need to be decompressed before the tutorial
datafatmunger the plugin method i used from magik6k, however ... does do the zlib step
datafatmunger ipfs dag put -f git --input-enc zlib .git/objects/7d/df2..
datafatmunger in any case: cat df25817f57c2090a9568cdb17106a76dad7d04 | zlib-flate -uncompress gitobject
datafatmunger will give a text file format that works with your tutorial
...
datafatmunger daviddias i'll try to make a pr for the readme