Addresses for transport listening and to advertise to the network
Optional
connectionA connection gater can deny new connections based on user criteria
libp2p Connection Manager configuration
Optional
contentAn optional datastore to persist peer information, DHT records, etc.
An in-memory datastore will be used if one is not provided.
Optional
dnsAn optional DNS resolver configuration. If omitted the default DNS resolver
for the platform will be used which means node:dns
on Node.js and
DNS-JSON-over-HTTPS for browsers using Google and Cloudflare servers.
Optional
loggerAn optional logging implementation that can be used to write runtime logs.
Set the DEBUG
env var or the debug
key on LocalStorage to see logs.
Node.js:
$ DEBUG="*libp2p:*" node myscript.js
Browsers:
localStorage.setItem('debug', '*libp2p:*')
Metadata about the node - implementation name, version number, etc
Optional
peerpeerId instance (it will be created if not provided)
Optional
peerlibp2p PeerStore configuration
Private key associated with the peerId
Arbitrary libp2p modules
Optional
streamlibp2p transport manager configuration
Optional
transportsAn array that must include at least 1 compliant transport
Optional
connectionA ConnectionProtector can be used to create a secure overlay on top of the network using pre-shared keys
Optional
metricsA Metrics implementation can be supplied to collect metrics on this node
For Libp2p configurations and modules details read the Configuration Document.