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).
so basically, if I want to have a graceful disconnect I have to do it as an applicative protocol, on top of libp2p.
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.
This file has been truncated.
The libp2p project is creating a set of modular, loosely-coupled building blocks
(based on a shared core) for modern peer-to-peer networking. Our goal is to
enable a new generation of decentralized applications in which network nodes are
full peers, providing and consuming data, and routing traffic for one another,
all without the need for centralized infrastructure points or reliance on
third-party ownership of data.
**Table of Contents**
- [🖧 Decentralizing networks](#🖧-decentralizing-networks)
- [🤫 A spyproof libp2p](#🤫-a-spyproof-libp2p)
- [📱 libp2p in mobile devices](#📱-libp2p-in-mobile-devices)
- [💡 libp2p in IoT](#💡-libp2p-in-iot)
- [🎓 libp2p as a platform for Networks Research & Innovation](#🎓-libp2p-as-a-platform-for-networks-research--innovation)
- [🚑 Self-healing networks](#🚑-self-healing-networks)
- [📮 Offline message queue / postbox](#📮-offline-message-queue--postbox)