-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
9aee648
to
f8ec3fd
Compare
abc8b69
to
1e47f80
Compare
Sorry for the git mess, tried to clean it up a bit but can't seem to get rid of ab850a5 on this fork. I did not do a gx release this time since I moved away from head state to try and clean up the git history. Is it okay if we do that after we merge? I will then update that gx hash in the go-ipfs PR (and iptb-plugins). |
Rebasing fixed the git mess, sorry about that! |
I think this is ready to merge. Would like to get this in so we can finish the go-ipfs postgres merge. Thanks! |
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.
1 nit, but other than that LGTM
Lmk if there is anything I can do to help get this merged in, thanks! |
@Stebalien ping |
|
👍, but I'm not sure how (preloaded) plugins work with init.
We write some things to the datastore on init, so we need have a way to access it at init |
When this PR was first opened up the Postgres datastore was being built directly into the fsrepo/datastores.go, but then most of the datastores were moved to being plugins and so we followed suite here. As @magik6k points out, if we don't have the Postgres datastore configured with the necessary variables at |
So, we can do this with preloaded plugins. We load them before calling init so they can add profiles in |
Hi all, wanted to check in and see if I could finish up this set of PRs. Not entirely clear to me what else needs to be done. I am personally partial to including the Postgres datastore as one of the preloaded plugins, this makes it straight forward to use Postgres when working with an ipfs node as part of another codebase. E.g. just need to do: l, err := loader.NewPluginLoader("")
if err != nil {
return nil, err
}
err = l.Initialize()
if err != nil {
return nil, err
}
err = l.Inject()
if err != nil {
return nil, err
}
node, err := ipfs.InitIPFSNode(ipfsPath)
if err != nil {
return nil, err
} And it is able to work with the Postgres backed datastore (if that is what was initialized with Its not clear to me exactly how we would use it this way otherwise, I assume we would need to build the plugin "manually" and then link to its path in the |
Postgres is a large dependency to add by default.
What about ipfs/kubo#6474? You'd run: l, err := loader.NewPluginLoader()
if err != nil {
return nil, err
}
err = l.Load(myPlugin) // magic here.
if err != nil {
return nil, err
}
err = l.Initialize()
if err != nil {
return nil, err
}
err = l.Inject()
if err != nil {
return nil, err
}
node, err := ipfs.InitIPFSNode(ipfsPath)
if err != nil {
return nil, err
} |
Thanks @Stebalien, that works! With that in mind, is there anything else blocking merging this work? |
This is the addition of a profile to utilize the changes being made to this package.