#connect #swarm

melnet2

JSON-RPC/nanorpc-based, low-level auto-peering RPC protocol used throughout Themelio for peer-to-peer communciations

13 releases

0.3.1 Feb 24, 2023
0.3.0 Feb 21, 2023
0.2.1 Feb 4, 2023
0.1.9 Nov 27, 2022
0.1.3 Sep 30, 2022
Download history 363/week @ 2023-06-06 275/week @ 2023-06-13 304/week @ 2023-06-20 364/week @ 2023-06-27 367/week @ 2023-07-04 217/week @ 2023-07-11 234/week @ 2023-07-18 214/week @ 2023-07-25 170/week @ 2023-08-01 239/week @ 2023-08-08 219/week @ 2023-08-15 210/week @ 2023-08-22 249/week @ 2023-08-29 510/week @ 2023-09-05 226/week @ 2023-09-12 224/week @ 2023-09-19

1,271 downloads per month
Used in 12 crates (5 directly)

ISC license

27KB
554 lines

melnet2: Themelio's peer-to-peer protocol

melnet2 is Themelio's peer-to-peer protocol. It is an overlay network that can be built over any nanorpc transport. The two important items are:

  • Backhaul, which is a trait that fully describes an underlying protocol (e.g. JSON-RPC over TCP, JSON-RPC over HTTP)
    • We provide TcpBackhaul, an high-performance, pipelined implementation of JSON-RPC over TCP
  • Swarm, which wraps around a Backhaul to implement an auto-peering peer-to-peer network of nodes implementing some nanorpc RPC protocol.
    • Swarm essentialy adds functionality for discovering peers and forming a randomly structured gossip network to any nanorpc-based system.

See examples/mn2-gossip for an example program.

Dependencies

~13–53MB
~831K SLoC