Trait Info

Source
pub trait Info {
    // Required method
    fn info(&self, info_request: RequestInfo) -> ResponseInfo;

    // Provided methods
    fn echo(&self, echo_request: RequestEcho) -> ResponseEcho { ... }
    fn set_option(
        &self,
        _set_option_request: RequestSetOption,
    ) -> ResponseSetOption { ... }
    fn query(&self, _query_request: RequestQuery) -> ResponseQuery { ... }
    fn flush(&self, _flush_request: RequestFlush) -> ResponseFlush { ... }
}
Available on crate feature sync-api only.
Expand description

Trait for initialization and for queries from the user.

Required Methods§

Source

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

Return information about the application state.

§Crash Recovery

On startup, Tendermint calls the info method to get the latest committed state of the app. The app MUST return information consistent with the last block it successfully completed commit for.

If the app succesfully committed block H but not H+1, then

  • last_block_height = H
  • last_block_app_hash = <hash returned by Commit for block H>

If the app failed during the commit of block H, then

  • last_block_height = H-1
  • last_block_app_hash = <hash returned by Commit for block H-1, which is the hash in the header of block H>

Provided Methods§

Source

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

Echo a string to test abci client/server implementation.

Source

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

Set non-consensus critical application specific options.

Source

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

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

Source

fn flush(&self, _flush_request: RequestFlush) -> ResponseFlush

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

Implementors§