-
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
feat(store): allow using a specific node #2192
base: master
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
@@ -11,6 +13,7 @@ import { | |||
IPeersByDiscoveryEvents, | |||
IRelay, | |||
KeepAliveOptions, | |||
MultiaddrStr, |
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.
there should be a type for it in multiaddr
package
@@ -28,6 +28,10 @@ export type IBaseProtocolSDK = { | |||
readonly numPeersToUse: number; | |||
}; | |||
|
|||
type StoreProtocolOptions = { | |||
peer: string; |
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.
Let's make it peers
in the following PR
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.
We only use one peer for Store, unlike LightPush and Filter. When use getPeers()
within Store, we still only use the 0th index from the array of peers returned.
peers: string[]
would be applicable to LightPush and Filter
packages/sdk/src/waku/waku.ts
Outdated
}); | ||
} | ||
|
||
const store = wakuStore(this.connectionManager, peerIdStr); |
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.
this is wrong, peerIdStr
does nothing here
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.
It is used to initialise Store with the protocol to use since we need to get the peer when we send a store request. Changed the peerIdStrToUse
to options: Partial<StoreProtocolOptions>
Problem
Users need the ability to specify the peers used for their apps, for different protocols. Specifically for Store: https://discord.com/channels/1110799176264056863/1290694275683582085/1291644836742565929
Solution
Provides the ability to pass a specific node multiaddr while node creation to be used for Store. Falls back to random nodes if not passed.
Notes
Contribution checklist:
!
in title if breaks public API;