mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
[Temp Commit] Implements more basic skeleton code.
This commit is contained in:
27
beacon_node/network/src/messages.rs
Normal file
27
beacon_node/network/src/messages.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use types::{H256,Slot}
|
||||
|
||||
/// Messages between nodes across the network.
|
||||
pub enum NodeMessage {
|
||||
|
||||
Status(Status),
|
||||
BlockRequest,
|
||||
}
|
||||
|
||||
pub struct Status {
|
||||
/// Current node version.
|
||||
version: u8
|
||||
/// Genesis Hash.
|
||||
genesis_hash: H256
|
||||
/// Best known slot number.
|
||||
best_slot: Slot
|
||||
/// Best known slot hash.
|
||||
best_slot_hash: H256
|
||||
}
|
||||
|
||||
/// Types of messages that the network service can receive.
|
||||
pub enum NetworkMessage {
|
||||
/// Send a message to libp2p service.
|
||||
//TODO: Define typing for messages accross the wire
|
||||
Send(Node, Message),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user