pea2pea is a P2P library designed with the following use cases in mind:
- simple and quick creation of custom P2P networks
- testing/verifying network protocols
- benchmarking and stress-testing P2P nodes (or other network entities)
- substituting other, "heavier" nodes in local network tests
- small, simple codebase: the library - including the optional protocols - is under 1k LOC and there are few dependencies
- ease of use: few objects and traits, no "turboeels" or generics/references forcing all parent objects to adapt
- correctness: no
unsafecode; there's more code inteststhan in the actual library - interoperability: strives to be as versatile as possible without sacrificing simplicity and ease of use
- good performance: over 1GB/s in favorable scenarios, small memory footprint
no_std- becoming a framework
- support for multiple
asyncruntimes (it should be simple enough to change it, though) - any functionality that can be introduced "on top" (e.g. DHT, advanced topology formation algorithms etc.)
- define a clonable struct containing a
Nodeand any extra state you'd like to carry impl Pea2Peafor it- make it implement any/all of the protocols
- create that struct (or as many of them as you like)
- enable protocols you'd like the node(s) to utilize
That's it!