Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-maron committed Jan 7, 2025
1 parent 9409763 commit adc4191
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 86 deletions.
90 changes: 4 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -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::<BLS, Quic>::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`:
Expand Down
Binary file removed diagrams/high-level-connections.png
Binary file not shown.
Binary file removed diagrams/nbrokers.png
Binary file not shown.

0 comments on commit adc4191

Please sign in to comment.