-
-
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
Extract provider module to go-ipfs-provider
#6421
Conversation
18e94bb
to
561616f
Compare
The module itself depends on go-ipfs which isn't great. It will build but from a functional standpoint, it won't work well. |
@Kubuxu yes, I'm still working on this, thanks for the heads up though. There's a dependence on |
1df47b1
to
5aaa37a
Compare
@@ -115,3 +118,9 @@ func SimpleProviders(reprovideStrategy string, reprovideInterval string) fx.Opti | |||
fx.Provide(SimpleReprovider(reproviderInterval)), | |||
) | |||
} | |||
|
|||
func pinnedProviderStrategy(onlyRoots bool) interface{} { | |||
return func(pinner pin.Pinner, dag ipld.DAGService) simple.KeyChanFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magik6k @Kubuxu Any thoughts on a preferred alternative to this?
The reason for this is that the "old" reprovider depends on pin.Pinner
which is a module within go-ipfs
. To break that dependency I introduced a Pinner
type in the go-ipfs-provider
repository, but that is not the type of Pinner
that's in the dependency injection container. To get around this I do the constructing of the dependency here, within go-ipfs
, so that I can depend on pin.Pinner
. The benefit, as I see it, is that this change is relatively small.
We could move the Pinner
out as well into its own repository, but I really don't want to take on that large of a change right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to leave the NewPInnedProvider
thing as a provider implementation within go-ipfs and extract the more generalistic ones (namely BlockstoreProvider
). This looks very weird right now, and I don't need the PinnedProvider anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsanjuan I think that makes sense. Let me try it. And now that I think about it, ipfs-lite
maybe doesn't have the concept of a Pinner
, is that true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's true, no Pinner. Pinner is a go-ipfs specific concept (for now)
3c77107
to
0d0ccd5
Compare
@hsanjuan I have been looking at
You should be able to construct and test the provider behavior you need using the code here: https://github.com/ipfs/go-ipfs-provider. Can you try and see how that goes? |
d29c767
to
10de165
Compare
Currently depends on ipfs/go-ipfs-provider#11 |
Moved
provider
module to https://github.com/ipfs/go-ipfs-provider