pulsar-network

Crates.iopulsar-network
lib.rspulsar-network
version0.8.0
sourcesrc
created_at2021-12-09 13:39:28.186401
updated_at2022-05-03 10:34:51.061121
descriptionPulsar Network is a distributed hash table peer-to-peer communication protocol for the Astreuos Blockchain.
homepage
repositoryhttps://github.com/stelar-labs/pulsar-network-rs
max_upload_size
id495157
size26,804
Roy (royokello)

documentation

README

Pulsar Network

Pulsar Network is the distributed hash table peer-to-peer communication protocol for the Astreuos Blockchain.

Features

  • send and receive messages between peers.
  • messages are contained in an envelope with the context, nonce, sender, route and time.
  • message encryption uses chacha20poly1305 and a x25519 blake3 flavor as the key.
  • peers can join the network by sending join requests and valid peers returning the nearest peers
  • peers can be pinged and respond with their public key and route supported.
  • currently supported routes are Astreuos blockchain main and test routes used for validation.

API

Client

use pulsar_network::{Client, Route};

let bootstrap = false;

let route = Route::Test

let seeders: Vec<SocketAddr>;

let client = Client::new(bootstrap, route, seeders);

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

Message

use pulsar_network::{Message, Kind};

let mut message = Message::new(Kind::Block, message_bytes);

Broadcast

network.broadcast(message);

Send

network.send(message, peer)

Improvements

  • multi-threading
  • ephemeral keys
  • bluetooth communication

Contributions

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

2022-05-03

Commit count: 32

cargo fmt