Preparing light client structure [v2] (#150)

* light client structure + remote call requests
This commit is contained in:
Svyatoslav Nikolsky
2018-05-28 10:27:59 +03:00
committed by GitHub
parent ab7eae6f88
commit fa642cf01a
9 changed files with 626 additions and 374 deletions
+8 -2
View File
@@ -23,12 +23,18 @@ use tokio_core::reactor;
use network::{SyncState, SyncProvider};
use runtime_support::Hashable;
use primitives::block::HeaderHash;
use client::BlockchainEvents;
use state_machine;
use client::{self, BlockchainEvents};
const TIMER_INTERVAL_MS: u64 = 5000;
/// Spawn informant on the event loop
pub fn start(service: &Service, handle: reactor::Handle) {
pub fn start<B, E>(service: &Service<B, E>, handle: reactor::Handle)
where
B: client::backend::Backend + Send + Sync + 'static,
E: client::CallExecutor + Send + Sync + 'static,
client::error::Error: From<<<B as client::backend::Backend>::State as state_machine::backend::Backend>::Error>
{
let interval = reactor::Interval::new_at(Instant::now(), Duration::from_millis(TIMER_INTERVAL_MS), &handle)
.expect("Error creating informant timer");