Number of nodes carrying a data

When i upload a file on ipfs ,is there a way i can know the number of nodes carrying my file in the network.

The system that keeps track of who has what is the DHT (=distributed hashtable). So if you have a hash, e.g. zdpuArQ67gWT3jQc1F5moD8EZ32cwJNVycQ831uV4ZjJCTT8o) and want to know who has it, use ipfs dht findprovs. You will get back a list of all nodes (providers) that have the data for that hash.

Note that the answer is not authorative but just a best guess. E.g. if there is a slow node in a remote corner of your ipfs network, it might not answer in time.

$ ipfs dht findprovs zdpuArQ67gWT3jQc1F5moD8EZ32cwJNVycQ831uV4ZjJCTT8o
QmPgJooiXNDGWE6QGWhks935n8DiTP7ysH8wezAbkCrND7
QmU7sL2umzzA41sACzS2dgFDMvgNfJ1SVXP3xFvfBqCMmG
QmWRne66pWjazu5AMjqj1ChWDPxyYzfmFB7mJUhsStZJ1i
Qma3Ai1n7ddnQs8MKdnMuaWAm7Vz1QWhisME2z1JteFKRQ
QmcUQVF7VY8GEie4ZKoMpnKRNMB93KG5p6eRmajrGeaE9T
QmZyHWn8A4i6KEWysVtUpUnfDE6gbZExrVDtozFfkZdWyi
2 Likes

To head off any confusion, you don’t really “upload” data to IPFS. Instead, you add it to your local IPFS node and then tell the network that you have the data. Other nodes won’t store it unless they choose to download the data for some reason (and even then, they’ll probably delete it after some period of time).

1 Like