diff --git a/README.md b/README.md index 74dc824..ed51f92 100644 --- a/README.md +++ b/README.md @@ -1,96 +1,14 @@ -# Push-CDN +# The Push-CDN -## What is the Push-CDN? -The Push-CDN is a distributed and fault tolerant messaging system purpose-built to support peer-to-peer networks. +The Push-CDN is a distributed and fault tolerant messaging system built to accelerate peer-to-peer networks. It does this by keeping track of the network topology, which enables it to route messages more efficiently than traditional gossip-based protocols. ## Feature highlights - Fast, reliable, and efficient - Support for both publish-subscribe and direct messaging models - First class support for routing and authentication on top of public-key cryptosystems -## System components -- `Broker`: The discrete message-passing unit of the system. -- `Marshal`: Deals with user authentication and load balancing -- `Redis`: Used as a consistent core for authentication states and broker discovery - -## Diagrams -![supports 1..n brokers](https://github.com/EspressoSystems/push-cdn/blob/master/diagrams/nbrokers.png?raw=true) -*supports 1..n brokers* - -![high level connection map](https://github.com/EspressoSystems/push-cdn/blob/master/diagrams/high-level-connections.png?raw=true) -*high level connection map* - -## Client example using `jellyfish` keys -```rust -#[tokio::main] -async fn main() { - // Generate a random keypair - let (private_key, public_key) = - BLS::key_gen(&(), &mut StdRng::from_entropy()).unwrap(); - - // Build the config, the endpoint being where we expect the marshal to be - let config = ConfigBuilder::default() - .endpoint("127.0.0.1:8082".to_string()) - // Private key is only used for signing authentication messages - .keypair(KeyPair { - public_key, - private_key, - }) - // Subscribe to the global consensus topic - .subscribed_topics(vec![TestTopic::Global as u8]) - .build() - .unwrap(); - - // Create a client, specifying the BLS signature algorithm - // and the `QUIC` protocol. - let client = Client::::new(config) - .await - .unwrap(); - - // Send a direct message to ourselves - client - .send_direct_message(&public_key, b"hello direct".to_vec()) - .await - .unwrap(); - - // Receive the direct message - let message = client - .receive_message() - .await - .unwrap(); - - // Assert we've received the proper direct message - assert!( - message - == Message::Direct(Direct { - recipient: public_key.serialize().unwrap(), - message: b"hello direct".to_vec() - }) - ); - - // Send a broadcast message to the global topic - client - .send_broadcast_message(vec![TestTopic::Global as u8], b"hello broadcast".to_vec()) - .await - .unwrap(); - - // Receive the broadcast message - let message = client - .receive_message() - .await - .unwrap(); - - // Assert we've received the proper broadcast message - assert!( - message - == Message::Broadcast(Broadcast { - topics: vec![TestTopic::Global as u8], - message: b"hello broadcast".to_vec() - }) - ); -} -``` -Full example available [here](./cdn-client/src/main.rs) +## Examples +A client example using `jellyfish` keys is available [here](./cdn-client/src/binaries/client.rs) ## Running locally Running locally can be achieved via the supplied `process-compose.yaml`: diff --git a/diagrams/high-level-connections.png b/diagrams/high-level-connections.png deleted file mode 100644 index d536b00..0000000 Binary files a/diagrams/high-level-connections.png and /dev/null differ diff --git a/diagrams/nbrokers.png b/diagrams/nbrokers.png deleted file mode 100644 index f2b9b63..0000000 Binary files a/diagrams/nbrokers.png and /dev/null differ