-
Notifications
You must be signed in to change notification settings - Fork 105
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
Provide a default libp2p instance #121
Comments
Should this be something that js-libp2p provides? I imagine a set of default libp2p configs for different usecases would be really valuable for users:
|
I'll let @achingbrain comment.
I think you bring up a good point. It may be useful to expose a libp2p "instance factory". Then a user can be selective of what variant they want. At the minimum having a "browser" and a "server" config. |
I think applications like Helia are a better place to make choices about what a default libp2p config looks like rather than libp2p itself since you're closer to the user's needs at that point.
We solved this problem in go/js-ipfs by having 'profiles' that a user could enable/disable - test, server, low-power, etc. These tweaked configuration options like connection limits and turned on/off different modules. |
I like the idea of profiles, but, if we can, it would be nice to allow composable functionality via features instead of profiles with everything hardcoded. i.e. similar to tsconfig lib (but we would need to handle merging and whatnot):
|
The original intention was to allow users to configure a libp2p node to their requirements but it's a non-trivial undertaking unless the user is deeply familiar with the libp2p stack. Instead, let's provide node and browser libp2p instances with sensible defaults that give the user the best chance of success on first try. Fixes #121
## [@helia/interface-v1.1.0](https://github.com/ipfs/helia/compare/@helia/interface-v1.0.0...@helia/interface-v1.1.0) (2023-05-19) ### Features * provide default libp2p instance ([#127](#127)) ([45c9d89](45c9d89)), closes [#121](#121) ### Trivial Changes * bump aegir from 38.1.8 to 39.0.4 ([#111](#111)) ([2156568](2156568))
🎉 This issue has been resolved in version @helia/interface-v1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version helia-v1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Done Criteria
Helia can be constructed without a libp2p instance. In this case, a "good default" libp2p instance is provided.
Why Important
libp2p exposes a lot of knobs. Knowing the right one sets for a good connectivity story is not cear to new users. This reduces the barrier to entry and also serves as a base set to potentially tweak.
Notes
This default libp2p instance should be well commented so that interested users can learn from it to determining how they might follow suit or tweak.
The text was updated successfully, but these errors were encountered: