-
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 📦
|
* List of nodes' multiaddrs as strings to use for each protocol. If not specified, random nodes will be used. | ||
* This should be used only if you know what you are doing. | ||
*/ | ||
nodeToUse?: { |
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.
can you create store
field with following type:
store: Partial<StoreProtocolOptions>
and StoreProtocolOptions
can have:
type StoreProtocolOptions = {
peers: [],
};
example for Filter in one of open PRs - 09127df
@@ -3,6 +3,7 @@ import type { Peer, Stream } from "@libp2p/interface"; | |||
import type { |
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.
please, let's not introduce changes into this file and instead prefer peer in store.ts
with something like
const preferedPeer = this.libp2p.getConnections().find(c => c.remotePeer.toString() === preferedPeerIdStr);
const peer = preferedPeer || this.getPeer();
@@ -224,6 +232,18 @@ export class WakuNode implements IWaku { | |||
return this.connectionManager.isConnected(); | |||
} | |||
|
|||
private async dialMultiaddr( |
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 not introduce this operation and use ConnectionManager
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;