Disconnect message in libp2p

Is there a “disconnect” message to disconnect peers, defined as part of the libp2p protocol(s)?

Note I’m asking about a specific message, not how an implementation’s connection manager may manage peers.
Something similar to Ethereum’s disconnect, allowing a graceful shutdown, establishing well-behaving nodes.

I could see it was discussed in the past (e.g. here), but could not find that is implemented as part of the specification.

Hey afaik no.

We just send FIN Packets (or whatever equivalent in yamux, quic, …).

However that terminates the connections its not warning you.

We do things the other way arround, consumers tell the connection manager to tag the connection not to be closed.

All connections are seen as removable except said otherwise (its implementations like bitswap client may do that, its not a protocol thing).

ok, thanks.
so basically, if I want to have a graceful disconnect I have to do it as an applicative protocol, on top of libp2p.
right?

Unfortunately no support for graceful disconnects in libp2p today. It is on our Roadmap, though as far as I know no one is working on it.

Let us know in case you are interested working on this.

1 Like