diff --git a/doc/CONFIGURATION.md b/doc/CONFIGURATION.md index 1e037153..15f34d4f 100644 --- a/doc/CONFIGURATION.md +++ b/doc/CONFIGURATION.md @@ -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 - }, + } } } }) diff --git a/src/circuit/index.js b/src/circuit/index.js index ae54ce18..dbb70e61 100644 --- a/src/circuit/index.js +++ b/src/circuit/index.js @@ -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 } diff --git a/src/config.js b/src/config.js index cc45dee5..2337e249 100644 --- a/src/config.js +++ b/src/config.js @@ -59,7 +59,7 @@ const DefaultConfig = { enabled: true, advertise: { bootDelay: RelayConstants.ADVERTISE_BOOT_DELAY, - enabled: true, + enabled: false, ttl: RelayConstants.ADVERTISE_TTL }, hop: { diff --git a/test/relay/auto-relay.node.js b/test/relay/auto-relay.node.js index 43f42a6a..8d0cdfd2 100644 --- a/test/relay/auto-relay.node.js +++ b/test/relay/auto-relay.node.js @@ -486,7 +486,8 @@ describe('auto-relay', () => { relay: { advertise: { bootDelay: 1000, - ttl: 1000 + ttl: 1000, + enabled: true }, hop: { enabled: index === 2