ipni / index-provider

📢 Index Provider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When no explicit provider addr is configured listen to local address changes and use the latest

masih opened this issue · comments

The provider engine allows a user to explicitly set provider addrs in 2 ways:

  1. as option to engine, and
  2. as argument passed to NotifyPut

When no such setting exists, it uses the given libp2p host addrs by caching the host addrs in options.
This means when the libp2p local addrs change, engine will not reflect the changes.

Instead, when no explicit provider addr is given the engine should listen to libp2p eventbus for local address changes and use the latest addrs in subsequent advertisements. Specifically, the event it should listen to is EvtLocalAddressesUpdated.