Trait ethcore::snapshot::SnapshotService [] [src]

pub trait SnapshotService: Sync + Send {
    fn manifest(&self) -> Option<ManifestData>;
fn supported_versions(&self) -> Option<(u64, u64)>;
fn completed_chunks(&self) -> Option<Vec<H256>>;
fn chunk(&self, hash: H256) -> Option<Bytes>;
fn status(&self) -> RestorationStatus;
fn begin_restore(&self, manifest: ManifestData);
fn abort_restore(&self);
fn restore_state_chunk(&self, hash: H256, chunk: Bytes);
fn restore_block_chunk(&self, hash: H256, chunk: Bytes);
fn shutdown(&self); }

The interface for a snapshot network service. This handles:

Required Methods

Query the most recent manifest data.

Get the supported range of snapshot version numbers. None indicates warp sync isn't supported by the consensus engine.

Returns a list of the completed chunks

Get raw chunk for a given hash.

Ask the snapshot service for the restoration status.

Begin snapshot restoration. If restoration in-progress, this will reset it. From this point on, any previous snapshot may become unavailable.

Abort an in-progress restoration if there is one.

Feed a raw state chunk to the service to be processed asynchronously. no-op if not currently restoring.

Feed a raw block chunk to the service to be processed asynchronously. no-op if currently restoring.

Shutdown the Snapshot Service by aborting any ongoing restore

Implementors