[Temp Commit] Implements more basic skeleton code.

This commit is contained in:
Age Manning
2019-03-04 16:39:37 +11:00
parent 2e020a3efa
commit 3b8f29a914
19 changed files with 195 additions and 93 deletions

View File

@@ -0,0 +1,18 @@
use crate::node_message::NodeMessage;
/// Handles messages received from the network and client and organises syncing.
pub struct MessageHandler {
sync: Syncer,
//TODO: Implement beacon chain
//chain: BeaconChain
}
/// Types of messages the handler can receive.
pub enum HandlerMessage {
/// Peer has connected.
PeerConnected(PeerId),
/// Peer has disconnected,
PeerDisconnected(PeerId),
/// A Node message has been received.
Message(Peer, NodeMessage),
}