Libp2p-episub: Proximity Aware Epidemic PubSub for libp2p
This Rust library implements a libp2p
behaviour for efficient large-scale pub/sub protocol based on ideas the following academic papers:
- HyParView: For topic-peer-membership management and node discovery
- Epidemic Broadcast Trees: For constructing efficient broadcast trees and efficient content dessamination
- GoCast: Gossip-Enhanced Overlay Multicast for Fast and Dependable Group Communication
Originally speced by @vyzo as a successor of Gossipsub.
Running a topology with 201 peers:
$ docker-compose up --scale node_n=200 --remove-orphans
Testing and visualizing p2p network
First start the audit node and open it in the browser on port 80, you should see a P2P Protocols Lab
empty page.
$ docker-compose up -d node_audit
Then start the bootstrap node
$ docker-compose up -d node_0
You should see it immediately showing up in the labs page, then start 50 peer nodes and watch the network discover itself.
$ docker-compose up --scale node_n=50
Usage Examples
let local_key = generate_ed25519;
let local_peer_id = from;
let transport = development_transport.await?;
// Create a Swarm to manage peers and events
let mut swarm = new;
// Listen on all interfaces and whatever port the OS assigns
swarm
.listen_on
.unwrap;
// subscribe to the topic specified on the command line
swarm.behaviour_mut.subscribe;
swarm.dial.unwrap
while let Some = swarm.next.await