explore.ipld.io icon indicating copy to clipboard operation
explore.ipld.io copied to clipboard

Size reported by explorer different from ipfs object stat

Open lanzafame opened this issue 7 years ago • 1 comments

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?

lanzafame avatar Sep 24 '18 02:09 lanzafame

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.

olizilla avatar Aug 05 '20 20:08 olizilla