Trait tendermint_abci::Application

source ·
pub trait Application: Send + Clone + 'static {
Show 16 methods // Provided methods fn echo(&self, request: RequestEcho) -> ResponseEcho { ... } fn info(&self, _request: RequestInfo) -> ResponseInfo { ... } fn init_chain(&self, _request: RequestInitChain) -> ResponseInitChain { ... } fn query(&self, _request: RequestQuery) -> ResponseQuery { ... } fn check_tx(&self, _request: RequestCheckTx) -> ResponseCheckTx { ... } fn flush(&self) -> ResponseFlush { ... } fn commit(&self) -> ResponseCommit { ... } fn list_snapshots(&self) -> ResponseListSnapshots { ... } fn offer_snapshot( &self, _request: RequestOfferSnapshot ) -> ResponseOfferSnapshot { ... } fn load_snapshot_chunk( &self, _request: RequestLoadSnapshotChunk ) -> ResponseLoadSnapshotChunk { ... } fn apply_snapshot_chunk( &self, _request: RequestApplySnapshotChunk ) -> ResponseApplySnapshotChunk { ... } fn prepare_proposal( &self, request: RequestPrepareProposal ) -> ResponsePrepareProposal { ... } fn process_proposal( &self, _request: RequestProcessProposal ) -> ResponseProcessProposal { ... } fn extend_vote(&self, _request: RequestExtendVote) -> ResponseExtendVote { ... } fn verify_vote_extension( &self, _request: RequestVerifyVoteExtension ) -> ResponseVerifyVoteExtension { ... } fn finalize_block( &self, _request: RequestFinalizeBlock ) -> ResponseFinalizeBlock { ... }
}
Expand description

An ABCI application.

Applications are Send + Clone + 'static because they are cloned for each incoming connection to the ABCI Server. It is up to the application developer to manage shared state between these clones of their application.

Provided Methods§

source

fn echo(&self, request: RequestEcho) -> ResponseEcho

Echo back the same message as provided in the request.

source

fn info(&self, _request: RequestInfo) -> ResponseInfo

Provide information about the ABCI application.

source

fn init_chain(&self, _request: RequestInitChain) -> ResponseInitChain

Called once upon genesis.

source

fn query(&self, _request: RequestQuery) -> ResponseQuery

Query the application for data at the current or past height.

source

fn check_tx(&self, _request: RequestCheckTx) -> ResponseCheckTx

Check the given transaction before putting it into the local mempool.

source

fn flush(&self) -> ResponseFlush

Signals that messages queued on the client should be flushed to the server.

source

fn commit(&self) -> ResponseCommit

Commit the current state at the current height.

source

fn list_snapshots(&self) -> ResponseListSnapshots

Used during state sync to discover available snapshots on peers.

source

fn offer_snapshot( &self, _request: RequestOfferSnapshot ) -> ResponseOfferSnapshot

Called when bootstrapping the node using state sync.

source

fn load_snapshot_chunk( &self, _request: RequestLoadSnapshotChunk ) -> ResponseLoadSnapshotChunk

Used during state sync to retrieve chunks of snapshots from peers.

source

fn apply_snapshot_chunk( &self, _request: RequestApplySnapshotChunk ) -> ResponseApplySnapshotChunk

Apply the given snapshot chunk to the application’s state.

source

fn prepare_proposal( &self, request: RequestPrepareProposal ) -> ResponsePrepareProposal

A stage where the application can modify the list of transactions in the preliminary proposal.

The default implementation implements the required behavior in a very naive way, removing transactions off the end of the list until the limit on the total size of the transaction is met as specified in the max_tx_bytes field of the request, or there are no more transactions. It’s up to the application to implement more elaborate removal strategies.

This method is introduced in ABCI++.

source

fn process_proposal( &self, _request: RequestProcessProposal ) -> ResponseProcessProposal

A stage where the application can accept or reject the proposed block.

The default implementation returns the status value of ACCEPT.

This method is introduced in ABCI++.

source

fn extend_vote(&self, _request: RequestExtendVote) -> ResponseExtendVote

source

fn verify_vote_extension( &self, _request: RequestVerifyVoteExtension ) -> ResponseVerifyVoteExtension

source

fn finalize_block( &self, _request: RequestFinalizeBlock ) -> ResponseFinalizeBlock

Object Safety§

This trait is not object safe.

Implementors§