[][src]Trait abci::Application

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 { ... } }

Main Trait for an 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

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

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.

fn set_option(&mut self, _req: &RequestSetOption) -> ResponseSetOption

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

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

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

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

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.

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

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

fn begin_block(&mut self, _req: &RequestBeginBlock) -> ResponseBeginBlock

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()

fn deliver_tx(&mut self, _p: &RequestDeliverTx) -> ResponseDeliverTx

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

fn end_block(&mut self, _req: &RequestEndBlock) -> ResponseEndBlock

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

fn commit(&mut self, _req: &RequestCommit) -> ResponseCommit

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

Loading content...

Implementors

Loading content...