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§
sourcefn echo(&self, request: RequestEcho) -> ResponseEcho
fn echo(&self, request: RequestEcho) -> ResponseEcho
Echo back the same message as provided in the request.
sourcefn info(&self, _request: RequestInfo) -> ResponseInfo
fn info(&self, _request: RequestInfo) -> ResponseInfo
Provide information about the ABCI application.
sourcefn init_chain(&self, _request: RequestInitChain) -> ResponseInitChain
fn init_chain(&self, _request: RequestInitChain) -> ResponseInitChain
Called once upon genesis.
sourcefn query(&self, _request: RequestQuery) -> ResponseQuery
fn query(&self, _request: RequestQuery) -> ResponseQuery
Query the application for data at the current or past height.
sourcefn check_tx(&self, _request: RequestCheckTx) -> ResponseCheckTx
fn check_tx(&self, _request: RequestCheckTx) -> ResponseCheckTx
Check the given transaction before putting it into the local mempool.
sourcefn flush(&self) -> ResponseFlush
fn flush(&self) -> ResponseFlush
Signals that messages queued on the client should be flushed to the server.
sourcefn commit(&self) -> ResponseCommit
fn commit(&self) -> ResponseCommit
Commit the current state at the current height.
sourcefn list_snapshots(&self) -> ResponseListSnapshots
fn list_snapshots(&self) -> ResponseListSnapshots
Used during state sync to discover available snapshots on peers.
sourcefn offer_snapshot(
&self,
_request: RequestOfferSnapshot
) -> ResponseOfferSnapshot
fn offer_snapshot( &self, _request: RequestOfferSnapshot ) -> ResponseOfferSnapshot
Called when bootstrapping the node using state sync.
sourcefn load_snapshot_chunk(
&self,
_request: RequestLoadSnapshotChunk
) -> ResponseLoadSnapshotChunk
fn load_snapshot_chunk( &self, _request: RequestLoadSnapshotChunk ) -> ResponseLoadSnapshotChunk
Used during state sync to retrieve chunks of snapshots from peers.
sourcefn apply_snapshot_chunk(
&self,
_request: RequestApplySnapshotChunk
) -> ResponseApplySnapshotChunk
fn apply_snapshot_chunk( &self, _request: RequestApplySnapshotChunk ) -> ResponseApplySnapshotChunk
Apply the given snapshot chunk to the application’s state.
sourcefn prepare_proposal(
&self,
request: RequestPrepareProposal
) -> ResponsePrepareProposal
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++.
sourcefn process_proposal(
&self,
_request: RequestProcessProposal
) -> ResponseProcessProposal
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++.