Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Registrar and ConnectionManager missing from interface-libp2p #338

Closed
wemeetagain opened this issue Jan 20, 2023 · 4 comments
Closed

Registrar and ConnectionManager missing from interface-libp2p #338

wemeetagain opened this issue Jan 20, 2023 · 4 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@wemeetagain
Copy link
Member

Noticed this error upgrading to latest libp2p + gossipsub:

@lodestar/beacon-node: src/network/gossip/gossipsub.ts:98:11 - error TS2345: Argument of type 'Libp2p' is not assignable to parameter of type 'GossipSubComponents'.
@lodestar/beacon-node:   Type 'Libp2p' is missing the following properties from type 'GossipSubComponents': registrar, connectionManager
@p-shahi p-shahi added the need/triage Needs initial labeling and prioritization label Jan 24, 2023
@p-shahi
Copy link
Member

p-shahi commented Jan 24, 2023

@maschad will investigate

@danisharora099
Copy link
Contributor

danisharora099 commented Feb 15, 2023

@achingbrain is there an update?

it is a blocker for us as peerDiscovery expects Components while it's challenging to construct that without ConnectionManager and Registrar
Or changing peerDiscovery to implement this new interface would be great as well

even having a helper to convert Libp2p into Libp2pComponents of sorts would also be quite helpful here


what is the recommended way to go about this usecase?

@wemeetagain
Copy link
Member Author

Current answer is #339 (review)

I still disagree with this.
We've gone through the trouble of making all these nice component interfaces, but the only consumer of the interfaces that's supported is Libp2p itself?

I understand the desire to guide users to a high level interface. Use docs, examples, educational materials, etc. to guide users.

I don't understand actively removing components from the interface. If downstream consumers respect the interface, it really hurts consumers who want to build new modules that act similarly to 'internal modules'. Even using 'internal modules' in non-standard ways becomes impossible.
So then many valid usecases will just resort to type hacking or even worse straight-up @ts-ignoring. All because we have strong opinions that the high level interface MUST be used.

@achingbrain
Copy link
Member

This issue will be addressed by libp2p/js-libp2p#1563 - the user will be able to define arbitrary services that have access to libp2p internal components to their hearts content.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants