mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Add task to heartbeat a tributary to the P2P code
This commit is contained in:
30
coordinator/src/p2p/mod.rs
Normal file
30
coordinator/src/p2p/mod.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use serai_client::primitives::NetworkId;
|
||||
|
||||
mod reqres;
|
||||
use reqres::{Request, Response};
|
||||
|
||||
mod gossip;
|
||||
|
||||
mod heartbeat;
|
||||
|
||||
struct Peer;
|
||||
impl Peer {
|
||||
async fn send(&self, request: Request) -> Result<Response, tokio::time::error::Elapsed> {
|
||||
(async move { todo!("TODO") }).await
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct P2p;
|
||||
impl P2p {
|
||||
async fn peers(&self, set: NetworkId) -> Vec<Peer> {
|
||||
(async move { todo!("TODO") }).await
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl tributary::P2p for P2p {
|
||||
async fn broadcast(&self, genesis: [u8; 32], msg: Vec<u8>) {
|
||||
todo!("TODO")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user