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 in dht when the routing table is empty #7340

Merged
merged 1 commit into from May 25, 2020

Conversation

Stebalien
Copy link
Member

Otherwise, we could end up with only DHT clients and never re-bootstrap.

I've left the default go-ipfs bootstrapping code in for now as it's technically possible to disable the DHT entirely.

return out, fmt.Errorf("failed to parse bootstrap peer address %q: %s", addrStr, err)
}
bootstrappers = append(bootstrappers, addr)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing dht.BootstrapPeers to take peer.AddrInfo would make this code simpler...

Copy link

Choose a reason for hiding this comment

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

@Stebalien Have made the change here:
libp2p/go-libp2p-kad-dht#651

Also, we should now use go-libp2p-kad-dht.GetDefaultBootstrapPeerAddrInfos to set the default for cfg. Bootstrap.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I really understand what makes this easier, but also no complaints from me :)

Copy link
Member Author

Choose a reason for hiding this comment

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

It's easier in this case because cfg has a special function to get AddrInfos.

@Stebalien Stebalien removed the request for review from aschmahmann May 21, 2020 05:30
return out, err
}
var bootstrappers []ma.Multiaddr
for _, addrStr := range cfg.Bootstrap {
Copy link

Choose a reason for hiding this comment

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

@Stebalien Is the default for cfg.Bootstrap the DefaultBootstrapPeers value in go-libp2p-kad-dht ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically, yes. Although I think it's duplicated.

return out, fmt.Errorf("failed to parse bootstrap peer address %q: %s", addrStr, err)
}
bootstrappers = append(bootstrappers, addr)
}
Copy link

Choose a reason for hiding this comment

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

@Stebalien Have made the change here:
libp2p/go-libp2p-kad-dht#651

Also, we should now use go-libp2p-kad-dht.GetDefaultBootstrapPeerAddrInfos to set the default for cfg. Bootstrap.

Otherwise, we could end up with only DHT clients and never re-bootstrap.

I've left the default go-ipfs bootstrapping code in for now as it's technically
possible to disable the DHT entirely.
@Stebalien Stebalien merged commit c17bcbd into master May 25, 2020
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
@hacdias hacdias deleted the feat/boostrap-when-low branch May 9, 2023 10:59
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.

None yet

3 participants