Skip to main content

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.

  • passive strategy
  • auto funding strategy (auto_funding module, feature strategy-auto-funding)
  • auto redeeming strategy (auto_redeeming module, feature strategy-auto-redeeming)
  • closure finalizer (channel_finalizer module, feature strategy-closure-finalizer)
  • channel lifecycle strategy (feature strategy-channel-lifecycle)
  • multiple strategy chains

Individual strategies are gated behind Cargo features.

§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:
  allow_recursive: true
  execution_interval: 60
  strategies:
    - !AutoFunding
      funding_amount: 20

Modules§

errors
strategy
Multi Strategy