Pulsar Network

Pulsar Network is a distributed hash table peer-to-peer messaging protocol for the Astreuos Blockchain written in Rust.

Features

API

Connect

``` use pulsar_network::{ Network, Routes };

let route = Routes::TestValidation;

let network = Network::config(route);

for (message, peer) in network.messages { println!("Got: {}", message.body); }

```

Message

```

use pulsar_network::{ Message, MessageKind };

let blockastrofmt: &str = "0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00";

let mut message = Message::new(MessageKind::Block, blockastrofmt);

message = message.expiry(7_u8); // the default expiry is 1

```

Broadcast

```

network.broadcast(message, Routes::TestValidation);

```

Send

```

network.send(message, peer)

```

Contributions

Pull requests, bug reports and any kind of suggestion are welcome.

2022-02-26