Open ConsciousCode opened 4 years ago
It looks like MMQT is a protocol that could run over libp2p, but it doesn't look like it would work as a libp2p transport.
I bet @mcollina has some ideas about this ;)
I don't know if I'm stretching the definition of "transport", but topics can be thought of as producing/consuming short strings and thus addressing resources, like in the example provided which addresses an IoT device's power status
Regardless of whether MQTT is a good use-case for libp2p, I think it should be added as a terminator protocol to the multiaddr protocol list.
MQTT is based on a client-server logic. You can run mqtt from a client to a server on any duplex connection. Originally it was run even on RS232.
On the JS side, it can run on any Node.js Duplex (even on browsers).
IoT seems to be a good use-case of libp2p in general, so support should be added for IoT protocols like MQTT. Luckily it already has a path-like addressing syntax, so it could be considered a (restricted) type of path protocol, eg /mqtt/stat/tasmota/POWER. This can then be combined with host resolution protocols, eg /mdns/mqtt.local/tcp/1883/tls/sni/mqtt/stat/tasmota/POWER