Trait vapcore_snapshot::SnapshotComponents[][src]

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

Components necessary for snapshot creation and restoration.

Required methods

fn chunk_all(
    &mut self,
    chain: &BlockChain,
    block_at: H256,
    chunk_sink: &mut ChunkSink<'_>,
    progress: &RwLock<Progress>,
    preferred_size: usize
) -> Result<(), SnapshotError>
[src]

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.

fn rebuilder(
    &self,
    chain: BlockChain,
    db: Arc<dyn BlockChainDB>,
    manifest: &ManifestData
) -> Result<Box<dyn Rebuilder>, Error>
[src]

Create a rebuilder, which will have chunks fed into it in arbitrary 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.

fn min_supported_version(&self) -> u64[src]

Minimum supported snapshot version number.

fn current_version(&self) -> u64[src]

Current version number

Loading content...

Implementors

impl SnapshotComponents for PoaSnapshot[src]

impl SnapshotComponents for PowSnapshot[src]

Loading content...