{"repo":"celestiaorg/go-libp2p-messenger","free":true,"listed":false,"github":"https://github.com/celestiaorg/go-libp2p-messenger","clone":"git clone https://github.com/celestiaorg/go-libp2p-messenger.git","description":"Messenger provides a simple arbitrary message sending API to multiple peers for libp2p-based protocols.","language":"Go","stars":20,"topics":["messaging","libp2p","p2p"],"license":"Apache-2.0","category":"chat-messaging","readme_excerpt":"Messenger [![build-img]][build-url] [![pkg-img]][pkg-url] [![reportcard-img]][reportcard-url] [![coverage-img]][coverage-url] Messenger provides a simple arbitrary message sending API to multiple peers for libp2p-based protocols. The main purpose is to bootstrap development for new protocols and decrease boilerplate code. Features Simple non-blocking API Not a protocol - sends only user's data without message wrapping on the wire Not a framework - use it anyhow Integrates generics in a clean way Almost zero allocations API Hides away stream management(re-creation, duplicates, lifecycle) Background The libp2p provides all necessary primitives to build custom fully decentralized p2p protocols. Also, it is solely stream-based for reasons, but in practice, the vast majority of libp2p based protocols are message-based, with messages sent over reliable and multiplexed streams. Mainly, there are two typical patterns for message sending over streams. Request/Response The most popular pattern in libp2p protocols is sending requests over a fresh stream and waiting for a response with a subsequent closing. Using libp2p's bare Stream API is trivial for such a case, which also explains why it is the most popular pattern. 'Fire and Forget' Another less common pattern in libp2p protocols is sending messages without expecting a response. Once instantiated, a protocol establishes a unique and persistent stream with a remote endpoint and only sends messages over it. This pattern optimizes prot","default_branch":null,"files":null,"tree":[],"storefront":"/r/celestiaorg","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/celestiaorg/go-libp2p-messenger/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}