pea2pea
pea2pea is a P2P library designed with the following use cases in mind:
- simple and quick creation of P2P networks
- testing/verifying network protocols
- benchmarking and stress-testing P2P nodes (or other network entities)
- substituting other, "heavier" nodes in local network tests
goals
- small, simple codebase
- ease of use
- interoperability
- good performance
non-goals
no_std- DHT (it can be applied on top, however)
- becoming a framework
- support for multiple
asyncruntimes
current state: alpha
- the basic functionalities are available and seem to be working
- the documentation is pretty much non-existent
- plenty of FIXMEs and TODOs left to iron out
- the public APIs are a bit messy and definitely subject to change
- the tests need to be extended
how to use it
- define a custom struct containing an
Arc<Node>and any extra state you'd like to carry impl ContainsNodefor it- make it implement any/all of the protocols
- create that struct (or as many of them as you like)
enable_X_protocolfor all the protocols you want it to activate
that's it!
- the
testsdirectory contains some examples of simple use examplescontain more advanced setups, e.g. using noise encryption