mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-28 16:31:35 +00:00
feat: add check for protector and enforced pnet
fix: update protector config and tests docs: add private network info to the readme test: fix an issue with config
This commit is contained in:
@ -75,6 +75,13 @@ class Node extends EventEmitter {
|
||||
})
|
||||
}
|
||||
|
||||
// Attach private network protector
|
||||
if (this._modules.connProtector) {
|
||||
this._switch.protector = this._modules.connProtector
|
||||
} else if (process.env.LIBP2P_FORCE_PNET) {
|
||||
throw new Error('Private network is enforced, but no protector was provided')
|
||||
}
|
||||
|
||||
// dht provided components (peerRouting, contentRouting, dht)
|
||||
if (this._config.EXPERIMENTAL.dht) {
|
||||
const DHT = this._modules.dht
|
||||
|
Reference in New Issue
Block a user