Skip to main content
Version: v5.0.0

Node Strategies

Node strategies offer advanced users detailed control over their node's behavior and HOPR protocol interactions. Configure settings like ticket redemption thresholds and automatic channel management to optimize performance. To modify or manage these strategies, implement the configuration file as described in the node configuration guide.

Fund your channels for Cover Traffic​

The strategy in the hosted configuration files gets your node onto the network: it opens and funds payment channels so your node can relay traffic. To be eligible for Cover Traffic, your node also needs at least 5 open outgoing channels with at least 100 wxHOPR each. The default funding values don't keep that much in your channels, so change the funding settings of ChannelLifecycle in your configuration file:

strategy:
allow_recursive: false
strategies:
- AutoRedeeming:
redeem_on_winning: true
- ChannelLifecycle:
population:
min_open_channels: 5
target_open_channels: 20
peer_reopen_cooldown: 30m
funding:
sizing_mode:
probabilistic:
success_probability: 0.99
initial_capacity: "8964 MiB" # 150 wxHOPR
lower_capacity_threshold: "6148 MiB" # 112.5 wxHOPR
topup_capacity: "1225 MiB" # 37.5 wxHOPR
finalizer:
finalize_max_concurrent: 5
concurrency:
max_concurrent_actions: 5
caution

Copy sizing_mode too. If a funding section leaves it out, the node uses deterministic, and the same capacities fund only about 90 wxHOPR per channel, which isn't enough for Cover Traffic.

With these values:

  • Your node opens each new channel with 150 wxHOPR.
  • When a channel's balance drops to 112.5 wxHOPR or less, your node tops it up with 37.5 wxHOPR, back to 150 wxHOPR. This keeps your channels above 100 wxHOPR while your node relays traffic.

Your node takes this wxHOPR from your Safe:

  • Keep at least 750 wxHOPR in your Safe for the 5 channels (5 × 150 wxHOPR), plus extra for top-ups.
  • Your node also uses any wxHOPR left in your Safe to open more channels, up to target_open_channels (20 in the hosted configuration files, which needs 3,000 wxHOPR). If these extra channels use up your Safe, your node can't top up your first 5 channels. If you keep less wxHOPR in your Safe, lower target_open_channels, for example to 5.
note

Channel funding is set as data capacity, not as wxHOPR. Your node converts it using the current ticket price and winning probability, and always funds whole winning tickets. The wxHOPR amounts in the comments apply to the current network values. After your node opens its channels, check their balances with GET …/channels, as described in How can I verify if Cover Traffic is being relayed through my node(s)?

After you change the configuration file, restart your node as described in Managing Node Service.


Understanding node strategies​

Node strategies are set in the strategy section of the configuration file.

strategy​

In this section, you can configure various strategies for your node, enabling you to optimize its performance and behavior to meet your specific requirements. Each strategy is a list item whose name is followed by a colon, with its settings indented below it:

strategy:
allow_recursive: false
execution_interval: 60s
strategies:
- AutoRedeeming:
redeem_all_on_close: true
minimum_redeem_ticket_value: "1 wxHOPR"
redeem_on_winning: true
- ChannelLifecycle:
population:
min_open_channels: 5
target_open_channels: 8
funding:
sizing_mode:
probabilistic:
success_probability: 0.99
initial_capacity: "1 GiB"
topup_capacity: "512 MiB"
lower_capacity_threshold: "512 MiB"

Every setting has a default, so you only need to list the settings you want to change. To use a strategy with all its defaults, write - ChannelLifecycle: {}. Unknown settings are rejected and stop the node from starting.

If you leave the whole strategy section out of your configuration file, the node uses AutoRedeeming (with redeem_on_winning: true) and ChannelLifecycle (with success_probability: 0.99). If you add a strategy section, only the strategies you list are active.

SettingsDefault valueDescription
strategy.allow_recursivetrueAllows nesting strategies through Multi. Nesting is limited to one level.
strategy.execution_interval60sHow often the strategies run their periodic checks. The minimum is 10s. ChannelLifecycle uses its own tick_interval instead.
strategy.strategiesThe list of strategies to run. If the list is empty, the node behaves as Passive.

strategy.strategies: AutoRedeeming​

Automatically redeems winning tickets.

SettingsDefault valueDescription
redeem_all_on_closetrueRedeem all tickets in a channel (above minimum_redeem_ticket_value) when the channel starts closing.
minimum_redeem_ticket_value1 wxHOPRThe strategy only redeems a winning ticket if it's worth at least this amount. If set to 0, tickets are redeemed regardless of their value.
redeem_on_winningfalseRedeem each winning ticket as soon as it arrives. Otherwise, tickets are redeemed periodically. Set it to true when winning tickets are rare (winning probability below 1%).

