-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Kubo as a Library Example; Seemingly not workable outside of the parent Kubo repo #9828
Comments
It's really odd (okay, I didn't just stop there and kept digging), when I compared the two interfaces: Boxo: https://github.com/ipfs/boxo/blob/main/coreiface/coreapi.go They're identical near as I can tell so it's only throwing the error because the two interfaces, despite matching at the interface level have different BlockAPI() functions. |
@AustinFoss are you still experiencing this? We've been refactoring a lot of libraries and moving things around last quarter, it works now, maybe you were unlucky month ago? If the issue si still present, mind sending your ps. |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
Seems you are correct and I was just a little unlucky with my timing. Created a fresh go working directory and copy pasted the main.go file from the this repo's /docs/examples/kubo-as-alibrary folder to my fresh directory. Ran Closing this issue. Per your recommendation of boxo; yes I came across it at the time of writing this but at the time I just wanted an existing implementation that had already been tested and just tweak the libp2p part of it, and not build my own implementation from scratch which is what boxo seems to be. From it's README page, "A library for building IPFS applications and implementations." Will investigate boxo a little more as time allows. |
Checklist
Location
https://github.com/ipfs/kubo/blob/master/docs/examples/kubo-as-a-library/main.go#L133
Description
I've been trying to explore using p2phttp and wanted to try providing a Kubo node as the
host.Host
argument for thegostream.Listen()
function: https://github.com/libp2p/go-libp2p-httpWhile attempting to do so and exploring the Kubo as a Library example I came up bad behavior from the example where a return value,
api
, from thespawnEphemerral()
function is conflicting with the expected return type: https://github.com/ipfs/kubo/blob/master/docs/examples/kubo-as-a-library/main.go#L111The problem appears as soon as this example is seperated from the parent repo, but works just fine as long as it's nested as a child within the examples folder of this repo. The variable type in question causing the conflict reads:
Seems there's something going on with the versioning around ipfs/boxo but that's as far as I'm gonna go because the version your example uses seems to be an early release, 0.8.1-0.20230411232920-5d6c73c8e35e, so I'll probably stop here and wait until that release is finalized and maybe resolves this problem.
I noticed as well that while the comments in the go.mod file mentioned to comment out the "replace github.com/ipfs/kubo => ./../../.." line, but still says to use GoV1.18 when the current version of QUIC requires at least 1.19.
The text was updated successfully, but these errors were encountered: