#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 118/week @ 2024-01-01 128/week @ 2024-01-08 134/week @ 2024-01-15 117/week @ 2024-01-22 103/week @ 2024-01-29 132/week @ 2024-02-05 108/week @ 2024-02-12 90/week @ 2024-02-19 161/week @ 2024-02-26 104/week @ 2024-03-04 144/week @ 2024-03-11 131/week @ 2024-03-18 186/week @ 2024-03-25 163/week @ 2024-04-01 80/week @ 2024-04-08 104/week @ 2024-04-15

547 downloads per month
Used in 13 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–52MB
~796K SLoC