Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dag visualized as a tree #5

Merged
merged 7 commits into from
Aug 20, 2015
Merged

dag visualized as a tree #5

merged 7 commits into from
Aug 20, 2015

Conversation

jbenet
Copy link
Contributor

@jbenet jbenet commented Aug 20, 2015

e27f6a4 (Juan Batiz-Benet, 3 minutes ago)

optional newline in regex (daemon changed)

ffdb0b2 (Juan Batiz-Benet, 14 hours ago)

added all-versions

a383961 (Juan Batiz-Benet, 14 hours ago)

Makefile now builds before publish

e44b51a (Harlan T Wood, 2 months ago)

debugging

License: MIT Signed-off-by: Harlan T Wood <code@harlantwood.net>

107ec66 (Harlan T Wood, 3 months ago)

rename variable

License: MIT Signed-off-by: Harlan T Wood <code@harlantwood.net>

6021cea (Harlan T Wood, 3 months ago)

Tree-shaped visualization of IPFS DAG.

License: MIT Signed-off-by: Harlan T Wood <code@harlantwood.net>

1e5b0a2 (Harlan T Wood, 3 months ago)

D3 + D3 tree example + license

harlantwood and others added 7 commits June 6, 2015 14:58
License: MIT
Signed-off-by: Harlan T Wood <code@harlantwood.net>
License: MIT
Signed-off-by: Harlan T Wood <code@harlantwood.net>
License: MIT
Signed-off-by: Harlan T Wood <code@harlantwood.net>
@jbenet
Copy link
Contributor Author

jbenet commented Aug 20, 2015

@harlantwood i'm going to merge this one -- fixed a newline thing and improved the makefile. thanks again!

jbenet added a commit that referenced this pull request Aug 20, 2015
dag visualized as a treee
@jbenet jbenet merged commit 36d1536 into master Aug 20, 2015
@jbenet jbenet deleted the tree-ltr branch August 20, 2015 16:31
@jbenet
Copy link
Contributor Author

jbenet commented Aug 20, 2015

to try it out, see: http://gateway.ipfs.io/ipfs/QmVppgFNC8TCJg3zJmSebFtZAJRSw1pS8seuYVstbzEW78/viz#QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D

(but not yet-- @lgierth looks like we haven't deployed the readable-API changes? thought we had? cc @krl)

@jbenet jbenet changed the title dag visualized as a treee dag visualized as a tree Aug 20, 2015
@ghost
Copy link

ghost commented Aug 20, 2015

@krl pinged me about that a couple of days ago and the gateways are running this commit since then: ipfs/infra@dd11325

@ghost
Copy link

ghost commented Aug 20, 2015

Hrm except they don't...

@jbenet
Copy link
Contributor Author

jbenet commented Aug 20, 2015

explorable dag, looks very cool!!!

(the ipfs dataviz tree stored on an ipfs tree, visualized as a tree on ipfs)

@ghost
Copy link

ghost commented Aug 20, 2015

Nevermind, the gateways do run ipfs/kubo@fbac820 as expected

@jbenet jbenet mentioned this pull request Aug 20, 2015
@krl
Copy link

krl commented Aug 20, 2015

@lgierth This is what i get:

http://gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/cat?arg=%2Fipns%2FQmReJX55vhC5HbkBEZFW9V37vvirR1E7s2JW63cRt23BiN&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/object/get?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/id?stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)
http://gateway.ipfs.io/api/v0/object/get?arg=%2Fipns%2FQmReJX55vhC5HbkBEZFW9V37vvirR1E7s2JW63cRt23BiN&stream-channels=true Failed to load resource: the server responded with a status of 403 (Forbidden)

@krl
Copy link

krl commented Aug 20, 2015

The id should fail of course

@jbenet
Copy link
Contributor Author

jbenet commented Aug 20, 2015

maybe an nginx route missing?

@ghost
Copy link

ghost commented Aug 20, 2015

I know, I get the same.

This seems to work fine though:

curl -v 'gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true'

and also works if I directly request it in the browser: http://gateway.ipfs.io/api/v0/cat?arg=%2Fipfs%2FQmZTR5bcpQD7cFgTorqxZDYaew1Wqgfbd2ud9QqGPAkK2V&stream-channels=true

Not sure what's happening, maybe a lack of CORS headers or something like that?

@ghost
Copy link

ghost commented Aug 20, 2015

Mh no, it must be nginx yielding a 403 for some reason.

@jbenet
Copy link
Contributor Author

jbenet commented Aug 20, 2015

oh it might be CORS, not sure. see the updated docs on ipfs daemon:

> ipfs daemon --help
<snip>

    HTTP Headers

    IPFS supports passing arbitrary headers to the API and Gateway. You can
    do this by setting headers on the API.HTTPHeaders and Gateway.HTTPHeaders
    keys:

        ipfs config --json API.HTTPHeaders.X-Special-Header '["so special :)"]'
        ipfs config --json Gateway.HTTPHeaders.X-Special-Header '["so special :)"]'

    Note that the value of the keys is an _array_ of strings. This is because
    headers can have more than one value, and it is convenient to pass through
    to other libraries.

    CORS Headers (for API)

    You can setup CORS headers the same way:

        ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
        ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
        ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'


    DEPRECATION NOTICE

    Previously, IPFS used an environment variable as seen below:

       export API_ORIGIN="http://localhost:8888/"

    This is deprecated. It is still honored in this version, but will be removed in a
    future version, along with this notice. Please move to setting the HTTP Headers.

@krl
Copy link

krl commented Aug 20, 2015

@harlantwood harlantwood mentioned this pull request Aug 20, 2015
2 tasks
@harlantwood
Copy link
Contributor

Awesome, looks like this is working on the gateway now : )

@jbenet
Copy link
Contributor Author

jbenet commented Aug 26, 2015

@harlantwood nice!

btw, looks like the dag is unixfs aware? (i.e. distinguishes files and dirs). so i cant use it to visualize file chunking algorithms. it may be worth not distinguishing unixfs, and just showing the raw dag (i.e. files have links too)

@harlantwood
Copy link
Contributor

Not on purpose ; )

It's pulling all refs from the refs api call: https://github.com/ipfs/dataviz/pull/5/files#diff-aab1e940c09e6ef405d72f6e75b9a432R15

Is that call suppose to be unixfs aware?

We are switching over to using the ipfs node api lib, and the ls command from that, in another viz. We could move this D3 viz to that too, if that call is better behaved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants