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.
* Rename triggerAutoBootstrap to autoBootstrap. This variable used to control
_triggering_ only but now completely disables automatic bootstrapping.
* Remove the BootstrapConfig. We introduced this before we switched to
functional options. Now that we're breaking the interfaces anyways, we might as
well use functional options all the way (easier to extend).
* Always query self (feedback from @raulk).
* Important: don't abort the bootstrap process if we timeout finding ourselves.
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
It's impossible to find the self ID in the DHT because of this statement ac6772539b/handlers.go (L257)
So maybe we should ignore the "not found" error in this case, like we do it for the random walk.
* 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