mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
[Temp Commit] Implements more basic skeleton code.
This commit is contained in:
18
beacon_node/network/src/message_handler.rs
Normal file
18
beacon_node/network/src/message_handler.rs
Normal 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),
|
||||
}
|
||||
Reference in New Issue
Block a user