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
fn chunk_all(
&mut self,
chain: &BlockChain,
block_at: H256,
chunk_sink: &mut ChunkSink,
preferred_size: usize
) -> Result<(), Error>
&mut self,
chain: &BlockChain,
block_at: H256,
chunk_sink: &mut ChunkSink,
preferred_size: usize
) -> Result<(), Error>
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<KeyValueDB>,
manifest: &ManifestData
) -> Result<Box<Rebuilder>, Error>
&self,
chain: BlockChain,
db: Arc<KeyValueDB>,
manifest: &ManifestData
) -> Result<Box<Rebuilder>, Error>
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
.
fn min_supported_version(&self) -> u64
Minimum supported snapshot version number.
fn current_version(&self) -> u64
Current version number
Implementors
impl SnapshotComponents for PoaSnapshot
impl SnapshotComponents for PowSnapshot