* feat: Expose the ProviderManager through the IpfsDht struct
* feat: expose providers prefix so that we do not have to hard code it in other places
Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Otherwise, we could decide to _not_ add a peer, disconnect from most peers, and
be unable to query the DHT even if we're technically connected to a peer in the
DHT.
We'd like to be able to refresh then _wait_ for the refresh to finish in the testground DHT tests. That way, we can:
1. Start and disable _auto_ refresh.
2. Bootstrap.
3. Refresh a couple of times till we're stable.
4. Wait to _stop_ refreshing.
5. Disconnect from and forget about all peers _not_ in our routing tables.
6. Run the actual tests without interference from the bootstrapping logic.
As pointed out by raul, bootstrapping and refreshing are not the same thing.
Bootstrapping is the initial setup (i.e., connect to some initial nodes to get
started). Refreshing is the process of refreshing the routing table.
1) on connecting to a new peer -> trigger self & bucket bootstrap if RT size goes below thereshold
2) accept formatting & doc suggestions in the review
3) remove RT recovery code for now -> will address in a separate PR once #383 goes in
changes as per review
2) seed RT if empty before starting bootstrap incase 1 hasn't fired
3) pass bootstrap config as option while creating Dht
4) replace all bootstrap function with 1 function
We usually _explicitly_ call connect before calling `prep` but we may disconnect
somewhere in-between. We _don't_ want to get stuck here dialing if the context
has been canceled.
* Rework TestFindPeersQuery
Unravel the logic and create a minimal test case that isn't flaky.
* Use testing.T.Logf
* Skip the original test in short mode
* Add comments for the arguments to testFindPeerQuery
* Qualify aberrant package name
* Use redundant package names
* gx import testify 1.3.0.
* Remove signal bootstrapping
Remove IpfsDHT.BootstrapOnSignal.
* Type check expected interfaces on IpfsDHT
* Simplify the bootstrap logic
* Tidy up a few other things
* Include BootstrapOnce
* Add comment about duplicating sanity checks
* Use existing import naming convention
* Defer error wrapping until we need it
* Restore existing query count behaviour