-
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 📦
|
let peerIdStr: PeerIdStr | undefined; | ||
if (options.store?.peer) { | ||
this.connectionManager | ||
.dialPeer(options.store.peer, [StoreCodec]) |
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 function and use
js-waku/packages/sdk/src/waku/waku.ts
Line 143 in 88e33a9
public async dial( |
which does the same as I see
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.
good point - now that we have a dial function in the ConnectionManager, we should be proxying dials through that.
instead of doing libp2p.dial()
on the Waku object, proxied it through the ConnectionManager.dialPeer()
function: 7ad9acc
This also help clean up the string
type for multiaddr as ConnectionManager.dialPeer()
is now compliant with the MultiaddrInput
type
packages/tests/tests/connection-mananger/connection_state.spec.ts
Outdated
Show resolved
Hide resolved
return peer; | ||
} else { | ||
// peer is of MultiaddrInput type | ||
const ma = multiaddr(peer); |
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.
q: can multiaddr
throw?
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.
yes, the class implementation can throw in several cases, mostly parsing of the multiaddr passed to it; why do you ask?
060e316
to
6b452a5
Compare
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;