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

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