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/// Errors produced by the crate.
16pub mod errors;
17
18// protocols
19/// `heartbeat` p2p protocol
20pub mod heartbeat;
21
22/// Packet pipeline for the HOPR protocol.
23mod pipeline;
24/// Stream processing utilities
25pub mod stream;
26
27use hopr_transport_identity::{Multiaddr, PeerId};
28pub use pipeline::{AcknowledgementPipelineConfig, PacketPipelineProcesses, TicketEvent, run_packet_pipeline};
29
30const HOPR_PACKET_SIZE: usize = hopr_crypto_packet::prelude::HoprPacket::SIZE;
31
32pub type HoprBinaryCodec = codec::FixedLengthCodec<HOPR_PACKET_SIZE>;
33pub const CURRENT_HOPR_MSG_PROTOCOL: &str = "/hopr/mix/1.0.0";
34
35/// Processed indexer generated events.
36#[derive(Debug, Clone)]
37pub enum PeerDiscovery {
38    Announce(PeerId, Vec<Multiaddr>),
39}