Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
feat: add KadDHT
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Apr 4, 2017
1 parent b43b7a6 commit e67283f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"dependencies": {
"libp2p": "~0.8.0",
"libp2p-kad-dht": "0.0.1",
"libp2p-mdns": "~0.7.0",
"libp2p-multiplex": "~0.4.3",
"libp2p-railing": "~0.5.0",
Expand Down Expand Up @@ -73,4 +74,4 @@
"kumavis <kumavis@users.noreply.github.com>",
"varunagarwal315 <varunagarwal315@gmail.com>"
]
}
}
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const MulticastDNS = require('libp2p-mdns')
const WS = require('libp2p-websockets')
const Railing = require('libp2p-railing')
const spdy = require('libp2p-spdy')
const KadDHT = require('libp2p-kad-dht')
const multiplex = require('libp2p-multiplex')
const secio = require('libp2p-secio')
const libp2p = require('libp2p')
Expand Down Expand Up @@ -49,11 +50,10 @@ class Node extends libp2p {
],
connection: {
muxer: getMuxers(options.muxer),
crypto: [
secio
]
crypto: [ secio ]
},
discovery: []
discovery: [],
dht: KadDHT
}

if (options.webRTCStar) {
Expand Down
11 changes: 11 additions & 0 deletions test/contentRouting.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
chai.use(require('dirty-chai'))
const expect = chai.expect
const parallel = require('async/parallel')
const utils = require('./utils')
const createNode = utils.createNode

describe('.contentRouting', () => {})
11 changes: 11 additions & 0 deletions test/dht.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
chai.use(require('dirty-chai'))
const expect = chai.expect
const parallel = require('async/parallel')
const utils = require('./utils')
const createNode = utils.createNode

describe('.dht', () => {})
11 changes: 11 additions & 0 deletions test/peerRouting.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
chai.use(require('dirty-chai'))
const expect = chai.expect
const parallel = require('async/parallel')
const utils = require('./utils')
const createNode = utils.createNode

describe('.peerRouting', () => {})

0 comments on commit e67283f

Please sign in to comment.