go-libp2p-daemon icon indicating copy to clipboard operation
go-libp2p-daemon copied to clipboard

Multiaddress byte representation in Control Protocol

Open Nashatyrev opened this issue 6 years ago • 5 comments

Just wondering why Daemon interface operates with byte representation of multiaddress? The interface appears pretty highlevel and the string representation would look more appropriate

Nashatyrev avatar Dec 14 '18 15:12 Nashatyrev

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 avatar Jan 31 '19 03:01 mhchia

@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

Nashatyrev avatar Jan 31 '19 05:01 Nashatyrev

There are multiaddrs in several other places (eg: the PeerInfo objects returned by various operations), so it felt appropriate to use the binary format.

vyzo avatar Jan 31 '19 08:01 vyzo

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).

vyzo avatar Jan 31 '19 08:01 vyzo

@Nashatyrev You're right, sorry. I was writing code related to that part, so I only came up with that usage 😂 .

mhchia avatar Jan 31 '19 10:01 mhchia