Now I search for its blocks using grep on a specific key phrase in the website:
$ grep -r 'What can we do with a Kalman filter?' $IPFS_PATH
/media/c/ipfs/blocks/WN/CIQFFZSHMIPQ7E32O3JAFHRWBBGANG5FQ33R3ACS72ZMJEM5PZBSWNI.data:<h1>What can we do with a Kalman filter?</h1>
I get a hit, some IPLD object with the name CIQFFZSHMIPQ7E32O3JAFHRWBBGANG5FQ33R3ACS72ZMJEM5PZBSWNI.data.
Is there a simple way to get the content that sharded into this object? Specifically, I’d like to get the original IPFS address, QmdLSyPnQLiVk1wy91tZvhVfqbFbD7zSCuRtC51Z9yeY8E which corresponds to the content.
Please note that if you adding a file, the data is encoded and chunked into smaller pieces.
Though if you know to know the Multihash of a certain block that it stored on disk, you can do that. The blocks on disk are the base32 representation of the Multihash (which is currently base58 encoded by default). So you can just do the reverse:
A second-part to this question. Once I have the Multihash of a block that is a chunk, how can I determine the parent Multihash that it was chunked from? Or more practically, how can I find the other chunks that comprise the rest of this particular content?
Nodes don’t reference their parents, so I believe you’d have to brute-force it and search all the nodes you have for those that reference the unencoded multihash.
Though, if you had pinned the original file, you could have used ipfs pin ls --type=recursive to list all top-level objects you have pinned.