Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 005f2ad

Browse files
jacobheunAlan Shaw
authored andcommitted
chore: update libp2p (#1956)
* chore: update libp2p version * test: add ipns test back * fix: make relay(no hop) and dht on by default * chore: update libp2p version * fix: clear multiaddrs on stop They will be reconstructed on startup * chore: revert unskip
1 parent dd38867 commit 005f2ad

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ Prevents all logging output from the IPFS node.
284284

285285
| Type | Default |
286286
|------|---------|
287-
| object | `{ enabled: false, hop: { enabled: false, active: false } }` |
287+
| object | `{ enabled: true, hop: { enabled: false, active: false } }` |
288288

289289
Configure circuit relay (see the [circuit relay tutorial](https://github.com/ipfs/js-ipfs/tree/master/examples/circuit-relaying) to learn more).
290290

291-
- `enabled` (boolean): Enable circuit relay dialer and listener. (Default: `false`)
291+
- `enabled` (boolean): Enable circuit relay dialer and listener. (Default: `true`)
292292
- `hop` (object)
293293
- `enabled` (boolean): Make this node a relay (other nodes can connect *through* it). (Default: `false`)
294294
- `active` (boolean): Make this an *active* relay node. Active relay nodes will attempt to dial a destination peer even if that peer is not yet connected to the relay. (Default: `false`)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"joi": "^14.3.0",
128128
"joi-browser": "^13.4.0",
129129
"joi-multiaddr": "^4.0.0",
130-
"libp2p": "~0.25.0-rc.3",
130+
"libp2p": "~0.25.0-rc.5",
131131
"libp2p-bootstrap": "~0.9.3",
132132
"libp2p-crypto": "~0.16.0",
133133
"libp2p-kad-dht": "~0.14.8",

src/core/components/libp2p.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ module.exports = function libp2p (self, config) {
2727
}
2828
}
2929

30+
libp2p.on('stop', () => {
31+
// Clear our addresses so we can start clean
32+
peerInfo.multiaddrs.clear()
33+
})
34+
3035
libp2p.on('start', () => {
3136
peerInfo.multiaddrs.forEach((ma) => {
3237
self._print('Swarm listening on', ma.toString())
@@ -70,7 +75,7 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
7075
},
7176
relay: {
7277
enabled: get(options, 'relay.enabled',
73-
get(config, 'relay.enabled', false)),
78+
get(config, 'relay.enabled', true)),
7479
hop: {
7580
enabled: get(options, 'relay.hop.enabled',
7681
get(config, 'relay.hop.enabled', false)),
@@ -80,7 +85,7 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
8085
},
8186
dht: {
8287
kBucketSize: get(options, 'dht.kBucketSize', 20),
83-
enabled: get(options, 'offline', false) ? false : undefined, // disable if offline
88+
enabled: !get(options, 'offline', false), // disable if offline, on by default
8489
randomWalk: {
8590
enabled: false // disabled waiting for https://github.com/libp2p/js-libp2p-kad-dht/issues/86
8691
},

0 commit comments

Comments
 (0)