Trait vapcore_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 abort_snapshot(&self);
fn shutdown(&self); }

The interface for a snapshot network service. This handles:

  • restoration of snapshots to temporary databases.
  • responding to queries for snapshot manifests and chunks

Required methods

fn manifest(&self) -> Option<ManifestData>[src]

Query the most recent manifest data.

fn supported_versions(&self) -> Option<(u64, u64)>[src]

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

fn completed_chunks(&self) -> Option<Vec<H256>>[src]

Returns a list of the completed chunks

fn chunk(&self, hash: H256) -> Option<Bytes>[src]

Get raw chunk for a given hash.

fn status(&self) -> RestorationStatus[src]

Ask the snapshot service for the restoration status.

fn begin_restore(&self, manifest: ManifestData)[src]

Begin snapshot restoration. If a restoration is in progress, this will reset it and clear all data.

fn abort_restore(&self)[src]

Abort an in-progress restoration if there is one.

fn restore_state_chunk(&self, hash: H256, chunk: Bytes)[src]

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

fn restore_block_chunk(&self, hash: H256, chunk: Bytes)[src]

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

fn abort_snapshot(&self)[src]

Abort in-progress snapshotting if there is one.

fn shutdown(&self)[src]

Shutdown the Snapshot Service by aborting any ongoing restore

Loading content...

Implementors

impl<C: Send + Sync> SnapshotService for Service<C>[src]

Loading content...