Is there an easy way to determine hash of directory «foo» and other pinned directories which contains this objects, if now we know only hashes of «bar» and «baz» (QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM and QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR)? Something like ipfs refs --reverse command.
(At least we can use this workaround: for hash in $(ipfs pin ls -q) ; do ipfs refs -e $hash | grep [hash] ; done, but maybe built-in solution available?)
The text was updated successfully, but these errors were encountered:
A "directory" is just a set of links to other hashes. It is not possible to include a ".." ref in the directory, because such a reference would introduce a cycle into the DAG. A hash is somewhat like a private key in that if you lose it, there is no general way to recover it (short of re-hashing the content). Your workaround is probably the best solution, if you don't want to store the parent hash in IPNS.
lockedshadow commentedFeb 15, 2016
First of all, apologize for my bad english. Hope that you can understand it.
For example, we created directory named «foo» and put to it files named «bar», «baz», then pinned them recursively by
ipfs addcommand, like this:And next we have result:
Is there an easy way to determine hash of directory «foo» and other pinned directories which contains this objects, if now we know only hashes of «bar» and «baz» (
QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMMandQmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR)? Something likeipfs refs --reversecommand.(At least we can use this workaround:
for hash in $(ipfs pin ls -q) ; do ipfs refs -e $hash | grep [hash] ; done, but maybe built-in solution available?)The text was updated successfully, but these errors were encountered: