Propagate RPC through network service.

- Basic network message handler threading
- Correct references
This commit is contained in:
Age Manning
2019-03-17 21:49:56 +11:00
parent 7370306366
commit 9803ab30f2
11 changed files with 68 additions and 60 deletions

View File

@@ -1,27 +1,16 @@
use libp2p::PeerId;
use libp2p::{HelloMessage, RpcEvent};
use types::{Hash256, Slot};
/// Messages between nodes across the network.
#[derive(Debug, Clone)]
pub enum NodeMessage {
Status(Status),
RPC(RpcEvent),
BlockRequest,
// TODO: only for testing - remove
Message(String),
}
#[derive(Debug, Clone)]
pub struct Status {
/// Current node version.
version: u8,
/// Genesis Hash.
genesis_hash: Hash256,
/// Best known slot number.
best_slot: Slot,
/// Best known slot hash.
best_slot_hash: Hash256,
}
/// Types of messages that the network service can receive.
#[derive(Debug, Clone)]
pub enum NetworkMessage {