Couldn’t find any mention on how to set this up in the examples, https://godoc.org/github.com/libp2p/go-libp2p and https://godoc.org/github.com/libp2p/go-libp2p-kad-dht
Relevant thread https://github.com/libp2p/go-libp2p/issues/222
I think Go-libp2p-kad-dht 0.3.0 released with breaking changes is exactly what you are looking for.
“Dht Randoms Walks” / “Dht Refresh” / “Look for random peer IDs in the network” is enabled by default(One aim of this release & that great writeup by @stebalien is to clear the confusing terminology).
However, you can disable it by passing in the
DisableAutoRefresh option to the Dht. Then, you will have to “manually” call
Dht.Refresh to perform random walks.
Please do let me know if you have any questions.
It is indeed. Thank you @stebalien for releasing it for me
For future selves and others looking for the answer, you can find a snippet om how it is done at: