mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 04:42:34 +00:00
Tidy networking crates
This commit is contained in:
@@ -3,7 +3,7 @@ use beacon_chain::{
|
||||
db::{ClientDB, DiskDB, MemoryDB},
|
||||
fork_choice::BitwiseLMDGhost,
|
||||
initialise,
|
||||
slot_clock::{SlotClock, SystemTimeSlotClock, TestingSlotClock},
|
||||
slot_clock::{SlotClock, SystemTimeSlotClock},
|
||||
BeaconChain,
|
||||
};
|
||||
use fork_choice::ForkChoice;
|
||||
|
||||
@@ -11,7 +11,7 @@ pub use client_types::ClientTypes;
|
||||
|
||||
//use beacon_chain::BeaconChain;
|
||||
use beacon_chain::BeaconChain;
|
||||
use exit_future::{Exit, Signal};
|
||||
use exit_future::Signal;
|
||||
use network::Service as NetworkService;
|
||||
use slog::o;
|
||||
use std::marker::PhantomData;
|
||||
@@ -55,7 +55,7 @@ impl<TClientType: ClientTypes> Client<TClientType> {
|
||||
// TODO: Add beacon_chain reference to network parameters
|
||||
let network_config = &config.net_conf;
|
||||
let network_logger = log.new(o!("Service" => "Network"));
|
||||
let (network, network_send) = NetworkService::new(
|
||||
let (network, _network_send) = NetworkService::new(
|
||||
beacon_chain.clone(),
|
||||
network_config,
|
||||
executor,
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
use crate::Client;
|
||||
use crate::ClientTypes;
|
||||
use db::ClientDB;
|
||||
use exit_future::Exit;
|
||||
use fork_choice::ForkChoice;
|
||||
use futures::{Future, Stream};
|
||||
use network::NodeMessage;
|
||||
use slog::{debug, info, o};
|
||||
use slot_clock::SlotClock;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::{Duration, Instant};
|
||||
use tokio::runtime::TaskExecutor;
|
||||
@@ -27,12 +23,13 @@ pub fn run<T: ClientTypes>(client: &Client<T>, executor: TaskExecutor, exit: Exi
|
||||
// build heartbeat logic here
|
||||
let heartbeat = move |_| {
|
||||
info!(log, "Temp heartbeat output");
|
||||
//TODO: Remove this logic. Testing only
|
||||
let mut count = counter.lock().unwrap();
|
||||
*count += 1;
|
||||
|
||||
if *count % 5 == 0 {
|
||||
debug!(log, "Sending Message");
|
||||
network.send_message(String::from("Testing network channel"))
|
||||
network.send_message();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user