Crate hopr_strategy

Crate hopr_strategy 

Source
Expand description

This crate contains all the Strategies for HOPRd. Strategies are vital for (partial) automation of ticket and HOPR channel operations during node runtime.

HOPRd can be configured to use any of the above strategies.

§Configuring strategies in HOPRd

There are two ways of configuring strategies in HOPRd: via CLI and via a YAML config file.

The configuration through CLI allows only fairly primitive single-strategy setting, through the defaultStrategy parameter. It can be set to any of the above strategies, however, the strategy parameters are not further configurable via the CLI and will always have their default values. In addition, if the disableTicketAutoRedeem CLI argument is false, the default Auto Redeem strategy is added to the strategy configured via the defaultStrategy argument (they execute together as Multi strategy).

For more complex strategy configurations, the YAML configuration method is recommended via the strategy YAML section. In this case, the top-most strategy is always assumed to be Multi strategy:

strategy:
  on_fail_continue: true
  allow_recursive: true
  execution_interval: 60
  strategies:
    - !AutoFunding
      funding_amount: 20

Modules§

auto_funding
Auto Funding Strategy
auto_redeeming
Auto Redeeming Strategy
channel_finalizer
errors
strategy
Multi Strategy

Enums§

Strategy
Lists all possible strategies with their respective configurations.

Functions§

hopr_default_strategies
Default HOPR node strategies (in order).
stream_events_to_strategy_with_tick
Streams ChainEvents, VerifiedTickets and tick at regular time intervals as events into the given strategy.

Type Aliases§

StrategyConfig
An alias for the strategy configuration type.