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.
I suppose this should be in an else block on L143?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
updated to wrap it in a if else
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 |
|
Hey @dozyio - we need to revisit this. This PR introduces two registrars and because that's not the most ergnomic solution, we should reconsider how to do this. Can you create an issue (if not @achingbrain can too) and we can prototype in the issue before implementing? |
Description
Allow the registrar to be overridden with a custom implementation e.g. for adding protocol middleware
Notes & open questions
Change checklist