Trait ethcore::snapshot::SnapshotComponents [] [src]

pub trait SnapshotComponents: Send {
    fn chunk_all(
        &mut self,
        chain: &BlockChain,
        block_at: H256,
        chunk_sink: &mut ChunkSink,
        preferred_size: usize
    ) -> Result<(), Error>;
fn rebuilder(
        &self,
        chain: BlockChain,
        db: Arc<KeyValueDB>,
        manifest: &ManifestData
    ) -> Result<Box<Rebuilder>, Error>;
fn min_supported_version(&self) -> u64;
fn current_version(&self) -> u64; }

Components necessary for snapshot creation and restoration.

Required Methods

Create secondary snapshot chunks; these corroborate the state data in the state chunks.

Chunks shouldn't exceed the given preferred size, and should be fed uncompressed into the sink.

This will vary by consensus engine, so it's exposed as a trait.

Create a rebuilder, which will have chunks fed into it in aribtrary order and then be finalized.

The manifest, a database, and fresh BlockChain are supplied.

The engine passed to the Rebuilder methods will be the same instance that created the SnapshotComponents.

Minimum supported snapshot version number.

Current version number

Implementors