-
Notifications
You must be signed in to change notification settings - Fork 499
Closed
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps updxDeveloper ExperienceDeveloper Experienceexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/readyReady to be workedReady to be worked
Description
With libp2p V0.28, peer:connect events seems not to be fired
const peerid = ...;
const libp2p = await Libp2p.create({
peerId: peerid,
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0'],
},
modules: {
transport: [TCP],
streamMuxer: [Mplex],
peerDiscovery: [MulticastDNS],
},
config: {
peerDiscovery: {
autoDial: true,
[MulticastDNS.tag]: { // or mdns: ?
interval: 1000,
enabled: true,
},
},
},
});
libp2p.on('peer:discovery', (peerId) => {
debug('Discovered: %O', peerId);
// libp2p.dial(peerId);
});
libp2p.connectionManager.on('peer:connect', (connection) => {
debug('peer connected %O',connection);
});
libp2p.start();
With the same setup, if I launch libp2p.start()
from another node, the peer:discovery
is well logged, but not peer:connect
. I thought the autoDial:true
should make a peer dials other discovered peers automatically.
I've tried also to call libp2p.dial(peerId)
into the peer:discovery event, but peerId
has no multiaddrs
value, and have not found how to dial a discovered peer.
The documentation is sometimes confusing with this discovery process (for example, some explains to use mdns
, other tells to use [MulticastDNS.tag]
in config)
Metadata
Metadata
Assignees
Labels
P2Medium: Good to have, but can wait until someone steps upMedium: Good to have, but can wait until someone steps updxDeveloper ExperienceDeveloper Experienceexp/noviceSomeone with a little familiarity can pick upSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issueSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)A bug in existing code (including security flaws)status/readyReady to be workedReady to be worked