# How to listen to DHT communication

**URL:** <https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038>\
**Category:** Help\
**Tags:** dht\
**Created:** [May 20, 2020, 9:16pm UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038 "2020-05-20T21:16:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [May 20, 2020, 9:16pm UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/1 "2020-05-20T21:16:15Z")

</div>

Hi all…I am trying to see activities around the DHT, I am assuming that if a node holds a content it needs some way to pass this information out to the rest of the network. And I am guessing this starts by telling its peers. I would like to see this communication.

What I have tried is to run `ipfs log tail` while I add contents to a node, pin it and access it from another node. Doing this, I see entries in the log stream of `BlockService.BlockAdded` and `BlockService.BlockFetched` but nothing about a node telling another node that it has some contents

Any ideas on how I can see the DHT communications? Specifically where a node tells it’s peers that certain CID can be retrieved from it?

---

<div class="post-metadata">

**Author:** ![adin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/adin/32/2679_2.png) [@adin](https://discuss.ipfs.tech/u/adin)\
**Post date:** [May 20, 2020, 9:57pm UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/2 "2020-05-20T21:57:42Z")

</div>

@dadepo what you are looking for is DHT Provides.

Depending on what level of granularity you are looking for you can either look at logs coming from the provider/reprovider subsystems in IPFS (log subsystem names can be seen in `ipfs log ls`). Alternatively, you could look at the DHT logs.

I would use `ipfs log level <subsystem> debug` and monitor the outputs coming out of the daemon.

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [May 21, 2020, 4:05am UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/3 "2020-05-21T04:05:03Z")

</div>

Does not seem to have the desired effect. So what i did. Ran the following:

```auto
ipfs log level providers debug
ipfs log level provider.simple debug
ipfs log level provider.queue debug

```

Then I monitor the log by doing `ipfs log tail` still no DHT providers related info is seen. When you say

> [@adin](#):
>
> monitor the outputs coming out of the daemon.

I am guessing you mean `ipfs log tail` or is there another way?

---

<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:** [May 21, 2020, 5:06am UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/4 "2020-05-21T05:06:26Z")

</div>

Unfortunately, we have _two_ logs at the moment. `ipfs log tail` follows the _event_ log. Other log entries are sent to stderr by default. If you run `ipfs log level provider.simple debug` (and `reprovider.simple` for re-announcements) and look at `stderr`, you should see relevant log entries.

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [May 21, 2020, 5:14am UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/6 "2020-05-21T05:14:04Z")

</div>

> [@stebalien](#):
>
> `ipfs log tail` follows the _event_ log. Other log entries are sent to stderr by default

And for me to understand more, what distinguishes the event log, from this other log? I mean on a conceptual level what are the things I should expect to see in the event log, and the things I should expect to see in the other log. I am guessing there is some method to deciding what goes where?

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/dadepo/32/3667_2.png) [@dadepo](https://discuss.ipfs.tech/u/dadepo)\
**Post date:** [May 23, 2020, 5:24pm UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/8 "2020-05-23T17:24:27Z")

</div>

I have a follow up question to this here [Getting the CID from DHT related communication](https://discuss.ipfs.tech/t/getting-the-cid-from-dht-related-communication/8052)

Perhaps you have some thoughts on how to achieve what I want to do?

---

<div class="post-metadata">

**Author:** ![sbonnefoy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/sbonnefoy/32/4297_2.png) [@sbonnefoy](https://discuss.ipfs.tech/u/sbonnefoy)\
**Post date:** [January 7, 2021, 2:22pm UTC](https://discuss.ipfs.tech/t/how-to-listen-to-dht-communication/8038/9 "2021-01-07T14:22:08Z")

</div>

> [@dadepo](#):
>
> ```auto
> ipfs log level providers debug
> ipfs log level provider.simple debug
> ipfs log level provider.queue debug
> 
> ```

Hi @dadepo ,  
I would be interested in doing the same thing. I have tried but it seems it is not working.  
I have tried this on the public network. I set two peers, which can communicate to each other. I set the log verbosity as you said:

```bash
ipfs log level providers debug
ipfs log level provider.simple debug
ipfs log level provider.queue debug

```

I tried to add a file from one peer, and check whether the other peer would see the provding. But is seems that the other peer does not see anything.  
I am also wondering whether it can see it, or if this depends on the way the k-buckets are filled when storing the key in the DHT. Could you, please, tell me how you set your peers and the log to get it working?  
Thanks a lot.
