What CIDs can I provide?

I want to see what CIDs am I storing and what CIDs can I provide?

And I am aware of the DHT concept and how IPFS uses DHT.
So I want to see my local DHT.

Let’s say I get a request for a specific CID that I can provide info about. So where is this info stored? I want to see this info.

Can someone please help me with this.

Thanks alot I appreciate it!

1 Like

If you want the list of blocks you’re storing, ipfs refs local will list them.

If you want the list of provider records you’re hosting, go-ipfs doesn’t provide command to access this information. You’d have to write some code.

Yes I want to see what CIDs I am storing.
Like I want to see what CIDs can my node provide.

I am willing to write some code.
Can you please help me out with that or atleast provide some pointers or directions to guide me.

Thank you.

Yes I want to see what CIDs I am storing.
Like I want to see what CIDs can my node provide.

Please be more specific.

  1. Data you have: Are you wondering which blocks (pieces of data) your node will provide over bitswap?
  2. Data you know about: Which pieces of content your node will help others find (provider records).

Can you please help me out with that or atleast provide some pointers or directions to guide me.

The provider logic lives in:

You’ll need to query the datastore for everything that starts with /providers/. See feat: .GetAllProviders func by daviddias · Pull Request #493 · libp2p/go-libp2p-kad-dht · GitHub for a past attempt at this.

Unfortunately, you’ll mostly be on your own here.

  1. Data you have: Are you wondering which blocks (pieces of data) your node will provide over bitswap?

I believe this can be done via this command: ipfs refs local
Is that correct?

  1. Data you know about: Which pieces of content your node will help others find (provider records).

Yes this is what I am looking for.
You know how each node has a table where they store information about CIDs and other peers, that is what I want to see.
For example: there is a specific CID that my node is storing, and then your node requests for that specific CID, and then my node will provide it.
So I want to see where is my node storing that CID along with other CIDs.
Does that make it clearer for you?

Thanks alot for your help I really appreciate it.

Got it.

  1. Data you have: Are you wondering which blocks (pieces of data) your node will provide over bitswap?

I believe this can be done via this command: ipfs refs local
Is that correct?

Yes.

  1. Data you know about: Which pieces of content your node will help others find (provider records).

Yes this is what I am looking for.
Does that make it clearer for you?

Yes. Those DHT links I posted should get you started there.