How do one store its data on peer nodes

Hello,

I joined IPFS p2p network by running “ipfs daemon” for 3 hours.
I added some log in the flatfs datastore codes.
From my own logging, I can see I received a lot of “GetSize” requests, which all return -1. I think this is because many other peers are trying to check if my node has the data that they want.

However, I never receive “Put” requests during those 3 hours. So I assume no peer tries to store their data on my node.
This is weird to me because I thought peers can request to store data on each others’ nodes in this distributed network.

So my questions is:
If I want to store my data on a peer node, how should I do that and what will happen?

Thanks,
Meng

This is incorrect. You only store data that you access. So for another node to store your data, you’d have to have data they’re interested in, and once they retrieve it, that data will be re-served on their node until garbage collection. If another node pins your data or adds it to their MFS, it will be retained through garbage collection.

I hope that helps :slight_smile:. Feel free to ask more questions, happy to help!

1 Like