Skip to main content

hopr_transport_protocol/
lib.rs

1//! Collection of objects and functionality allowing building of p2p or stream protocols for the higher business logic
2//! layers.
3//!
4//! ## Contents
5//!
6//! Supported protocol configurations:
7//!
8//! - `mix`
9//! - `ack`
10//! - `heartbeat`
11
12/// Coder and decoder for the transport binary protocol layer
13mod codec;
14
15/// Per-peer protocol conformance counters.
16pub mod counters;
17
18/// Errors produced by the crate.
19pub mod errors;
20
21// protocols
22/// `heartbeat` p2p protocol
23pub mod heartbeat;
24
25/// Packet pipeline for the HOPR protocol.
26mod pipeline;
27/// Stream processing utilities
28pub mod stream;
29
30pub use counters::{PeerProtocolCounterRegistry, PeerProtocolCounters};
31use hopr_api::PeerId;
32pub use pipeline::{
33    AcknowledgementPipelineConfig, PacketPipelineConfig, PacketPipelineProcesses, TicketEvent, run_packet_pipeline,
34};
35
36const HOPR_PACKET_SIZE: usize = hopr_crypto_packet::prelude::HoprPacket::SIZE;
37
38pub type HoprBinaryCodec = codec::FixedLengthCodec<HOPR_PACKET_SIZE>;
39pub const CURRENT_HOPR_MSG_PROTOCOL: &str = "/hopr/mix/1.1.0";