Skip to main content

Crate hopr_ticket_manager

Crate hopr_ticket_manager 

Source
Expand description

Implements complete logic of ticket management in the HOPR protocol.

There are two major parts in the architecture of the ticket management:

  • HoprTicketManager is responsible for managing the incoming ticket queues and ticket redemption.
  • HoprTicketFactory is responsible for managing outgoing ticket indices and creating outgoing tickets.

Usually, they are created together via HoprTicketManager::new_with_factory.

See the HoprTicketManager and HoprTicketFactory documentation for complete details.

ModulesΒ§

backend πŸ”’
chain_sync πŸ”’
errors πŸ”’
factory πŸ”’
manager πŸ”’
traits πŸ”’
utils πŸ”’

StructsΒ§

HoprTicketFactory
Keeps track of outgoing ticket indices and provides an interface for creating multihop tickets.
HoprTicketManager
Keeps track of incoming redeemable tickets and provides ticket redemption and neglection operations.
MemoryStore
Simple non-persistent ticket queue store backed by a HashMap and MemoryTicketQueue.
MemoryTicketQueue
Simple in-memory ticket queue implementation using a binary heap.
RedbStore
Implementation of OutgoingIndexStore and TicketQueueStore using redb database and postcard serializer.
RedbTicketQueue
Implementation of TicketQueue using redb database and postcard serializer, associated with the RedbStore.

EnumsΒ§

TicketManagerError
Errors that can occur in the HoprTicketManager.

TraitsΒ§

OutgoingIndexStore
Allows loading and saving outgoing ticket indices.
TicketQueue
Backend for the incoming ticket storage (double-ended) queue.
TicketQueueStore
Allows loading ticket queues from a storage.

FunctionsΒ§

ticket_factory_from_chain
Creates a HoprTicketFactory backed by a temporary RedbStore and pre-seeds it from the node’s current outgoing channels.
ticket_manager_from_chain
Creates a HoprTicketManager and its companion HoprTicketFactory, both backed by a temporary RedbStore, and pre-seeds them from the node’s current channel state.