Skip to content

Better IPFS as a library constructor #7652

@aschmahmann

Description

@aschmahmann

We can currently get an IpfsNode by calling

https://github.com/ipfs/go-ipfs/blob/2ae5c52f4f0f074864ea252e90e72e8d5999caba/core/builder.go#L27

Unfortunately the BuildCfg is covers just a fraction of the sorts of options a custom IpfsNode my want to utilize. I think it would be very useful to have some constructor that looks something like:

NewNode(ctx context.Context, option... IpfsNodeOption) (*IpfsNode, error) and we can start to slowly expand the number of IpfsNode options. This also allows us to more easily deal with subcomponent options (e.g. passing options like WithExchange(BitswapExchange(bitswapOptions...))).

This could allow us to hide away the internals of the fx dependency injection while still utilizing it internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementA net-new feature or improvement to an existing feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions