Struct ethcore::snapshot::service::Service
[−]
[src]
pub struct Service { /* fields omitted */ }
SnapshotService
implementation.
This controls taking snapshots and restoring from them.
Methods
impl Service
[src]
impl Service
pub fn new(params: ServiceParams) -> Result<Self, Error>
[src]
pub fn new(params: ServiceParams) -> Result<Self, Error>
Create a new snapshot service from the given parameters.
pub fn reader(&self) -> RwLockReadGuard<Option<LooseReader>>
[src]
pub fn reader(&self) -> RwLockReadGuard<Option<LooseReader>>
Get a reference to the snapshot reader.
pub fn tick(&self)
[src]
pub fn tick(&self)
Tick the snapshot service. This will log any active snapshot being taken.
pub fn take_snapshot(&self, client: &Client, num: u64) -> Result<(), Error>
[src]
pub fn take_snapshot(&self, client: &Client, num: u64) -> Result<(), Error>
Take a snapshot at the block with the given number. calling this while a restoration is in progress or vice versa will lead to a race condition where the first one to finish will have their produced snapshot overwritten.
pub fn init_restore(
&self,
manifest: ManifestData,
recover: bool
) -> Result<(), Error>
[src]
pub fn init_restore(
&self,
manifest: ManifestData,
recover: bool
) -> Result<(), Error>
Initialize the restoration synchronously. The recover flag indicates whether to recover the restored snapshot.
pub fn feed_state_chunk(&self, hash: H256, chunk: &[u8])
[src]
pub fn feed_state_chunk(&self, hash: H256, chunk: &[u8])
Feed a state chunk to be processed synchronously.
pub fn feed_block_chunk(&self, hash: H256, chunk: &[u8])
[src]
pub fn feed_block_chunk(&self, hash: H256, chunk: &[u8])
Feed a block chunk to be processed synchronously.
Trait Implementations
impl SnapshotService for Service
[src]
impl SnapshotService for Service
fn manifest(&self) -> Option<ManifestData>
[src]
fn manifest(&self) -> Option<ManifestData>
Query the most recent manifest data.
fn supported_versions(&self) -> Option<(u64, u64)>
[src]
fn supported_versions(&self) -> Option<(u64, u64)>
Get the supported range of snapshot version numbers. None
indicates warp sync isn't supported by the consensus engine. Read more
fn chunk(&self, hash: H256) -> Option<Bytes>
[src]
fn chunk(&self, hash: H256) -> Option<Bytes>
Get raw chunk for a given hash.
fn completed_chunks(&self) -> Option<Vec<H256>>
[src]
fn completed_chunks(&self) -> Option<Vec<H256>>
Returns a list of the completed chunks
fn status(&self) -> RestorationStatus
[src]
fn status(&self) -> RestorationStatus
Ask the snapshot service for the restoration status.
fn begin_restore(&self, manifest: ManifestData)
[src]
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. Read more
fn abort_restore(&self)
[src]
fn abort_restore(&self)
Abort an in-progress restoration if there is one.
fn restore_state_chunk(&self, hash: H256, chunk: Bytes)
[src]
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. Read more
fn restore_block_chunk(&self, hash: H256, chunk: Bytes)
[src]
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. Read more
fn shutdown(&self)
[src]
fn shutdown(&self)
Shutdown the Snapshot Service by aborting any ongoing restore
impl Drop for Service
[src]
impl Drop for Service