waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
168 stars 42 forks source link

feat: better create protocol options #2073

Open weboko opened 3 months ago

weboko commented 3 months ago
This is a **feature request** ## Problem Currently options for creating a node are convoluted and spread in the code base. It get harder to handle and requires some TS hacks to prevent from compilation. ## Proposed Solutions For starters we should split `building` of options and `creation` of `libp2p` which is main consumer of options. ``` const createOptions = buildCreateOptions(options); const libp2p = await createLibp2pNode(createOptions); const wakuNodeOptions = buildWakuNodeOptions(createOptions); ``` Second step is to consolidate leftover option updates specific for `WakuNode`: https://github.com/waku-org/js-waku/blob/9b0f1e855aa3a1f7b9aec3a4c726568d37595c28/packages/sdk/src/waku.ts#L96 ## Notes Draft PR: https://github.com/waku-org/js-waku/pull/2072
danisharora099 commented 3 months ago

related to https://github.com/waku-org/js-waku/issues/2048

weboko commented 3 months ago

another concern to be addressed - https://github.com/waku-org/js-waku/pull/2056#discussion_r1682637811