strategy.strategies: ChannelLifecycle​

Automatically opens, funds, tops up, closes and finalizes your outgoing payment channels based on peer connectivity and quality. Channel stakes are set as data capacity (for example "1 GiB") and converted to wxHOPR by the node.

SettingsDefault valueDescription
tick_interval60sTime between full evaluation passes.
jitter5sMaximum random offset added to tick_interval.
population.min_open_channels5Minimum number of open outgoing channels. Closures are paused when the count would drop below this.
population.target_open_channels8Target number of open outgoing channels. New channels are opened until this target is reached.
population.peer_reopen_cooldown15mHow long a peer is ineligible for a new channel after its previous channel closed.
eligibility.require_currently_connectedtrueOnly open channels to peers that are currently connected.
eligibility.min_peer_quality_score0.5Minimum peer quality score (0 to 1) for opening a channel.
eligibility.peer_quality_weight0.6Weight of the peer quality score in the combined peer score.
eligibility.ticket_activity_weight0.4Weight of ticket activity in the combined peer score.
eligibility.require_observed_since_starttrueOnly close a channel if the peer has been observed since the node started. Prevents closing channels right after a restart.
eligibility.allowlist~ (none)If set, only open channels to these node addresses.
eligibility.blocklist[]Never open channels to these node addresses.
eligibility.demote_non_forwarding_peerstruePrefer peers that fund their own outgoing channels, so they can relay traffic further.
eligibility.minimum_peer_outgoing_channels1Funded outgoing channels a peer needs to count as able to relay.
funding.initial_capacity1 GiBData volume a new channel's stake should be able to carry.
funding.topup_capacity1 GiBData volume added when a channel is topped up.
funding.lower_capacity_threshold256 MiBRemaining capacity below which a channel is topped up.
funding.sizing_modedeterministicHow capacity is converted to a wxHOPR stake. If you leave the whole strategy section out, the node uses probabilistic with success_probability: 0.99 instead. deterministic funds the expected usage. probabilistic with success_probability (between 0.5 and 1, default 0.999) adds a safety buffer so the channel rarely runs out before a top-up.
proactive_funding.enabledtrueTop up channels early based on how fast they are being used.
proactive_funding.safety_margin1.5Multiplier applied to the projected usage when deciding to top up.
proactive_funding.balance_drain_weight1.0Weight of balance decreases in the usage estimate.
proactive_funding.ticket_index_drain_weight1.0Weight of ticket activity in the usage estimate.
closure.close_when_peer_unseen_for24hClose a channel after the peer has been absent for this long.
closure.close_below_quality_score0.3Close channels to peers whose quality score dropped below this.
closure.close_when_drained_below0 wxHOPRClose channels whose balance dropped below this amount.
closure.close_max_concurrent2Maximum number of closures started per pass.
closure.close_after_disconnected_ticks3Passes in a row a peer must be disconnected before its channel is closed.
finalizer.enabledtrueFinalize channel closures automatically once the closure period has passed.
finalizer.max_closure_overdue15mExtra time to wait after the closure period before finalizing.
finalizer.finalize_max_concurrent4Maximum number of finalizations started per pass.
restart.startup_observation_period1mNo channel is closed for this long after the node starts.
restart.startup_close_grace_period5mChannels to connected peers are protected from closure for this long after the node starts.
concurrency.max_concurrent_actions4Maximum number of channel transactions (open, fund, close, finalize) in progress at once.
selectordefaultHow peers are chosen for opening and closing: default, low_latency, balanced, dispersed or economical.

strategy.strategies: AutoFunding​

Automatically funds channels with a specified amount if the stake on any channel falls below the defined threshold. ChannelLifecycle already tops up channels, so you don't need this strategy when you use it.

SettingsDefault valueDescription
funding_amount10 wxHOPRThe amount to fund a channel with when its stake drops below the threshold. Must be greater than zero.
min_stake_threshold1 wxHOPRThe stake below which a channel is funded.

strategy.strategies: ClosureFinalizer​

Finalizes channels in the PendingToClose state once their closure period has elapsed. ChannelLifecycle already does this through its finalizer settings.

SettingsDefault valueDescription
max_closure_overdue300sChannels that have been overdue for longer than this are not finalized. Write the value with a unit, for example 300s.

strategy.strategies: Multi​

Groups several strategies. It takes the same settings as the strategy section: allow_recursive, execution_interval and strategies.

strategy.strategies: Passive​

A strategy that does nothing. This is equivalent to leaving the strategies list empty. Write it as - Passive.