-
Notifications
You must be signed in to change notification settings - Fork 42
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
chore(lightpush)!: move protocol implementation to @waku/sdk
(1/n)
#1964
Conversation
moves `SubscriptionManager` to `sdk` side
also update peer deps in sdk
@waku/sdk
(1/n)
size-limit report 📦
|
class LightPushSDK extends BaseProtocolSDK implements ILightPushSDK { | ||
public readonly protocol: LightPushCore; | ||
|
||
constructor(libp2p: Libp2p, options?: ProtocolCreateOptions) { | ||
super({ numPeersToUse: options?.numPeersToUse ?? DEFAULT_NUM_PEERS }); | ||
super({ numPeersToUse: options?.numPeersToUse }); |
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.
note: this is a side-change
): void { | ||
const errors = results | ||
.filter( | ||
(result): result is PromiseRejectedResult => |
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.
Learned something new today about Typescript :-)
|
||
const { contentTopic } = message; | ||
if (!contentTopic) { | ||
log.warn("Message has no content topic, skipping"); |
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.
nit: may be worth adding the hash of the message to the log
Problem
Part of #1886, the current Filter implementation is quite coupled in terms of the RFC specs + our opinions of using peers, handling subscriptions, etc
Solution
Decouple Filter into
SDK
andCore
Notes
@waku/core
should be as unopinionated as possible #1886Contribution checklist:
!
in title if breaks public API;