Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

docs: added some small verbage to the README for "Resolve through IPLD grap… #1253

Merged
merged 1 commit into from
Oct 27, 2018

Conversation

datafatmunger
Copy link
Contributor

@datafatmunger datafatmunger commented Mar 7, 2018

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

@@ -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
Copy link
Member

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

Copy link
Member

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?

Copy link
Member

@daviddias daviddias May 28, 2018

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.

@daviddias
Copy link
Member

@datafatmunger did you get my comment?

@datafatmunger
Copy link
Contributor Author

datafatmunger commented Apr 30, 2018

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.

@alanshaw
Copy link
Member

@diasdavid can you elaborate here or approve so we can merge and address changes at a later date?

@daviddias daviddias changed the title added some small verbage to the README for "Resolve through IPLD grap… docs: added some small verbage to the README for "Resolve through IPLD grap… May 29, 2018
@daviddias daviddias merged commit 89ca551 into ipfs:master Oct 27, 2018
@ghost ghost removed the status/in-progress In progress label Oct 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants