tendermint/abci.rs
1//! Application BlockChain Interface ([ABCI]) is the interface between Tendermint
2//! (a consensus engine for Byzantine-fault-tolerant replication of a state
3//! machine) and an application (the state machine to be replicated).
4//!
5//! Using ABCI involves writing an application driven by ABCI methods, exposing
6//! that application as an ABCI server, and having Tendermint connect to the
7//! server as an ABCI client.
8//!
9//! This module does not include an ABCI server implementation itself. Instead,
10//! it provides a common set of Rust domain types that model the ABCI protocol,
11//! which can be used by both ABCI applications and ABCI server implementations.
12//!
13//! One ABCI server implementation is provided by the [`tendermint_abci`][tmabci]
14//! crate.
15//!
16//! Each ABCI method corresponds to a request/response pair. ABCI requests are
17//! modeled by the [`Request`] enum, and responses are modeled by the
18//! [`Response`] enum. As described in the [methods and types][mat] page, ABCI
19//! methods are split into four categories. Tendermint opens one ABCI connection
20//! for each category of messages. These categories are modeled by the
21//! [`MethodKind`] enum and by per-category request and response enums:
22//!
23//! * [`ConsensusRequest`] / [`ConsensusResponse`] for [`MethodKind::Consensus`] methods;
24//! * [`MempoolRequest`] / [`MempoolResponse`] for [`MethodKind::Mempool`] methods;
25//! * [`InfoRequest`] / [`InfoResponse`] for [`MethodKind::Info`] methods;
26//! * [`SnapshotRequest`] / [`SnapshotResponse`] for [`MethodKind::Snapshot`] methods.
27//!
28//! The domain types in this module have conversions to and from the Protobuf
29//! types defined in the [`tendermint_proto`] crate. These conversions are
30//! required for ABCI server implementations, which use the protobufs to
31//! communicate with Tendermint, but should not be required for ABCI
32//! applications, which should use the domain types in an interface defined by
33//! their choice of ABCI server implementation.
34//!
35//! [ABCI]: https://docs.tendermint.com/master/spec/abci/
36//! [mat]: https://docs.tendermint.com/master/spec/abci/abci.html
37//! [tmabci]: https://github.com/informalsystems/tendermint-rs/tree/master/abci
38
39mod code;
40mod event;
41mod kind;
42
43pub mod request;
44pub mod response;
45pub mod types;
46
47pub use crate::v0_38::abci::request::Request;
48pub use crate::v0_38::abci::request::{
49 ConsensusRequest, InfoRequest, MempoolRequest, SnapshotRequest,
50};
51pub use crate::v0_38::abci::response::Response;
52pub use crate::v0_38::abci::response::{
53 ConsensusResponse, InfoResponse, MempoolResponse, SnapshotResponse,
54};
55
56pub use event::v0_34;
57pub use event::v0_37;
58pub use event::{Event, EventAttribute, EventAttributeIndexExt, TypedEvent};
59
60#[doc(inline)]
61pub use self::{code::Code, kind::MethodKind};