-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Export closeableBasicHost and closeableRoutedHost #3015
Comments
Related issue #2809 |
I think using Fx's options for this is cleaner than having to type check against specific type or having to expose a new getter method in the Interface. This PR would let you do it: #2956. Here's a test that demonstrates it: https://github.com/libp2p/go-libp2p/pull/2956/files#diff-f7fee66901d4e06c6566ce6e9859d0b89364d4ba13ad9edd24534bfecdb443cbR54 This would work even if the host itself doesn't use the ID service. As long as something is providing it in the dependency graph. I'm leaning towards merging that PR so we can start using it since it has already come up a couple of times. |
You'll be able to get the ID service in the next release. Refer to this test for an example: Lines 50 to 60 in c4c3a34
|
Thanks everyone, and apologies for not searching for a related issue! Great that 0.37 is already released! |
In some of our tooling I want to have access to the IDService. What I've done until recently is:
libp2p.New
*basichost.BasicHost
.IDService()
methodA few months ago the host that
libp2p.New
returns is wrapped inside acloseableBasicHost
. Since this type isn't exported I cannot do the above anymore.Maybe there's a more elegant way to do what I want?
If not, would you have any objections to export that type? Increasing the API surface needs to be carefully considered so I'd totally understand if you have reservations. However, if it's ok from your side, I'm happy to do the tiny change.
The text was updated successfully, but these errors were encountered: