#protocols #json-rpc #networking #p2p #low-level #themelio #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

#1 in #themelio

Download history 163/week @ 2023-12-06 220/week @ 2023-12-13 173/week @ 2023-12-20 136/week @ 2023-12-27 118/week @ 2024-01-03 131/week @ 2024-01-10 139/week @ 2024-01-17 102/week @ 2024-01-24 104/week @ 2024-01-31 146/week @ 2024-02-07 89/week @ 2024-02-14 117/week @ 2024-02-21 145/week @ 2024-02-28 114/week @ 2024-03-06 137/week @ 2024-03-13 211/week @ 2024-03-20

635 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

~16–54MB
~820K SLoC