light client sync stubs

This commit is contained in:
Robert Habermeier
2016-10-05 15:35:31 +02:00
parent ed06572bd4
commit 8d7244c09f
5 changed files with 39 additions and 34 deletions

View File

@@ -50,6 +50,7 @@ mod chain;
mod blocks;
mod sync_io;
mod snapshot;
mod light;
#[cfg(test)]
mod tests;

27
sync/src/light/mod.rs Normal file
View File

@@ -0,0 +1,27 @@
// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! LES Protocol Version 1 implementation.
//!
//! This uses a "Provider" to answer requests.
use ethcore::light::{Client, Provider};
/// This handles synchronization of the header chain for a light client.
pub struct Chain {
client: Client,
peers: Vec<Peer>,
}

View File

@@ -18,7 +18,7 @@ use network::{NetworkContext, PeerId, PacketId, NetworkError};
use ethcore::client::BlockChainClient;
use ethcore::snapshot::SnapshotService;
/// IO interface for the syning handler.
/// IO interface for the syncing handler.
/// Provides peer connection management and an interface to the blockchain client.
// TODO: ratings
pub trait SyncIo {
@@ -38,7 +38,7 @@ pub trait SyncIo {
fn peer_info(&self, peer_id: PeerId) -> String {
peer_id.to_string()
}
/// Maximum mutuallt supported ETH protocol version
/// Maximum mutually supported ETH protocol version
fn eth_protocol_version(&self, peer_id: PeerId) -> u8;
/// Returns if the chain block queue empty
fn is_chain_queue_empty(&self) -> bool {