# What CIDs can I provide?

**URL:** <https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854>\
**Category:** Uncategorized\
**Tags:** go-ipfs, ipfs-cluster, libp2p, dht, ipfs-call\
**Created:** [July 29, 2021, 3:07pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854 "2021-07-29T15:07:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaheerbakali](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/shaheerbakali/32/5216_2.png) [@shaheerbakali](https://discuss.ipfs.tech/u/shaheerbakali)\
**Post date:** [July 29, 2021, 3:07pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/1 "2021-07-29T15:07:37Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![stebalien](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/stebalien/32/156_2.png) [@stebalien](https://discuss.ipfs.tech/u/stebalien)\
**Post date:** [August 2, 2021, 4:42pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/2 "2021-08-02T16:42:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shaheerbakali](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/shaheerbakali/32/5216_2.png) [@shaheerbakali](https://discuss.ipfs.tech/u/shaheerbakali)\
**Post date:** [August 2, 2021, 4:53pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/3 "2021-08-02T16:53:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stebalien](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/stebalien/32/156_2.png) [@stebalien](https://discuss.ipfs.tech/u/stebalien)\
**Post date:** [August 2, 2021, 5:11pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/4 "2021-08-02T17:11:31Z")

</div>

> 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:

> <https://github.com/libp2p/go-libp2p-kad-dht/blob/3cefab2d2376cdb98d2011067265b7783500278e/providers/providers_manager.go#L1>

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](https://github.com/libp2p/go-libp2p-kad-dht/pull/493) for a past attempt at this.

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

---

<div class="post-metadata">

**Author:** ![shaheerbakali](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/shaheerbakali/32/5216_2.png) [@shaheerbakali](https://discuss.ipfs.tech/u/shaheerbakali)\
**Post date:** [August 2, 2021, 5:44pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/5 "2021-08-02T17:44:04Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![stebalien](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/stebalien/32/156_2.png) [@stebalien](https://discuss.ipfs.tech/u/stebalien)\
**Post date:** [August 2, 2021, 5:53pm UTC](https://discuss.ipfs.tech/t/what-cids-can-i-provide/11854/6 "2021-08-02T17:53:22Z")

</div>

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.
