|
| 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 | +
|
| 39 | +mod event; |
| 40 | +mod kind; |
| 41 | + |
| 42 | +pub mod params; |
| 43 | +pub mod request; |
| 44 | +pub mod response; |
| 45 | +pub mod types; |
| 46 | + |
| 47 | +pub use event::{Event, EventAttribute, EventAttributeIndexExt}; |
| 48 | + |
| 49 | +#[doc(inline)] |
| 50 | +pub use self::{ |
| 51 | + kind::MethodKind, |
| 52 | + request::{ConsensusRequest, InfoRequest, MempoolRequest, Request, SnapshotRequest}, |
| 53 | + response::{ConsensusResponse, InfoResponse, MempoolResponse, Response, SnapshotResponse}, |
| 54 | +}; |
0 commit comments