Conversation
- Update libp2p to v0.43.0 for mDNS support - Add libp2p/zeroconf/v2 for mDNS implementation - Update related dependencies for compatibility
Add mDNS peer discovery capability flag to the capability flags list. This allows users to enable mDNS discovery when running wetware commands.
- Add MDNS field to EnvConfig and Env structs - Implement MDNSPeerHandler to manage discovered peers - Add conditional mDNS service initialization in EnvConfig.New() - Integrate mDNS service lifecycle with environment cleanup - Add proper logging for mDNS service startup and peer discovery The mDNS service automatically discovers peers on the local network and adds them to the libp2p peerstore for connection.
- Update run command to pass MDNS flag to EnvConfig - Update shell command to pass --with-mdns flag to run subprocess - Enable mDNS discovery when --with-mdns or --with-all flags are used This allows users to enable mDNS peer discovery in both run and shell modes by using the --with-mdns capability flag.
mikelsr
approved these changes
Sep 18, 2025
Member
Member
|
Solved! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds mDNS (multicast DNS) peer discovery capability to Wetware, allowing nodes to automatically discover and connect to other Wetware instances on the local network without manual configuration.
Features
--with-mdnscapability flag - Enables mDNS peer discovery in bothww shellandww runcommandsImplementation Details
Dependencies
libp2pto v0.43.0 for mDNS supportlibp2p/zeroconf/v2for mDNS implementationCore Changes
1. Capability Flag (
cmd/internal/flags/flags.go)2. mDNS Implementation (
cmd/ww/run/env.go)MDNSfield toEnvConfigandEnvstructsMDNSPeerHandlerto manage discovered peersEnvConfig.New()3. Command Integration
--with-mdnsflag toEnvConfig--with-mdnsflag to run subprocessUsage
Enable mDNS in Shell Mode
Enable mDNS in Run Mode
Enable All Capabilities (including mDNS)
Testing
The implementation has been tested to ensure:
--with-mdnsflag is usedArchitecture
The mDNS discovery is implemented in the
runprocess environment, following the existing pattern where:shellcommand spawns arunsubprocessrunprocess manages the libp2p host and mDNS serviceBackward Compatibility