Hello! Thank you for maintaining this project and publishing it as FLOSS. I've been experimenting with using it as part of the ooni project to measure mainline DHT censorship.
However, it is not clear to me precisely what the exposed stats actually mean. For example, running the provided CLI tool returns the following:
$ ./dht get-peers
{
"Peers": [],
"DistinctPeerIps": 0,
"TraversalStats": {
"NumAddrsTried": 31,
"NumResponses": 0
},
"ServerStats": {
"GoodNodes": 2,
"Nodes": 3,
"OutstandingTransactions": 0,
"SuccessfulOutboundAnnouncePeerQueries": 0,
"BadNodes": 0,
"OutboundQueriesAttempted": 31
}
}
In this example, we can see NumResponses is zero, but in server stats GoodNodes is 2. This does not match my current mental model.
In a test case i wrote, where i start a local dht.Server without any bootstrap nodes, then try to connect from it from another dht.Server (with only the first one as bootstrap nodes), i get the following results after an Announce: in announce.TraversalStats(): 1 peer tried, 0 responded. And announce.Peers is empty. Yet i can see using tcpdump that the first peer did respond to the query.
Trying with the default set of bootstrap nodes (13 addresses), i get 19 NumResponses (NumAddrsTried 46) and announce.Peers contains 22 entries.
It's not clear to me what NumResponses and the entries in announce.Peers are. Is the first one the number of traversed peers queried about the specific infohash, and the second the number of found peers who announce that infohash? If so, is NumResponses only counting replies from peers announcing that infohash?
To get more comprehensive results, maybe i should call get_peers recursively myself? In the meantime, i feel like it's worth explaining more about what the exposed stats/data actually means.
Thanks for your attention