Trait abci::Application

source ·
pub trait Application {
    fn info(&mut self, _req: &RequestInfo) -> ResponseInfo { ... }
    fn set_option(&mut self, _req: &RequestSetOption) -> ResponseSetOption { ... }
    fn query(&mut self, _req: &RequestQuery) -> ResponseQuery { ... }
    fn check_tx(&mut self, _req: &RequestCheckTx) -> ResponseCheckTx { ... }
    fn init_chain(&mut self, _req: &RequestInitChain) -> ResponseInitChain { ... }
    fn begin_block(&mut self, _req: &RequestBeginBlock) -> ResponseBeginBlock { ... }
    fn deliver_tx(&mut self, _p: &RequestDeliverTx) -> ResponseDeliverTx { ... }
    fn end_block(&mut self, _req: &RequestEndBlock) -> ResponseEndBlock { ... }
    fn commit(&mut self, _req: &RequestCommit) -> ResponseCommit { ... }
}
Expand description

Main Trait for ABCI application. Provides generic responses for all callbacks Override desired callbacks as needed. Tendermint makes 3 TCP connections to the application and does so in a synchonized manner.

Provided Methods§

Query Connection: Called on startup from Tendermint. The application should normally return the last know state so Tendermint can determine if it needs to replay blocks to the application.

Query Connection: Set options on the application (rarely used)

Query Connection: Query your application. This usually resolves through a merkle tree holding the state of the app.

Mempool Connection: Used to validate incoming transactions. If the application reponds with a non-zero value, the transaction is added to Tendermint’s mempool for processing on the deliver_tx call below.

Consensus Connection: Called once on startup. Usually used to establish initial (genesis) state.

Consensus Connection: Called at the start of processing a block of transactions The flow is: begin_block() deliver_tx() for each transaction in the block end_block() commit()

Consensus Connection: Actually processing the transaction, performing some form of a state transistion.

Consensus Connection: Called at the end of the block. Often used to update the validator set.

Consensus Connection: Commit the block with the latest state from the application.

Implementors§