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

Size reported by explorer different from ipfs object stat #40

Open
lanzafame opened this issue Sep 24, 2018 · 1 comment
Open

Size reported by explorer different from ipfs object stat #40

lanzafame opened this issue Sep 24, 2018 · 1 comment

Comments

@lanzafame
Copy link
Contributor

Size reported in explorer:
1537757188
Size reported from ipfs:
1537757174

This may or may not be a bug, my question though is how is the size determined by the explorer? Is it a combination of things or something else entirely? Or have I just used the wrong ipfs command?

@olizilla
Copy link
Member

olizilla commented Aug 5, 2020

It always returns the value of node.size for a dag-pb node

https://github.com/ipfs-shipyard/ipld-explorer-components/blob/a2415f2ebf6928c21bd430443422b350a2220053/src/lib/normalise-dag-node.js#L53

Looking at the latest code for js-ipfs that seems like it should be updated to take into account the unixfs data, and either return 0 for directories or the value of unixfs.fileSize()

https://github.com/ipfs/js-ipfs/blob/7aba8354134d0d1d8132892c338b474e20e56b76/packages/ipfs/src/core/components/files/stat.js#L76-L91

though that gets to the heart of the question, perhaps, as this is the ipld explorer it should show both the dag node size (as currently) and the unixfs size.

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

No branches or pull requests

2 participants