Module node
Expand description
High-level HOPR node API traits. High-level HOPR node API trait definitions.
This module defines the external public API interface for interacting with a running HOPR node.
§Architecture
The API is structured around accessor traits (Has*) that provide typed references
to individual components, and composed traits that are blanket-implemented over
combinations of accessors:
HasChainApi— chain interactionHasNetworkView— network connectivity (read-onlyNetworkView)HasGraphView— network graph (read-only) with component health statusHasTransportApi— transport operations (ping, observed multiaddresses)HasTicketManagement— ticket processing
Composed traits:
IncentiveChannelOperations— channels, balances, withdrawals, chain infoIncentiveRedeemOperations— ticket redemption and statistics (relay nodes only)
Modules§
- session
- Session APIs for outgoing/incoming HOPR sessions. Session traits for HOPR node interactions.
Structs§
- Announced
Peer - A peer that has been announced and discovered by the node.
- Atomic
Hopr State - A wrapper around
HoprStatewhich can be safely shared between threads. - Chain
Info - Contains information about the HOPR on-chain network deployment.
- Chain
Output - Represents an output of a write operation to the chain performed by the node.
- Hopr
State Iter - An iterator over the variants of HoprState
- Node
Onchain Identity - Identity of a node on-chain.
Enums§
- Announcement
Origin - Origin of a peer announcement — how the node learned about this peer.
- Component
Status - Health status of an individual component within the HOPR node.
- Either
Err - Allows combining two errors
LandRinto a single error type that acts transparently. - Hopr
State - An enum representing the current state of the HOPR node.
- Ticket
Event - Ticket events emitted from the packet processing pipeline.
Traits§
- Component
Status Reporter - Trait for components that can report their own health status.
- Either
ErrExt - Extension trait for converting an error into an
EitherErr. - HasChain
Api - Provides access to the chain component of a HOPR node.
- HasGraph
View - Provides read-only access to the network graph and its health status.
- HasNetwork
View - Provides read-only access to the network layer (peer connectivity, addresses).
- HasTicket
Management - Provides access to the ticket management component.
- HasTransport
Api - Provides access to transport-level operations (ping, peer observations).
- Hopr
Node Operations - General operations performed by a HOPR node.
- Hopr
Session Client Operations - Trait for establishing HOPR sessions to remote destinations.
- Hopr
Session Server - Trait for processing incoming HOPR sessions on exit nodes.
- Incentive
Channel Operations - Channel management, balance queries, withdrawals, and chain info.
- Incentive
Redeem Operations - Ticket redemption and statistics.
- Transport
Operations - Minimal transport operations that require the full transport stack.
Type Aliases§
- Chain
Event Resolver - Future that resolves when a
ChainEventis resolved, times out, or is aborted via the associated abort handle. - Channel
Id - Alias for the
Hashrepresenting a channel ID. - Compound
Result - Simple alias
Result<T, EitherErr<E1, E2>>. - Event
Wait Result - Alias for the result of
HasChainApi::wait_for_on_chain_event.