'ipfs object stat' is a plumbing command to print DAG node statistics. is a base58 encoded multihash.
If given hash is valid, it returns some information (if and only if shared node's ipfs daemon
is on).
$ ipfs object stat QmNd4PHGU8Z7fwbEvps5jvVscCDd5husnNgKpaDCfm1tpt
NumLinks: 0
BlockSize: 39
LinksSize: 2
DataSize: 37
CumulativeSize: 39
Now I try it with an invalid hash or node (which shares the ipfsHash)'s ipfs daemon
is off: I observe that the command halts.
$ ipfs object stat QmNd4PHGU8Z7fwbEvps5jvVscCDd5husnNgKpaDCfm1t88 #invalid hash
#waits.
If I enter an invalid has into ipfs object stat
it pauses. I can do timeout N
to terminate it: But I am not sure how long should I wait.
timeout 30 ipfs object stat QmNd4PHGU8Z7fwbEvps5jvVscCDd5husnNgKpaDCfm1t88
Overall, I just want to check does given ipfs-hash
exists for me to retrieve its information.
[Q] Is there any optimal time for me to wait until ipfs object stat <ipfsHash>
returns a valid value or not? Would around 30 seconds to wait be enough?
Please note that: I tried between node in Europe and node in States, it took around 120 seconds on first try. But after I assume a path route is generated between those nodes, my next try with different hash between same nodes takes less than a second. What might be the reason for this?
Thank you for your valuable time and help.