diff --git a/domo_node/src/config/node.rs b/domo_node/src/config/node.rs index 618350f..5ee5b3e 100644 --- a/domo_node/src/config/node.rs +++ b/domo_node/src/config/node.rs @@ -1,10 +1,14 @@ use serde::{Deserialize, Serialize}; use std::fmt::{Display, Formatter}; +use domo_proto::packet::identifier::Identifier; #[derive(Debug, Serialize, Deserialize, Clone)] pub enum NodeType { #[serde(rename = "master")] - Master, + Master { + bind: String, + identifier: String + }, #[serde(rename = "relay")] Relay { master_address: String @@ -18,7 +22,7 @@ pub enum NodeType { impl Display for NodeType { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - NodeType::Master => write!(f, "master"), + NodeType::Master { .. } => write!(f, "master"), NodeType::Relay { .. } => write!(f, "relay"), NodeType::Subnet { .. } => write!(f, "subnet"), } @@ -27,7 +31,10 @@ impl Display for NodeType { impl Default for NodeType { fn default() -> Self { - Self::Master + Self::Master { + bind: String::from("0.0.0.0:4480"), + identifier: hex::encode(Identifier::random().to_string()) + } } }