Skip to content

Discovery

Peer discovery via local network (nearby) and internet (DHT).

Nearby (local network)

Discover peers on the local network via UDP broadcast.

nearby.list (void): Identity[]

List nearby peers discovered on the local network. The nearby signal fires when the list changes.

nearby.announce (void): bool

Broadcast presence to the local network.

nearby.contactRequest (luid: Uid, ruid: Uid, rhid: Hid, meta?: Buffer): bool

Send a contact request to a nearby peer.

nearby.clear (void): bool

Clear the nearby peers list.

DHT (internet)

Distributed hash table for peer discovery across the internet. Peers announce their presence and search for others by signer ID.

dht.status (void): { state, goodNodes, ... }

Get DHT node status.

dht.announce (void): { success, announced }

Announce presence to the DHT.

dht.search (signerId: Buffer): { success }

Search the DHT for a signer's presence.

dht.bootstrap (host: string, port: int): { success }

Bootstrap DHT connection to a known node.

dht.mutable.list (void): { count, items }

List stored DHT mutable items.