node: Implement Client

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent 35b0af9a68
commit e663e8c516
11 changed files with 228 additions and 38 deletions
+1 -10
View File
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
use crate::crypto;
use crate::identity::ProjId;
use crate::protocol::{Context, NodeId, Timestamp, NETWORK_MAGIC, PROTOCOL_VERSION};
use crate::protocol::{Context, NodeId, Timestamp, PROTOCOL_VERSION};
use crate::storage;
/// Message envelope. All messages sent over the network are wrapped in this type.
@@ -98,15 +98,6 @@ pub enum Message {
},
}
impl From<Message> for Envelope {
fn from(msg: Message) -> Self {
Self {
magic: NETWORK_MAGIC,
msg,
}
}
}
impl Message {
pub fn hello(id: NodeId, timestamp: Timestamp, addrs: Vec<Address>, git: Url) -> Self {
Self::Hello {