Class: AuthDB

net.AuthDB

new AuthDB()

AuthDB

Source:

Methods

_init(options)

Initialize authdb with options.

Parameters:
Name Type Description
options Object
Source:

addAuthorized(key)

Add an authorized peer.

Parameters:
Name Type Description
key Buffer

Identity Key

Source:

addKnown(host, key)

Add a known peer.

Parameters:
Name Type Description
host String

Peer Hostname

key Buffer

Identity Key

Source:

discover() → {Promise}

Lookup known peers.

Source:
Returns:
Type
Promise

getKnown(hostname) → {Buffer|null}

Get a known peer key by hostname.

Parameters:
Name Type Description
hostname String
Source:
Returns:
Type
Buffer | null

(private) populate(addr, key) → {Promise}

Populate known peers with hosts.

Parameters:
Name Type Description
addr Object
key Buffer
Source:
Returns:
Type
Promise

setAuthorized(keys)

Initialize authorized peers with a list of keys.

Parameters:
Name Type Description
keys Array:.<Buffer:>
Source:

setKnown(map)

Initialize known peers with a host->key map.

Parameters:
Name Type Description
map Object
Source: