mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-11 23:01:34 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
ae513887f5 | |||
7c78faa171 | |||
7d12eb9e26 | |||
581a1de472 | |||
288ac17954 |
26
CHANGELOG.md
26
CHANGELOG.md
@ -1,7 +1,33 @@
|
|||||||
|
<a name="0.24.1"></a>
|
||||||
|
## [0.24.1](https://github.com/libp2p/js-libp2p/compare/v0.24.0...v0.24.1) (2018-12-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* allow configurable validators and selectors to the dht ([#288](https://github.com/libp2p/js-libp2p/issues/288)) ([7d12eb9](https://github.com/libp2p/js-libp2p/commit/7d12eb9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="0.24.0"></a>
|
<a name="0.24.0"></a>
|
||||||
# [0.24.0](https://github.com/libp2p/js-libp2p/compare/v0.24.0-rc.3...v0.24.0) (2018-11-16)
|
# [0.24.0](https://github.com/libp2p/js-libp2p/compare/v0.24.0-rc.3...v0.24.0) (2018-11-16)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add maxtimeout to dht get ([#248](https://github.com/libp2p/js-libp2p/issues/248)) ([69f7264](https://github.com/libp2p/js-libp2p/commit/69f7264))
|
||||||
|
* dht get options ([4460e82](https://github.com/libp2p/js-libp2p/commit/4460e82))
|
||||||
|
* dont call callback before it's properly set ([17b5f73](https://github.com/libp2p/js-libp2p/commit/17b5f73))
|
||||||
|
* improve get peer info errors ([714b6ec](https://github.com/libp2p/js-libp2p/commit/714b6ec))
|
||||||
|
* start kad dht random walk ([#251](https://github.com/libp2p/js-libp2p/issues/251)) ([dd934b9](https://github.com/libp2p/js-libp2p/commit/dd934b9))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add datastore to config ([40e840d](https://github.com/libp2p/js-libp2p/commit/40e840d))
|
||||||
|
* add delegated peer and content routing support ([#242](https://github.com/libp2p/js-libp2p/issues/242)) ([a95389a](https://github.com/libp2p/js-libp2p/commit/a95389a))
|
||||||
|
* add maxNumProviders to findprovs ([#283](https://github.com/libp2p/js-libp2p/issues/283)) ([970deec](https://github.com/libp2p/js-libp2p/commit/970deec))
|
||||||
|
* conditionally emit errors ([f71fdfd](https://github.com/libp2p/js-libp2p/commit/f71fdfd))
|
||||||
|
* enable relay by default (no hop) ([#254](https://github.com/libp2p/js-libp2p/issues/254)) ([686379e](https://github.com/libp2p/js-libp2p/commit/686379e))
|
||||||
|
* make libp2p a state machine ([#257](https://github.com/libp2p/js-libp2p/issues/257)) ([0b75f99](https://github.com/libp2p/js-libp2p/commit/0b75f99))
|
||||||
|
* use package-table vs custom script ([a63432e](https://github.com/libp2p/js-libp2p/commit/a63432e))
|
||||||
|
|
||||||
<a name="0.23.1"></a>
|
<a name="0.23.1"></a>
|
||||||
## [0.23.1](https://github.com/libp2p/js-libp2p/compare/v0.23.0...v0.23.1) (2018-08-13)
|
## [0.23.1](https://github.com/libp2p/js-libp2p/compare/v0.23.0...v0.23.1) (2018-08-13)
|
||||||
|
@ -10,8 +10,7 @@ Let us know if you find any issue or if you want to contribute and add a new tut
|
|||||||
- [Protocol and Stream Muxing](./protocol-and-stream-muxing)
|
- [Protocol and Stream Muxing](./protocol-and-stream-muxing)
|
||||||
- [Encrypted Communications](./encrypted-communications)
|
- [Encrypted Communications](./encrypted-communications)
|
||||||
- [Discovery Mechanisms](./discovery-mechanisms)
|
- [Discovery Mechanisms](./discovery-mechanisms)
|
||||||
- [Peer Routing](./peer-and-content-routing)
|
- [Peer and Content Routing](./peer-and-content-routing)
|
||||||
- [Content Routing](./peer-and-content-routing)
|
|
||||||
- [PubSub](./pubsub)
|
- [PubSub](./pubsub)
|
||||||
- [NAT Traversal](./nat-traversal)
|
- [NAT Traversal](./nat-traversal)
|
||||||
- Circuit Relay (future)
|
- Circuit Relay (future)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "libp2p",
|
"name": "libp2p",
|
||||||
"version": "0.24.0",
|
"version": "0.24.1",
|
||||||
"description": "JavaScript base class for libp2p bundles",
|
"description": "JavaScript base class for libp2p bundles",
|
||||||
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
@ -111,6 +111,7 @@
|
|||||||
"Kevin Kwok <antimatter15@gmail.com>",
|
"Kevin Kwok <antimatter15@gmail.com>",
|
||||||
"Lars Gierth <lgierth@users.noreply.github.com>",
|
"Lars Gierth <lgierth@users.noreply.github.com>",
|
||||||
"Maciej Krüger <mkg20001@gmail.com>",
|
"Maciej Krüger <mkg20001@gmail.com>",
|
||||||
|
"Marcin Tojek <mtojek@users.noreply.github.com>",
|
||||||
"Nuno Nogueira <nunofmn@gmail.com>",
|
"Nuno Nogueira <nunofmn@gmail.com>",
|
||||||
"Pedro Teixeira <pedro@protocol.ai>",
|
"Pedro Teixeira <pedro@protocol.ai>",
|
||||||
"Pedro Teixeira <i@pgte.me>",
|
"Pedro Teixeira <i@pgte.me>",
|
||||||
|
@ -32,9 +32,11 @@ const OptionsSchema = Joi.object({
|
|||||||
})
|
})
|
||||||
}).default(),
|
}).default(),
|
||||||
dht: Joi.object().keys({
|
dht: Joi.object().keys({
|
||||||
kBucketSize: Joi.number().allow(null),
|
kBucketSize: Joi.number().default(20),
|
||||||
enabledDiscovery: Joi.boolean().default(true)
|
enabledDiscovery: Joi.boolean().default(true),
|
||||||
}),
|
validators: Joi.object().allow(null),
|
||||||
|
selectors: Joi.object().allow(null)
|
||||||
|
}).default(),
|
||||||
EXPERIMENTAL: Joi.object().keys({
|
EXPERIMENTAL: Joi.object().keys({
|
||||||
dht: Joi.boolean().default(false),
|
dht: Joi.boolean().default(false),
|
||||||
pubsub: Joi.boolean().default(false)
|
pubsub: Joi.boolean().default(false)
|
||||||
|
@ -102,9 +102,11 @@ class Node extends EventEmitter {
|
|||||||
const enabledDiscovery = this._config.dht.enabledDiscovery !== false
|
const enabledDiscovery = this._config.dht.enabledDiscovery !== false
|
||||||
|
|
||||||
this._dht = new DHT(this._switch, {
|
this._dht = new DHT(this._switch, {
|
||||||
kBucketSize: this._config.dht.kBucketSize || 20,
|
kBucketSize: this._config.dht.kBucketSize,
|
||||||
enabledDiscovery,
|
enabledDiscovery,
|
||||||
datastore: this.datastore
|
datastore: this.datastore,
|
||||||
|
validators: this._config.dht.validators,
|
||||||
|
selectors: this._config.dht.selectors
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ const WS = require('libp2p-websockets')
|
|||||||
const Bootstrap = require('libp2p-bootstrap')
|
const Bootstrap = require('libp2p-bootstrap')
|
||||||
const DelegatedPeerRouter = require('libp2p-delegated-peer-routing')
|
const DelegatedPeerRouter = require('libp2p-delegated-peer-routing')
|
||||||
const DelegatedContentRouter = require('libp2p-delegated-content-routing')
|
const DelegatedContentRouter = require('libp2p-delegated-content-routing')
|
||||||
|
const DHT = require('libp2p-kad-dht')
|
||||||
|
|
||||||
const validateConfig = require('../src/config').validate
|
const validateConfig = require('../src/config').validate
|
||||||
|
|
||||||
@ -91,6 +92,10 @@ describe('configuration', () => {
|
|||||||
pubsub: false,
|
pubsub: false,
|
||||||
dht: false
|
dht: false
|
||||||
},
|
},
|
||||||
|
dht: {
|
||||||
|
kBucketSize: 20,
|
||||||
|
enabledDiscovery: true
|
||||||
|
},
|
||||||
relay: {
|
relay: {
|
||||||
enabled: true
|
enabled: true
|
||||||
}
|
}
|
||||||
@ -143,4 +148,49 @@ describe('configuration', () => {
|
|||||||
|
|
||||||
expect(() => validateConfig(options)).to.throw()
|
expect(() => validateConfig(options)).to.throw()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add defaults, validators and selectors for dht', () => {
|
||||||
|
const selectors = {}
|
||||||
|
const validators = {}
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
peerInfo,
|
||||||
|
modules: {
|
||||||
|
transport: [WS],
|
||||||
|
dht: DHT
|
||||||
|
},
|
||||||
|
config: {
|
||||||
|
EXPERIMENTAL: {
|
||||||
|
dht: true
|
||||||
|
},
|
||||||
|
dht: {
|
||||||
|
selectors,
|
||||||
|
validators
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const expected = {
|
||||||
|
peerInfo,
|
||||||
|
modules: {
|
||||||
|
transport: [WS],
|
||||||
|
dht: DHT
|
||||||
|
},
|
||||||
|
config: {
|
||||||
|
EXPERIMENTAL: {
|
||||||
|
pubsub: false,
|
||||||
|
dht: true
|
||||||
|
},
|
||||||
|
relay: {
|
||||||
|
enabled: true
|
||||||
|
},
|
||||||
|
dht: {
|
||||||
|
kBucketSize: 20,
|
||||||
|
enabledDiscovery: true,
|
||||||
|
selectors,
|
||||||
|
validators
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect(validateConfig(options)).to.deep.equal(expected)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@ -427,7 +427,7 @@ describe('transports', () => {
|
|||||||
cb()
|
cb()
|
||||||
}),
|
}),
|
||||||
(cb) => {
|
(cb) => {
|
||||||
const wstar = new WRTCStar({wrtc: wrtc})
|
const wstar = new WRTCStar({ wrtc: wrtc })
|
||||||
|
|
||||||
createNode([
|
createNode([
|
||||||
'/ip4/0.0.0.0/tcp/0',
|
'/ip4/0.0.0.0/tcp/0',
|
||||||
@ -474,7 +474,7 @@ describe('transports', () => {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
(cb) => {
|
(cb) => {
|
||||||
const wstar = new WRTCStar({wrtc: wrtc})
|
const wstar = new WRTCStar({ wrtc: wrtc })
|
||||||
|
|
||||||
createNode([
|
createNode([
|
||||||
'/ip4/127.0.0.1/tcp/24642/ws/p2p-webrtc-star'
|
'/ip4/127.0.0.1/tcp/24642/ws/p2p-webrtc-star'
|
||||||
|
Reference in New Issue
Block a user