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

Commit cc478da

Browse files
committed
chore: enable dht by default
1 parent 9643cac commit cc478da

File tree

13 files changed

+22
-21
lines changed

13 files changed

+22
-21
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ You can check the development status at the [Kanban Board](https://waffle.io/ipf
3434

3535
[![Throughput Graph](https://graphs.waffle.io/ipfs/js-ipfs/throughput.svg)](https://waffle.io/ipfs/js-ipfs/metrics/throughput)
3636

37-
**Please read this:** DHT (automatic content discovery) and Circuit Relay (pierce through NATs and dial between any node in the network) are two fundamental pieces that are not finalized yet. There are multiple applications that can be built without these two services but nevertheless they are fundamental to get that magic IPFS experience. If you want to track progress or contribute, please follow:
37+
**Please read this:** Circuit Relay (pierce through NATs and dial between any node in the network) is a fundamental piece that is not finalized yet. There are multiple applications that can be built without this service but nevertheless it is fundamental to get that magic IPFS experience. If you want to track progress or contribute, please follow:
3838

39-
- DHT: https://github.com/ipfs/js-ipfs/pull/856
4039
- ✅ Relay: https://github.com/ipfs/js-ipfs/pull/1063
4140

4241
[**`Weekly Core Dev Calls`**](https://github.com/ipfs/pm/issues/650)
@@ -319,7 +318,6 @@ Enable and configure experimental features.
319318
- `pubsub` (boolean): Enable libp2p pub-sub. (Default: `false`)
320319
- `ipnsPubsub` (boolean): Enable pub-sub on IPNS. (Default: `false`)
321320
- `sharding` (boolean): Enable directory sharding. Directories that have many child objects will be represented by multiple DAG nodes instead of just one. It can improve lookup performance when a directory has several thousand files or more. (Default: `false`)
322-
- `dht` (boolean): Enable KadDHT.
323321
324322
##### `options.config`
325323

src/core/components/libp2p.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
8686
}
8787
},
8888
EXPERIMENTAL: {
89-
dht: get(opts.options, 'EXPERIMENTAL.dht', false),
89+
dht: true,
9090
pubsub: get(opts.options, 'EXPERIMENTAL.pubsub', false)
9191
}
9292
},

src/core/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ class IPFS extends EventEmitter {
177177
if (this._options.EXPERIMENTAL.sharding) {
178178
this.log('EXPERIMENTAL sharding is enabled')
179179
}
180-
if (this._options.EXPERIMENTAL.dht) {
181-
this.log('EXPERIMENTAL Kademlia DHT is enabled')
182-
}
183180

184181
this.state = require('./state')(this)
185182

src/core/runtime/libp2p-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Node extends libp2p {
5858
enabledDiscovery: true
5959
},
6060
EXPERIMENTAL: {
61-
dht: false,
61+
dht: true,
6262
pubsub: false
6363
}
6464
}

src/core/runtime/libp2p-nodejs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Node extends libp2p {
5757
enabledDiscovery: true
5858
},
5959
EXPERIMENTAL: {
60-
dht: false,
60+
dht: true,
6161
pubsub: false
6262
}
6363
}

src/http/api/resources/dht.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ exports.findPeer = {
2727
}).code(500)
2828
}
2929

30-
return reply(res).code(200)
30+
return reply({
31+
Responses: [{
32+
ID: res.responses[0].id,
33+
Addrs: res.responses[0].addrs
34+
}],
35+
Type: res.type
36+
}).code(200)
3137
})
3238
}
3339
}
@@ -52,7 +58,13 @@ exports.findProvs = {
5258
}).code(500)
5359
}
5460

55-
return reply(res).code(200)
61+
return reply({
62+
Responses: res.responses.map((r) => ({
63+
ID: r.id,
64+
Addrs: r.addrs
65+
})),
66+
Type: res.type
67+
}).code(200)
5668
})
5769
}
5870
}

src/http/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ function HttpApi (repo, config, cliArgs) {
8686
EXPERIMENTAL: {
8787
pubsub: cliArgs.enablePubsubExperiment,
8888
ipnsPubsub: cliArgs.enableNamesysPubsub,
89-
dht: cliArgs.enableDhtExperiment,
9089
sharding: cliArgs.enableShardingExperiment
9190
},
9291
libp2p: libp2p

test/cli/dht.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const daemonOpts = {
2020
config: {
2121
Bootstrap: []
2222
},
23-
args: ['--enable-dht-experiment'],
2423
initOptions: { bits: 512 }
2524
}
2625

test/core/interface.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe('interface-ipfs-core tests', () => {
4747
}
4848
}
4949
},
50-
args: ['--enable-dht-experiment'],
5150
initOptions: { bits: 512 }
5251
}
5352
}), {

test/core/kad-dht.node.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ function createNode (callback) {
2828
f.spawn({
2929
exec: './src/cli/bin.js',
3030
config,
31-
initOptions: { bits: 512 },
32-
args: ['--enable-dht-experiment']
31+
initOptions: { bits: 512 }
3332
}, callback)
3433
}
3534

0 commit comments

Comments
 (0)