Add task to heartbeat a tributary to the P2P code

This commit is contained in:
Luke Parker
2025-01-03 13:04:27 -05:00
parent 49c221cca2
commit 5fc8500f8d
3 changed files with 149 additions and 0 deletions

View 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")
}
}