mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 18:42:15 +00:00
chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
parent
29e30c2199
commit
2746b4b025
@ -449,9 +449,9 @@ const node = await Libp2p.create({
|
||||
relay: { // Circuit Relay options (this config is part of libp2p core configurations)
|
||||
enabled: true, // Allows you to dial and accept relayed connections. Does not make you a relay.
|
||||
autoRelay: {
|
||||
enabled: false, // Allows you to bind to relays with HOP enabled for improving node dialability
|
||||
enabled: true, // Allows you to bind to relays with HOP enabled for improving node dialability
|
||||
maxListeners: 2 // Configure maximum number of HOP relays to use
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -68,12 +68,12 @@ class Relay {
|
||||
await this._libp2p.contentRouting.provide(cid)
|
||||
} catch (err) {
|
||||
if (err.code === 'NO_ROUTERS_AVAILABLE') {
|
||||
log('there are no routers configured to advertise hop relay service')
|
||||
log.error('a content router, such as a DHT, must be provided in order to advertise the relay service', err)
|
||||
// Stop the advertise
|
||||
this.stop()
|
||||
} else {
|
||||
log.error(err)
|
||||
}
|
||||
// Stop the advertise
|
||||
this.stop()
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ const DefaultConfig = {
|
||||
enabled: true,
|
||||
advertise: {
|
||||
bootDelay: RelayConstants.ADVERTISE_BOOT_DELAY,
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
ttl: RelayConstants.ADVERTISE_TTL
|
||||
},
|
||||
hop: {
|
||||
|
@ -486,7 +486,8 @@ describe('auto-relay', () => {
|
||||
relay: {
|
||||
advertise: {
|
||||
bootDelay: 1000,
|
||||
ttl: 1000
|
||||
ttl: 1000,
|
||||
enabled: true
|
||||
},
|
||||
hop: {
|
||||
enabled: index === 2
|
||||
|
Loading…
x
Reference in New Issue
Block a user