pub trait Snapshot: Send + Sync {
fn echo<'life0, 'async_trait>(
&'life0 self,
echo_request: RequestEcho
) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn list_snapshots<'life0, 'async_trait>(
&'life0 self,
_list_snapshots_request: RequestListSnapshots
) -> Pin<Box<dyn Future<Output = ResponseListSnapshots> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn offer_snapshot<'life0, 'async_trait>(
&'life0 self,
_offer_snapshot_request: RequestOfferSnapshot
) -> Pin<Box<dyn Future<Output = ResponseOfferSnapshot> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn load_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_load_snapshot_chunk_request: RequestLoadSnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseLoadSnapshotChunk> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn apply_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_apply_snapshot_chunk_request: RequestApplySnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseApplySnapshotChunk> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn flush<'life0, 'async_trait>(
&'life0 self,
_flush_request: RequestFlush
) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
}
async-api
only.Expand description
Trait for serving and restoring tendermint’s state sync snapshots.
Details
State sync allows new nodes to rapidly bootstrap by discovering, fetching, and applying state machine snapshots instead of replaying historical blocks. For more details, see the state sync section.
When a new node is discovering snapshots in the P2P network, existing nodes will call
list_snapshots
on the application to retrieve any local state snapshots. The new node will
offer these snapshots to its local application via offer_snapshot
.
Once the application accepts a snapshot and begins restoring it, Tendermint will fetch snapshot
chunks from existing nodes via load_snapshot_chunk
and apply them sequentially to the local
application with apply_snapshot_chunk
. When all chunks have been applied, the application
app_hash
is retrieved via an info
query and compared to the blockchain’s app_hash
verified via light client.
Provided Methods
sourcefn echo<'life0, 'async_trait>(
&'life0 self,
echo_request: RequestEcho
) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn echo<'life0, 'async_trait>(
&'life0 self,
echo_request: RequestEcho
) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Echo a string to test abci client/server implementation.
Equivalent to
async fn echo(&self, echo_request: RequestEcho) -> ResponseEcho
sourcefn list_snapshots<'life0, 'async_trait>(
&'life0 self,
_list_snapshots_request: RequestListSnapshots
) -> Pin<Box<dyn Future<Output = ResponseListSnapshots> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_snapshots<'life0, 'async_trait>(
&'life0 self,
_list_snapshots_request: RequestListSnapshots
) -> Pin<Box<dyn Future<Output = ResponseListSnapshots> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Equivalent to
async fn list_snapshots(&self, list_snapshots_request: RequestListSnapshots) -> ResponseListSnapshots
sourcefn offer_snapshot<'life0, 'async_trait>(
&'life0 self,
_offer_snapshot_request: RequestOfferSnapshot
) -> Pin<Box<dyn Future<Output = ResponseOfferSnapshot> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn offer_snapshot<'life0, 'async_trait>(
&'life0 self,
_offer_snapshot_request: RequestOfferSnapshot
) -> Pin<Box<dyn Future<Output = ResponseOfferSnapshot> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Equivalent to
async fn offer_snapshot(&self: offer_snapshot_request: RequestOfferSnapshot) -> ResponseOfferSnapshot
sourcefn load_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_load_snapshot_chunk_request: RequestLoadSnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseLoadSnapshotChunk> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn load_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_load_snapshot_chunk_request: RequestLoadSnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseLoadSnapshotChunk> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Equivalent to
async fn load_snapshot_chunk(&self, load_snapshot_chunk_request: RequestLoadSnapshotChunk) -> ResponseLoadSnapshotChunk
sourcefn apply_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_apply_snapshot_chunk_request: RequestApplySnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseApplySnapshotChunk> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn apply_snapshot_chunk<'life0, 'async_trait>(
&'life0 self,
_apply_snapshot_chunk_request: RequestApplySnapshotChunk
) -> Pin<Box<dyn Future<Output = ResponseApplySnapshotChunk> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Equivalent to
async fn apply_snapshot_chunk(&self: apply_snapshot_chunk_request: RequestApplySnapshotChunk) -> ResponseApplySnapshotChunk
sourcefn flush<'life0, 'async_trait>(
&'life0 self,
_flush_request: RequestFlush
) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
_flush_request: RequestFlush
) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Signals that messages queued on the client should be flushed to the server.
Equivalent to
async fn flush(&self, flush_request: RequestFlush) -> ResponseFlush