go-libp2p-daemon
go-libp2p-daemon copied to clipboard
Multiaddress byte representation in Control Protocol
Just wondering why Daemon interface operates with byte representation of multiaddress? The interface appears pretty highlevel and the string representation would look more appropriate
I guess it's because the daemon can use unix domain socket as well as the tcp socket. A multiaddress can represent both protocols.
@mhchia The concern is not regarding the address of the daemon and not regarding the multiaddress itself but regarding its binary representation inside the Control Protocol between the daemon and a client
There are multiaddrs in several other places (eg: the PeerInfo objects returned by various operations), so it felt appropriate to use the binary format.
Also multiaddr is pretty well supported by the various languages and straightforward to implement for languages that don't have it yet (I had to implement for Gerbil, and it wasn't all that bad).
@Nashatyrev You're right, sorry. I was writing code related to that part, so I only came up with that usage 😂 .