mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-20 08:08:20 +00:00
chore: dial provided now
This commit is contained in:
parent
c01da40e19
commit
728b3c5f2d
@ -108,6 +108,15 @@ export class WakuNode implements IWaku {
|
||||
if (protocolsEnabled.store) {
|
||||
const store = wakuStore(this.connectionManager);
|
||||
this.store = store(libp2p);
|
||||
|
||||
if (options.nodesToUse?.store) {
|
||||
this.dialMultiaddr(
|
||||
options.nodesToUse.store[0],
|
||||
this.store.protocol.multicodec
|
||||
).catch((e) => {
|
||||
log.error("Failed to dial store peer", e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (protocolsEnabled.lightpush) {
|
||||
@ -224,6 +233,14 @@ export class WakuNode implements IWaku {
|
||||
return this.connectionManager.isConnected();
|
||||
}
|
||||
|
||||
private async dialMultiaddr(
|
||||
multiaddrStr: string,
|
||||
protocol: string
|
||||
): Promise<void> {
|
||||
const ma = multiaddr(multiaddrStr);
|
||||
await this.libp2p.dialProtocol(ma, [protocol]);
|
||||
}
|
||||
|
||||
private mapToPeerIdOrMultiaddr(
|
||||
peerId: PeerId | MultiaddrInput
|
||||
): PeerId | Multiaddr {
|
||||
|
Loading…
x
Reference in New Issue
Block a user