rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

mDNS: emit `ToSwarm::NewExternalAddrOfPeer`

Open thomaseizinger opened this issue 1 year ago • 7 comments

Description

With https://github.com/libp2p/rust-libp2p/pull/4371 merged, we have the foundation of https://github.com/libp2p/rust-libp2p/issues/4302 implemented.

libp2p-mdns needs to be extended to emit this new event whenever it discovers a new address via mDNS.

Motivation

Other behaviours should be able to learn the addresses discovered by mDNS.

Current Implementation

Only mDNS knows about its discovered addresses.

Are you planning to do it yourself in a pull request ?

No

thomaseizinger avatar Jan 21 '24 06:01 thomaseizinger

would like to work on this

1010adigupta avatar Jan 25 '24 23:01 1010adigupta

would like to take this one once previous one time out. @thomaseizinger , unsure the policy here.

justcode740 avatar Feb 19 '24 06:02 justcode740

Feel free to start! :)

I've not heard from @1010adigupta so far.

thomaseizinger avatar Feb 19 '24 06:02 thomaseizinger

Feel free to start! :)

I've not heard from @1010adigupta so far.

ah, ok, just afraid there's some duplicated work done.

justcode740 avatar Feb 19 '24 06:02 justcode740

You can go for it, I got busy with some other stuff, didn't got time for this :)

1010adigupta avatar Feb 19 '24 06:02 1010adigupta

@thomaseizinger hey i have a question, isn't the mDNS service already inform Swarm when a new peer discovered? https://github.com/libp2p/rust-libp2p/blob/master/protocols/mdns/src/behaviour.rs#L351, what need to change here?

justcode740 avatar Feb 19 '24 21:02 justcode740

It emits an mDNS specific event that the user has to react to manually. The idea of the new event is that it is shared with other behaviours.

thomaseizinger avatar Feb 25 '24 03:02 thomaseizinger