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

Routed Host Hangs #205

Closed
ericxtang opened this issue Jul 18, 2017 · 5 comments
Closed

Routed Host Hangs #205

ericxtang opened this issue Jul 18, 2017 · 5 comments
Labels
kind/support A question or request for support

Comments

@ericxtang
Copy link
Contributor

This used to work, but something happened recently that it no longer works.

For example, if you take example/echo.go, add

func makeKadHost(h host.Host) (host.Host, error) {
	dhtRouting := kad.NewDHT(context.Background(), h, ds.NewMapDatastore())
	if err := dhtRouting.Bootstrap(context.Background()); err != nil {
		glog.Errorf("Error bootstraping dht: %v", err)
		return nil, err
	}

	rHost := rhost.Wrap(h, dhtRouting)
	return rHost, nil
}

(rhost is github.com/libp2p/go-libp2p/p2p/host/routed)

If we use the KadHost instead of the basicHost for making connections, the connection hangs. Am I missing something here?

@Stebalien
Copy link
Member

Could you post a complete repro (or open a PR that reproduces the issue)?

@ericxtang
Copy link
Contributor Author

@Stebalien yeah - made a PR #206

@Stebalien
Copy link
Member

It works for me after importing/rewriting the deps using gx (we use gx to deal with dependency versioning):

gx-go rewrite

# New deps from your patch.
gx import github.com/libp2p/go-libp2p-kad-dht
gx import github.com/ipfs/go-datastore

@ericxtang
Copy link
Contributor Author

Woot! That worked. Seems like an issue where gx and github has different versions.

Thanks @Stebalien.

gx looks like a good way to do versioning. Is there a good tutorial for it besides the github repo? I'm interested in trying it out, but the hashes scare me. It would be great to have something like a go-path-to-hash lookup command.

@daviddias daviddias added the kind/support A question or request for support label Aug 19, 2017
@Stebalien
Copy link
Member

Sorry for the slow response.

I'm not aware of any good tutorials for it and, unfortunately, the hashes are kind of unavoidable due to how go manages dependencies. @whyrusleeping considered using symlinks but go treats packages with different names as different packages even if they have the same code.

Note: You don't need to check the hashes into your code (just into packages.json). Instead, you can just call gx-go rw before building.

marten-seemann added a commit that referenced this issue Apr 22, 2022
correctly export version negotiation failures to Prometheus
marten-seemann added a commit that referenced this issue Aug 15, 2022
@MarcoPolo MarcoPolo mentioned this issue Jul 14, 2023
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

3 participants