Skip to content

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

License

Notifications You must be signed in to change notification settings

stelar-labs/pulsar-network-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulsar Network

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

Author

Roy R. O. Okello

Email

Github

Twitter

Features

  • send and receive messages between peers.
  • messages contain a body, chain, nonce, time and topic.
  • peers can join the network by sending join requests to other peers returning known addresses
  • peers can be pinged and respond with the route.
  • message topics are block, block request, cancel transaction, join request, join response, ping request, ping response and transaction
  • currently supported routes are peer and validation.

API

Client

use pulsar_network::{Chain, Client, Route, Topic};

let bootstrap = false;

let chain = Chain::Test;

let route = Route::Peer;

let seeders: Vec<SocketAddr>;

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

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

Message

use pulsar_network::{Message, Topic};

let block_bytes;

let mut message = Message::new(&block_bytes, &chain, &Topic::Block);

Broadcast

let tx_bytes;

client.broadcast(&tx_bytes, &Route::Validation, &Topic::Transaction);

Send

network.send(&address, &block_bytes, &Topic::Block)

Contributions

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

Twitter

2022-06-18

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages