Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DHTConfig ¶
type DHTConfig struct { BootNodes []string DataStoreFile *string // File path to store DHT data. Shall be only used for bootstrap nodes. }
DHTConfig is the configurable DHT options. For normal nodes, only BootNodes field need to be specified.
type Discovery ¶
type Discovery interface { Start() error Close() error Advertise(ctx context.Context, ns string) (time.Duration, error) FindPeers(ctx context.Context, ns string, peerLimit int) (<-chan libp2p_peer.AddrInfo, error) GetRawDiscovery() discovery.Discovery }
Discovery is the interface for the underlying peer discovery protocol. The interface is implemented by dhtDiscovery
func NewDHTDiscovery ¶
func NewDHTDiscovery(host libp2p_host.Host, opt DHTConfig) (Discovery, error)
NewDHTDiscovery creates a new dhtDiscovery that implements Discovery interface.
Click to show internal directories.
Click to hide internal directories.