diff options
Diffstat (limited to 'src/proto.rs')
-rw-r--r-- | src/proto.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/proto.rs b/src/proto.rs index 029a58df..6cb12598 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -1,8 +1,28 @@ +use std::net::SocketAddr; use serde::{Serialize, Deserialize}; +use crate::data::*; + #[derive(Debug, Serialize, Deserialize)] pub enum Message { Ok, Error(String), + Ping(PingMessage), + AdvertiseNode(AdvertiseNodeMessage), +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct PingMessage { + pub id: UUID, + pub rpc_port: u16, + + pub present_hash: Hash, + pub config_version: u64, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct AdvertiseNodeMessage { + pub id: UUID, + pub addr: SocketAddr, } |