aboutsummaryrefslogblamecommitdiff
path: root/src/proto.rs
blob: 6cb12598e053134f5c73afd01a84d03d659da7cd (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                         

                                    

                   




                                        
















                                            
 
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,
}