Skip to content
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

Feat: Expose Fx options directly #2962

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Feat: Expose Fx options directly #2962

wants to merge 2 commits into from

Conversation

MarcoPolo
Copy link
Collaborator

This allows many things:

  • Easily build libp2p in a modular way, relying on Fx to fill in the dependency graph.
  • Allow user services to get access to shared resources like the Peerstore, or other services like Idenetify without having to expose a method in the Host interface for all these things. Or without having the user have to cast the host.Host into a basic host.
  • Allow users who don't need resources like a Peerstore to avoid allocating one.
  • In the case that the user is already using Fx, it plugs neatly into their constructor. In case it isn't, it should still be just as easy to construct the libp2p host as it is today.
  • Better support for "setup packs". Preconfigured options for certain use-cases (e.g. everything please; I'm a public server; absolute bare minimum)

In draft until we get close to feature parity with the existing constructor. Please let me know if you'd be interested in trying this when we release it. (In particular I think this would significantly clean up Kubo's libp2p constructor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant