Crate hopr_transport

Source
Expand description

The crate aggregates and composes individual transport level objects and functionality into a unified crate::HoprTransport object with the goal of isolating the transport layer and defining a fully specified transport API.

It also implements the Session negotiation via Start sub-protocol. See the hopr_transport_session::initiation module for details on Start sub-protocol.

As such, the transport layer components should be only those that are directly necessary to:

  1. send and receive a packet, acknowledgement or ticket aggregation request
  2. send and receive a network telemetry request
  3. automate transport level processes
  4. algorithms associated with the transport layer operational management
  5. interface specifications to allow modular behavioral extensions

Re-exports§

pub use crate::config::HoprTransportConfig;
pub use crate::helpers::PeerEligibility;
pub use crate::helpers::TicketStatistics;

Modules§

config
Configuration of the crate::HoprTransport.
constants
Constants used and exposed by the crate.
errors
Errors used by the crate.
helpers
network_notifier
proxy
Objects used and possibly exported by the crate for re-use for transport functionality

Structs§

ApplicationData
Represents the received decrypted packet carrying the application-layer data.
ChainKeypair
Represents a keypair consisting of a secp256k1 private and public key
HalfKeyChallenge
Represents a challenge for the half-key in Proof of Relay. Half-key challenge is equivalent to a secp256k1 curve point. Therefore, HalfKeyChallenge can be obtained from a HalfKey.
Hash
Represents an Ethereum 256-bit hash value This implementation instantiates the hash via Keccak256 digest.
HoprTransport
Interface into the physical transport mechanism allowing all off-chain HOPR-related tasks on the transport, as well as off-chain ticket manipulation.
IncomingSession
Wrapper for incoming Session along with other information extracted from the Start protocol during the session establishment.
Multiaddr
Representation of a Multiaddr.
Network
The network object storing information about the running observed state of the network, including peers, connection qualities and updates for other parts of the system.
OffchainKeypair
Represents a keypair consisting of an Ed25519 private and public key
OffchainPublicKey
Represents an Ed25519 public key.
PeerId
Identifier of a peer of the network.
PeerStatus
Status of the peer as recorded by a network component.
Session
SessionClientConfig
Configuration for the session.
SessionId
Unique ID of a specific session.
TicketAggregatorProxy

Enums§

Health
Network health represented with colors, where green is the best and red is the worst possible observed nework quality.
HoprTransportProcess
NetworkTriggeredEvent
Events generated by the Network object allowing it to physically interact with external systems, including the transport mechanism.
PeerDiscovery
Processed indexer generated events.
PeerOrigin
Actual origin.
RoutingOptions
Represents routing options in a mixnet with a maximum number of hops.
SessionCapability
Capabilities of a session.
SessionTarget
Defines what should happen with the data at the recipient where the data from the established session are supposed to be forwarded to some target.
TransportSessionError
Enumeration of errors thrown from this library.

Constants§

SESSION_USABLE_MTU_SIZE
Inner MTU size of what the HOPR payload can take (payload - peer_id - application_tag)

Traits§

Keypair
Represents a generic key pair The keypair contains a private key and public key. Must be comparable in constant time and zeroized on drop.
SendMsg

Functions§

execute_on_tick
Construct an infinitely running background loop producing ticks with a given period with the maximum tick duration at most the period.
transfer_session
Convenience function to copy data in both directions between a Session and arbitrary async IO stream. This function is only available with Tokio and will panic with other runtimes.

Type Aliases§

ServiceId
Describes a node service target. These are specialized SessionTargets that are local to the Exit node and have different purposes, such as Cover Traffic.