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

Query: Where is the bootstrap package in the latest version? #2802

Open
paulwizviz opened this issue May 20, 2024 · 3 comments
Open

Query: Where is the bootstrap package in the latest version? #2802

paulwizviz opened this issue May 20, 2024 · 3 comments

Comments

@paulwizviz
Copy link

I am new to the library. I was told there is a bootstrap package to support bootstrap-based discovery.

@sukunrt
Copy link
Member

sukunrt commented May 20, 2024

I think you are looking for go-libp2p-kad-dht
Here is the bootstrap peers option for it:
https://github.com/libp2p/go-libp2p-kad-dht/blob/master/dht_options.go#L275

For mdns based discovery look at https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/discovery/mdns

@paulwizviz
Copy link
Author

paulwizviz commented May 20, 2024

I think you are looking for go-libp2p-kad-dht Here is the bootstrap peers option for it: https://github.com/libp2p/go-libp2p-kad-dht/blob/master/dht_options.go#L275

For mdns based discovery look at https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/discovery/mdns

I think you are looking for go-libp2p-kad-dht Here is the bootstrap peers option for it: https://github.com/libp2p/go-libp2p-kad-dht/blob/master/dht_options.go#L275

For mdns based discovery look at https://pkg.go.dev/github.com/libp2p/go-libp2p/p2p/discovery/mdns

I was looking at an example code that references this "github.com/libp2p/go-libp2p/p2p/discovery/routing". But I can't find it in that latest version.

This is what I was trying to do.

    bootstrapConfig := bootstrap.BootstrapConfigWithPeers([]peer.AddrInfo{*bootstrapPeer})
    bootstrapService, err := bootstrap.NewBootstrapService(ctx, h, bootstrapConfig)
    if err != nil {
        log.Fatal(err)
    }

    // Start the bootstrap service
    if err := bootstrapService.Start(); err != nil {
        log.Fatal(err)
    }

However, I could not find that package in the go-libp2p module. I would like to test a scenario where peers could be found on a WAN or the Internet. I understand libp2p DHT can achieve this. Is that correct?

@gammazero
Copy link
Contributor

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

No branches or pull requests

3 participants