Skip to content

Commit

Permalink
add IPFS integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorrent committed Dec 15, 2023
1 parent 2c83356 commit d57715f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lightning_hivemind/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class HivemindStrategy(Strategy):
initial_peers: If connecting to a running process, a list of initial peers needs to be passed in.
This can also be set via the env variable ``INITIAL_PEERS``.
use_ipfs: Use IPFS to find initial_peers. If enabled, you only need to provide /p2p/XXXX part of the
multiaddrs for the initial_peers (no need to specify a particular IPv4/IPv6 host and port)"
**optimizer_kwargs: kwargs are passed to the :class:`hivemind.Optimizer` class.
"""

Expand All @@ -128,6 +131,7 @@ def __init__(
averager_opts: Optional[Dict] = None,
host_maddrs: Optional[List] = None,
initial_peers: Optional[Union[str, List]] = None,
use_ipfs: bool = False,
**optimizer_kwargs: Any,
):
if platform.system() != "Linux":
Expand Down Expand Up @@ -165,6 +169,8 @@ def __init__(
start=True,
initial_peers=initial_peers,
host_maddrs=host_maddrs if host_maddrs is not None else ["/ip4/0.0.0.0/tcp/0", "/ip4/0.0.0.0/udp/0/quic"],
use_ipfs=use_ipfs,
ensure_bootstrap_success=True if not use_ipfs else False,
)

visible_addresses = [
Expand Down

0 comments on commit d57715f

Please sign in to comment.