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

Add option to specify bootstrap addresses #366

Merged
merged 1 commit into from
Feb 17, 2022
Merged

Conversation

masih
Copy link
Member

@masih masih commented Feb 16, 2022

Allow the libp2p host to optionally perform bootstrap with given list of
addinfos.

Relates to #342

@masih masih requested a review from willscott February 16, 2022 18:08
@@ -87,6 +89,15 @@ func NewHost(priv crypto.PrivKey, listenAddrs []multiaddr.Multiaddr) (host.Host,
return host, nil
}

func bootstrapHost(host host.Host, btstrp []peer.AddrInfo) (io.Closer, error) {
bCfg := bootstrap.DefaultBootstrapConfig
bCfg.MinPeerThreshold = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be the number of items in the btstrp?

Copy link
Member Author

Choose a reason for hiding this comment

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

TLDR; not sure.

That determines how many bootstrap connections to open. In the case of Pando integration it will most likely remain to 1. Though I am not sure what the future brings. Setting that to the length of addrinfos when a lot of addresses are provided might have unintended consequences.

The default value for this is 4. I'll leave a todo to parameterise it since it is entirely application specific.

@masih masih force-pushed the masih/pando-bootstrap branch 2 times, most recently from df59be7 to 862ccd9 Compare February 17, 2022 10:51
Allow the libp2p host to optionally perform bootstrap with given list of
addinfos.
@masih masih merged commit c76879f into main Feb 17, 2022
@masih masih deleted the masih/pando-bootstrap branch February 17, 2022 12:11
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

2 participants