Replies: 2 comments 5 replies
-
For libp2p you will want to think in protocols. As an intermediary transition, you can make two protocols (implying two NetworkBehaviours in the end), one for events and one for commands. Likely, as you learn more about libp2p, you may find that the network communication of your app can be split into more individual domains, all representing an individual protocol. You could also make a single NetworkBehaviour for each individual message (ie each event and each command). They could all be modeled via the |
Beta Was this translation helpful? Give feedback.
-
I have a related question. I used different topic to send Event or Message and keep the same kind of behavior. But I'm wondering if topics share the same connection ? I mean if I send a lot of events on the topic Event will I have some latencies on the Message topic ? |
Beta Was this translation helpful? Give feedback.
-
Hello, I will explain my need, indeed I'm trying to move from a homemade solution with tokio TcpStream to a libp2p implementation. For now I have 2 opened tcp stream in my solution with 2 different ports. One to send specific events and another one to send commands. I'm wondering what is the best way to handle this kind of multiple channels thanks to libp2p. I saw yamux, I saw mplex, I read about multiplexing but I'm a little bit lost. Knowing that each nodes could send or receive data on these 2 channels.
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions