chord-dht 0.1.0

A DHT implementation in Rust based on Chord with high peformance and data replication.
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::{rpc::NodeServiceClient, core::DhtResult};
use tarpc::tokio_serde::formats::Bincode;
use log::info;

pub async fn setup_client(addr: &str) -> DhtResult<NodeServiceClient> {
	info!("connecting to {}", addr);
	let transport = tarpc::serde_transport::tcp::connect(addr,Bincode::default).await?;
	info!("connected to {}", addr);
	Ok(NodeServiceClient::new(tarpc::client::Config::default(), transport).spawn())
}