pub trait Info: Send + Sync {
// Required method
fn info<'life0, 'async_trait>(
&'life0 self,
info_request: RequestInfo,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn echo<'life0, 'async_trait>(
&'life0 self,
echo_request: RequestEcho,
) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn set_option<'life0, 'async_trait>(
&'life0 self,
_set_option_request: RequestSetOption,
) -> Pin<Box<dyn Future<Output = ResponseSetOption> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn query<'life0, 'async_trait>(
&'life0 self,
_query_request: RequestQuery,
) -> Pin<Box<dyn Future<Output = ResponseQuery> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn flush<'life0, 'async_trait>(
&'life0 self,
_flush_request: RequestFlush,
) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Available on crate feature
async-api
only.Expand description
Trait for initialization and for queries from the user.
Required Methods§
Sourcefn info<'life0, 'async_trait>(
&'life0 self,
info_request: RequestInfo,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn info<'life0, 'async_trait>(
&'life0 self,
info_request: RequestInfo,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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>
§Equivalent to
ⓘ
async fn info(&self, info_request: RequestInfo) -> ResponseInfo