-
Notifications
You must be signed in to change notification settings - Fork 475
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: allow custom registrar #3040
base: main
Are you sure you want to change the base?
Conversation
@@ -135,6 +135,11 @@ export class Libp2p<T extends ServiceMap = ServiceMap> extends TypedEventEmitter | |||
// Create the Registrar | |||
this.configureComponent('registrar', new Registrar(this.components)) |
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.
I suppose this should be in an else block on L143?
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.
Initially it was an if/else but found it useful to have the default implementation initialised so that it can be passed to a custom registrar. Maybe the initialisation of the default could be handled in the custom one instead?
Do you have an example of how you intend this to be used? Does this just make js-libp2p more customize-able without needing changes to the repo? |
Yes - examples here Maybe the middleware registrar could be included in js-libp2p instead but happy for it to live outside of the tree for now |
Description
Allow the registrar to be overridden with a custom implementation e.g. for adding protocol middleware
Notes & open questions
Change checklist