Libp2p.PeerStore (libp2p_elixir v0.9.0)

Minimal peer store for tracking addresses + supported protocols.

This is intentionally small: enough to power Eth2 libp2p must-haves.

Summary

Types

peer_id()

@type peer_id() :: binary()

Functions

add_addr(server, peer_id, addr)

@spec add_addr(pid() | atom(), peer_id(), Libp2p.Multiaddr.t()) :: :ok

add_protocols(server, peer_id, protos)

@spec add_protocols(pid() | atom(), peer_id(), [binary()]) :: :ok

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(server, peer_id)

@spec get(pid() | atom(), peer_id()) :: Libp2p.PeerInfo.t() | nil

mark_seen(server, peer_id)

@spec mark_seen(pid() | atom(), peer_id()) :: :ok

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

upsert(server, info)

@spec upsert(pid() | atom(), Libp2p.PeerInfo.t()) :: :ok