Trait ethcore::snapshot::SnapshotService
source · [−]pub trait SnapshotService: Sync + Send {
Show 13 methods
fn manifest(&self) -> Option<ManifestData>;
fn manifest_block(&self) -> Option<(u64, H256)>;
fn supported_versions(&self) -> Option<(u64, u64)>;
fn completed_chunks(&self) -> Option<Vec<H256>>;
fn chunk(&self, hash: H256) -> Option<Bytes>;
fn restoration_status(&self) -> RestorationStatus;
fn creation_status(&self) -> CreationStatus;
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);
}
Expand description
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>
fn manifest(&self) -> Option<ManifestData>
Query the most recent manifest data.
Query the most recent snapshoted block number and hash.
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>>
fn completed_chunks(&self) -> Option<Vec<H256>>
Returns a list of the completed chunks
fn restoration_status(&self) -> RestorationStatus
fn restoration_status(&self) -> RestorationStatus
Ask the snapshot service for the restoration status.
fn creation_status(&self) -> CreationStatus
fn creation_status(&self) -> CreationStatus
Ask the snapshot service for the creation status.
fn begin_restore(&self, manifest: ManifestData)
fn begin_restore(&self, manifest: ManifestData)
Begin snapshot restoration. If restoration in-progress, this will reset it. From this point on, any previous snapshot may become unavailable.
fn abort_restore(&self)
fn abort_restore(&self)
Abort an in-progress restoration if there is one.
fn restore_state_chunk(&self, hash: H256, chunk: Bytes)
fn restore_state_chunk(&self, hash: H256, chunk: Bytes)
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)
fn restore_block_chunk(&self, hash: H256, chunk: Bytes)
Feed a raw block chunk to the service to be processed asynchronously. no-op if currently restoring.
fn abort_snapshot(&self)
fn abort_snapshot(&self)
Abort in-progress snapshotting if there is one.