I am trying to understand lib2p2 Rust by looking at the rust libp2p examples in the rust libp2p github repo and substrate network module as well. My question is, If I am building a peer to peer network such as a blockchain using libp2p.
If I am correct , do I use both kadamlia and mdns for peer discovery ? or I can use only mdns or only kadamlia since both can be used for peer discovery according to the libp2p documentation
If I used kademlia for discovery and routing, does this mean my network will also connect with the ipfs network? I came across information mentioning that ipfs is coupled with the kademlia protocol. how do I use rust libp2p such that the peers in my protocol network (e.g blockhain) only connect with other peers running my own protocol such as a blockchain network? is there a code sample for this ?
What libp2p behavior or module to I use for broadcasting information to other peers in the network ? such as broadcasting blocks as in a blockchain network ? is it gossipsub? I looked into the substrate network crate Cargo.toml but i saw that the gossipsub feature is not enabled