Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bootstrap): autobootstrap #402

Closed
wants to merge 1 commit into from
Closed

Conversation

Stebalien
Copy link
Member

  1. Auto bootstrap on start.
  2. Make Bootstrap(ctx) trigger a bootstrap but not start the bootstrapping process.

Alternative to #401.

Unfortunately, getting the tests to pass is difficult. We may need some option to not automatically start the DHT.

1. Auto bootstrap on start.
2. Make `Bootstrap(ctx)` trigger a bootstrap but not _start_ the bootstrapping
   process.
// Bootstrap i
func (dht *IpfsDHT) startBootstrapping() error {
// scan the RT table periodically & do a random walk on k-buckets that haven't been queried since the given bucket period
dht.proc.Go(func(proc process.Process) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured I'd let the process management system manage the bootstrap process while we were at it.

case <-time.After(dht.bootstrapCfg.SelfQueryInterval):
case <-ctx.Done():
return
if walkSelf {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I combined these into a single loop.

  1. We always want to finish selfWalk before checking the buckets.
  2. It doesn't make sense to walk self if we're not going to immediately fill in the empty buckets.

@aarshkshah1992
Copy link
Contributor

aarshkshah1992 commented Nov 1, 2019

Hey @Stebalien

Have taken this to completion in #403 with some changes. Please take a look when you can. We can close this PR after 403 goes in.

@Stebalien
Copy link
Member Author

Thanks!

@Stebalien Stebalien closed this Nov 1, 2019
@Stebalien Stebalien deleted the feat/auto-bootstrap branch November 1, 2019 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants