@libp2p/kad-dht 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/content-fetching/index.d.ts +6 -9
- package/dist/src/content-fetching/index.d.ts.map +1 -1
- package/dist/src/content-fetching/index.js +14 -11
- package/dist/src/content-fetching/index.js.map +1 -1
- package/dist/src/content-routing/index.d.ts +6 -9
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/content-routing/index.js +15 -13
- package/dist/src/content-routing/index.js.map +1 -1
- package/dist/src/dual-kad-dht.d.ts +6 -6
- package/dist/src/dual-kad-dht.d.ts.map +1 -1
- package/dist/src/dual-kad-dht.js +9 -4
- package/dist/src/dual-kad-dht.js.map +1 -1
- package/dist/src/index.d.ts +14 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -12
- package/dist/src/index.js.map +1 -1
- package/dist/src/kad-dht.d.ts +14 -54
- package/dist/src/kad-dht.d.ts.map +1 -1
- package/dist/src/kad-dht.js +45 -48
- package/dist/src/kad-dht.js.map +1 -1
- package/dist/src/message/index.d.ts +3 -3
- package/dist/src/network.d.ts +9 -9
- package/dist/src/network.d.ts.map +1 -1
- package/dist/src/network.js +10 -6
- package/dist/src/network.js.map +1 -1
- package/dist/src/peer-list/index.d.ts +1 -1
- package/dist/src/peer-list/index.js +1 -1
- package/dist/src/peer-routing/index.d.ts +8 -10
- package/dist/src/peer-routing/index.d.ts.map +1 -1
- package/dist/src/peer-routing/index.js +18 -16
- package/dist/src/peer-routing/index.js.map +1 -1
- package/dist/src/providers.d.ts +6 -6
- package/dist/src/providers.d.ts.map +1 -1
- package/dist/src/providers.js +11 -7
- package/dist/src/providers.js.map +1 -1
- package/dist/src/query/events.d.ts +5 -5
- package/dist/src/query/manager.d.ts +6 -8
- package/dist/src/query/manager.d.ts.map +1 -1
- package/dist/src/query/manager.js +10 -7
- package/dist/src/query/manager.js.map +1 -1
- package/dist/src/query/query-path.d.ts.map +1 -1
- package/dist/src/query/query-path.js +2 -3
- package/dist/src/query/query-path.js.map +1 -1
- package/dist/src/query-self.d.ts +6 -6
- package/dist/src/query-self.d.ts.map +1 -1
- package/dist/src/query-self.js +8 -4
- package/dist/src/query-self.js.map +1 -1
- package/dist/src/routing-table/index.d.ts +10 -14
- package/dist/src/routing-table/index.d.ts.map +1 -1
- package/dist/src/routing-table/index.js +12 -10
- package/dist/src/routing-table/index.js.map +1 -1
- package/dist/src/routing-table/refresh.d.ts +5 -3
- package/dist/src/routing-table/refresh.d.ts.map +1 -1
- package/dist/src/routing-table/refresh.js +4 -2
- package/dist/src/routing-table/refresh.js.map +1 -1
- package/dist/src/rpc/handlers/add-provider.d.ts +5 -3
- package/dist/src/rpc/handlers/add-provider.d.ts.map +1 -1
- package/dist/src/rpc/handlers/add-provider.js +4 -2
- package/dist/src/rpc/handlers/add-provider.js.map +1 -1
- package/dist/src/rpc/handlers/find-node.d.ts +5 -3
- package/dist/src/rpc/handlers/find-node.d.ts.map +1 -1
- package/dist/src/rpc/handlers/find-node.js +4 -2
- package/dist/src/rpc/handlers/find-node.js.map +1 -1
- package/dist/src/rpc/handlers/get-providers.d.ts +8 -8
- package/dist/src/rpc/handlers/get-providers.d.ts.map +1 -1
- package/dist/src/rpc/handlers/get-providers.js +8 -4
- package/dist/src/rpc/handlers/get-providers.js.map +1 -1
- package/dist/src/rpc/handlers/get-value.d.ts +6 -9
- package/dist/src/rpc/handlers/get-value.d.ts.map +1 -1
- package/dist/src/rpc/handlers/get-value.js +10 -7
- package/dist/src/rpc/handlers/get-value.js.map +1 -1
- package/dist/src/rpc/handlers/ping.d.ts +3 -1
- package/dist/src/rpc/handlers/ping.d.ts.map +1 -1
- package/dist/src/rpc/handlers/ping.js +2 -0
- package/dist/src/rpc/handlers/ping.js.map +1 -1
- package/dist/src/rpc/handlers/put-value.d.ts +7 -8
- package/dist/src/rpc/handlers/put-value.d.ts.map +1 -1
- package/dist/src/rpc/handlers/put-value.js +10 -7
- package/dist/src/rpc/handlers/put-value.js.map +1 -1
- package/dist/src/rpc/index.d.ts +6 -10
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +14 -9
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/src/topology-listener.d.ts +6 -6
- package/dist/src/topology-listener.d.ts.map +1 -1
- package/dist/src/topology-listener.js +9 -5
- package/dist/src/topology-listener.js.map +1 -1
- package/dist/src/utils.d.ts +3 -3
- package/package.json +21 -21
- package/src/content-fetching/index.ts +17 -19
- package/src/content-routing/index.ts +20 -23
- package/src/dual-kad-dht.ts +12 -9
- package/src/index.ts +22 -14
- package/src/kad-dht.ts +61 -119
- package/src/message/index.ts +4 -4
- package/src/network.ts +16 -14
- package/src/peer-list/index.ts +1 -1
- package/src/peer-routing/index.ts +23 -25
- package/src/providers.ts +14 -11
- package/src/query/events.ts +5 -5
- package/src/query/manager.ts +13 -14
- package/src/query/query-path.ts +2 -3
- package/src/query-self.ts +11 -9
- package/src/routing-table/index.ts +20 -23
- package/src/routing-table/refresh.ts +9 -4
- package/src/rpc/handlers/add-provider.ts +9 -4
- package/src/rpc/handlers/find-node.ts +9 -4
- package/src/rpc/handlers/get-providers.ts +13 -11
- package/src/rpc/handlers/get-value.ts +13 -15
- package/src/rpc/handlers/ping.ts +6 -1
- package/src/rpc/handlers/put-value.ts +14 -15
- package/src/rpc/index.ts +19 -18
- package/src/topology-listener.ts +12 -10
- package/src/utils.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAU,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,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AC,GAAG,CAAC,CAAA;QACrB,CAAC,CAAC,CAAA;IACN,CAAC;CACF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from '@libp2p/interfaces';
|
|
2
|
-
import type { Registrar } from '@libp2p/interfaces/registrar';
|
|
3
2
|
import type { Startable } from '@libp2p/interfaces';
|
|
4
3
|
import type { PeerId } from '@libp2p/interfaces/peer-id';
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { Components, Initializable } from '@libp2p/interfaces/components';
|
|
5
|
+
export interface TopologyListenerInit {
|
|
7
6
|
protocol: string;
|
|
8
7
|
lan: boolean;
|
|
9
8
|
}
|
|
@@ -13,13 +12,14 @@ export interface TopologyListenerEvents {
|
|
|
13
12
|
/**
|
|
14
13
|
* Receives notifications of new peers joining the network that support the DHT protocol
|
|
15
14
|
*/
|
|
16
|
-
export declare class TopologyListener extends EventEmitter<TopologyListenerEvents> implements Startable {
|
|
15
|
+
export declare class TopologyListener extends EventEmitter<TopologyListenerEvents> implements Startable, Initializable {
|
|
17
16
|
private readonly log;
|
|
18
|
-
private
|
|
17
|
+
private components;
|
|
19
18
|
private readonly protocol;
|
|
20
19
|
private running;
|
|
21
20
|
private registrarId?;
|
|
22
|
-
constructor(
|
|
21
|
+
constructor(init: TopologyListenerInit);
|
|
22
|
+
init(components: Components): void;
|
|
23
23
|
isStarted(): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Start the network
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topology-listener.d.ts","sourceRoot":"","sources":["../../src/topology-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,YAAY,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"topology-listener.d.ts","sourceRoot":"","sources":["../../src/topology-listener.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAEzE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,YAAY,CAAC,sBAAsB,CAAE,YAAW,SAAS,EAAE,aAAa;IAC5G,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAQ;gBAEf,IAAI,EAAE,oBAAoB;IAUvC,IAAI,CAAE,UAAU,EAAE,UAAU,GAAG,IAAI;IAInC,SAAS;IAIT;;OAEG;IACG,KAAK;IAmBX;;OAEG;IACH,IAAI;CASL"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { createTopology } from '@libp2p/topology';
|
|
2
2
|
import { CustomEvent, EventEmitter } from '@libp2p/interfaces';
|
|
3
3
|
import { logger } from '@libp2p/logger';
|
|
4
|
+
import { Components } from '@libp2p/interfaces/components';
|
|
4
5
|
/**
|
|
5
6
|
* Receives notifications of new peers joining the network that support the DHT protocol
|
|
6
7
|
*/
|
|
7
8
|
export class TopologyListener extends EventEmitter {
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(init) {
|
|
9
10
|
super();
|
|
10
|
-
|
|
11
|
+
this.components = new Components();
|
|
12
|
+
const { protocol, lan } = init;
|
|
11
13
|
this.log = logger(`libp2p:kad-dht:topology-listener:${lan ? 'lan' : 'wan'}`);
|
|
12
14
|
this.running = false;
|
|
13
|
-
this.registrar = registrar;
|
|
14
15
|
this.protocol = protocol;
|
|
15
16
|
}
|
|
17
|
+
init(components) {
|
|
18
|
+
this.components = components;
|
|
19
|
+
}
|
|
16
20
|
isStarted() {
|
|
17
21
|
return this.running;
|
|
18
22
|
}
|
|
@@ -33,7 +37,7 @@ export class TopologyListener extends EventEmitter {
|
|
|
33
37
|
}));
|
|
34
38
|
}
|
|
35
39
|
});
|
|
36
|
-
this.registrarId = await this.
|
|
40
|
+
this.registrarId = await this.components.getRegistrar().register(this.protocol, topology);
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* Stop all network activity
|
|
@@ -42,7 +46,7 @@ export class TopologyListener extends EventEmitter {
|
|
|
42
46
|
this.running = false;
|
|
43
47
|
// unregister protocol and handlers
|
|
44
48
|
if (this.registrarId != null) {
|
|
45
|
-
this.
|
|
49
|
+
this.components.getRegistrar().unregister(this.registrarId);
|
|
46
50
|
this.registrarId = undefined;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topology-listener.js","sourceRoot":"","sources":["../../src/topology-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"topology-listener.js","sourceRoot":"","sources":["../../src/topology-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAIvC,OAAO,EAAE,UAAU,EAAiB,MAAM,+BAA+B,CAAA;AAWzE;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAoC;I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EAAE;YAC5B,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAC3D,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;SAC7B;IACH,CAAC;CACF"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Key } from 'interface-datastore/key';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PeerInfo } from '@libp2p/interfaces/peer-info';
|
|
3
3
|
import type { PeerId } from '@libp2p/interfaces/peer-id';
|
|
4
|
-
export declare function removePrivateAddresses(peer:
|
|
5
|
-
export declare function removePublicAddresses(peer:
|
|
4
|
+
export declare function removePrivateAddresses(peer: PeerInfo): PeerInfo;
|
|
5
|
+
export declare function removePublicAddresses(peer: PeerInfo): PeerInfo;
|
|
6
6
|
/**
|
|
7
7
|
* Creates a DHT ID by hashing a given Uint8Array
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/kad-dht",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "JavaScript implementation of the Kad-DHT for libp2p",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p-kad-dht#readme",
|
|
@@ -136,48 +136,48 @@
|
|
|
136
136
|
"release": "semantic-release"
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@libp2p/crypto": "^0.22.
|
|
140
|
-
"@libp2p/interfaces": "^1.3.
|
|
141
|
-
"@libp2p/logger": "^1.
|
|
142
|
-
"@libp2p/peer-id": "^1.
|
|
139
|
+
"@libp2p/crypto": "^0.22.9",
|
|
140
|
+
"@libp2p/interfaces": "^1.3.18",
|
|
141
|
+
"@libp2p/logger": "^1.1.2",
|
|
142
|
+
"@libp2p/peer-id": "^1.1.8",
|
|
143
143
|
"@libp2p/record": "^1.0.0",
|
|
144
|
-
"@libp2p/topology": "^1.
|
|
145
|
-
"@multiformats/multiaddr": "^10.
|
|
144
|
+
"@libp2p/topology": "^1.1.6",
|
|
145
|
+
"@multiformats/multiaddr": "^10.1.5",
|
|
146
146
|
"any-signal": "^3.0.0",
|
|
147
147
|
"datastore-core": "^7.0.0",
|
|
148
|
-
"err-code": "^3.0.
|
|
148
|
+
"err-code": "^3.0.1",
|
|
149
149
|
"hashlru": "^2.3.0",
|
|
150
|
-
"interface-datastore": "^6.0
|
|
151
|
-
"it-all": "^1.0.
|
|
152
|
-
"it-drain": "^1.0.
|
|
153
|
-
"it-first": "^1.0.
|
|
150
|
+
"interface-datastore": "^6.1.0",
|
|
151
|
+
"it-all": "^1.0.6",
|
|
152
|
+
"it-drain": "^1.0.5",
|
|
153
|
+
"it-first": "^1.0.6",
|
|
154
154
|
"it-length": "^1.0.3",
|
|
155
|
-
"it-length-prefixed": "^7.0.
|
|
156
|
-
"it-map": "^1.0.
|
|
155
|
+
"it-length-prefixed": "^7.0.1",
|
|
156
|
+
"it-map": "^1.0.6",
|
|
157
157
|
"it-merge": "^1.0.3",
|
|
158
158
|
"it-parallel": "^2.0.1",
|
|
159
159
|
"it-pipe": "^2.0.3",
|
|
160
160
|
"it-stream-types": "^1.0.4",
|
|
161
161
|
"it-take": "^1.0.2",
|
|
162
162
|
"k-bucket": "^5.1.0",
|
|
163
|
-
"multiformats": "^9.
|
|
163
|
+
"multiformats": "^9.6.3",
|
|
164
164
|
"p-defer": "^4.0.0",
|
|
165
165
|
"p-map": "^5.3.0",
|
|
166
166
|
"p-queue": "^7.2.0",
|
|
167
167
|
"private-ip": "^2.3.3",
|
|
168
|
-
"protobufjs": "^6.
|
|
168
|
+
"protobufjs": "^6.11.2",
|
|
169
169
|
"streaming-iterables": "^6.0.0",
|
|
170
170
|
"timeout-abort-controller": "^3.0.0",
|
|
171
171
|
"uint8arrays": "^3.0.0",
|
|
172
172
|
"varint": "^6.0.0"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
|
-
"@libp2p/interface-compliance-tests": "^1.1.
|
|
176
|
-
"@libp2p/peer-id-factory": "^1.0.
|
|
177
|
-
"@libp2p/peer-store": "^1.0.
|
|
175
|
+
"@libp2p/interface-compliance-tests": "^1.1.20",
|
|
176
|
+
"@libp2p/peer-id-factory": "^1.0.8",
|
|
177
|
+
"@libp2p/peer-store": "^1.0.7",
|
|
178
178
|
"@types/lodash.random": "^3.2.6",
|
|
179
179
|
"@types/lodash.range": "^3.2.6",
|
|
180
|
-
"@types/node": "^16.11.
|
|
180
|
+
"@types/node": "^16.11.26",
|
|
181
181
|
"@types/varint": "^6.0.0",
|
|
182
182
|
"@types/which": "^2.0.1",
|
|
183
183
|
"aegir": "^36.1.3",
|
|
@@ -187,11 +187,11 @@
|
|
|
187
187
|
"it-filter": "^1.0.3",
|
|
188
188
|
"it-last": "^1.0.6",
|
|
189
189
|
"it-pair": "^2.0.2",
|
|
190
|
-
"libp2p": "^0.36.2",
|
|
191
190
|
"lodash.random": "^3.2.0",
|
|
192
191
|
"lodash.range": "^3.2.0",
|
|
193
192
|
"p-retry": "^5.0.0",
|
|
194
193
|
"sinon": "^13.0.1",
|
|
194
|
+
"ts-sinon": "^2.0.2",
|
|
195
195
|
"which": "^2.0.2"
|
|
196
196
|
},
|
|
197
197
|
"browser": {
|
|
@@ -16,9 +16,7 @@ import {
|
|
|
16
16
|
} from '../constants.js'
|
|
17
17
|
import { createPutRecord, convertBuffer, bufferToRecordKey } from '../utils.js'
|
|
18
18
|
import { logger } from '@libp2p/logger'
|
|
19
|
-
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
20
19
|
import type { Validators, Selectors, ValueEvent, QueryOptions } from '@libp2p/interfaces/dht'
|
|
21
|
-
import type { Datastore } from 'interface-datastore'
|
|
22
20
|
import type { PeerRouting } from '../peer-routing/index.js'
|
|
23
21
|
import type { QueryManager } from '../query/manager.js'
|
|
24
22
|
import type { RoutingTable } from '../routing-table/index.js'
|
|
@@ -26,10 +24,9 @@ import type { Network } from '../network.js'
|
|
|
26
24
|
import type { Logger } from '@libp2p/logger'
|
|
27
25
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
28
26
|
import type { QueryFunc } from '../query/types.js'
|
|
27
|
+
import { Components, Initializable } from '@libp2p/interfaces/components'
|
|
29
28
|
|
|
30
|
-
export interface
|
|
31
|
-
peerId: PeerId
|
|
32
|
-
datastore: Datastore
|
|
29
|
+
export interface ContentFetchingInit {
|
|
33
30
|
validators: Validators
|
|
34
31
|
selectors: Selectors
|
|
35
32
|
peerRouting: PeerRouting
|
|
@@ -39,10 +36,9 @@ export interface ContentFetchingOptions {
|
|
|
39
36
|
lan: boolean
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
export class ContentFetching {
|
|
39
|
+
export class ContentFetching implements Initializable {
|
|
43
40
|
private readonly log: Logger
|
|
44
|
-
private
|
|
45
|
-
private readonly datastore: Datastore
|
|
41
|
+
private components: Components = new Components()
|
|
46
42
|
private readonly validators: Validators
|
|
47
43
|
private readonly selectors: Selectors
|
|
48
44
|
private readonly peerRouting: PeerRouting
|
|
@@ -50,11 +46,9 @@ export class ContentFetching {
|
|
|
50
46
|
private readonly routingTable: RoutingTable
|
|
51
47
|
private readonly network: Network
|
|
52
48
|
|
|
53
|
-
constructor (
|
|
54
|
-
const {
|
|
55
|
-
this.log = logger(`libp2p:kad-dht:${lan ? 'lan' : 'wan'}:content-fetching
|
|
56
|
-
this.peerId = peerId
|
|
57
|
-
this.datastore = datastore
|
|
49
|
+
constructor (init: ContentFetchingInit) {
|
|
50
|
+
const { validators, selectors, peerRouting, queryManager, routingTable, network, lan } = init
|
|
51
|
+
this.log = logger(`libp2p:kad-dht:${lan ? 'lan' : 'wan'}:content-fetching`)
|
|
58
52
|
this.validators = validators
|
|
59
53
|
this.selectors = selectors
|
|
60
54
|
this.peerRouting = peerRouting
|
|
@@ -63,9 +57,13 @@ export class ContentFetching {
|
|
|
63
57
|
this.network = network
|
|
64
58
|
}
|
|
65
59
|
|
|
60
|
+
init (components: Components): void {
|
|
61
|
+
this.components = components
|
|
62
|
+
}
|
|
63
|
+
|
|
66
64
|
async putLocal (key: Uint8Array, rec: Uint8Array) { // eslint-disable-line require-await
|
|
67
65
|
const dsKey = bufferToRecordKey(key)
|
|
68
|
-
await this.
|
|
66
|
+
await this.components.getDatastore().put(dsKey, rec)
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
/**
|
|
@@ -79,7 +77,7 @@ export class ContentFetching {
|
|
|
79
77
|
|
|
80
78
|
this.log('fetching record for key %k', dsKey)
|
|
81
79
|
|
|
82
|
-
const raw = await this.
|
|
80
|
+
const raw = await this.components.getDatastore().get(dsKey)
|
|
83
81
|
this.log('found %k in local datastore', dsKey)
|
|
84
82
|
|
|
85
83
|
const rec = Libp2pRecord.deserialize(raw)
|
|
@@ -104,11 +102,11 @@ export class ContentFetching {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
// correct ourself
|
|
107
|
-
if (this.
|
|
105
|
+
if (this.components.getPeerId().equals(from)) {
|
|
108
106
|
try {
|
|
109
107
|
const dsKey = bufferToRecordKey(key)
|
|
110
108
|
this.log(`Storing corrected record for key ${dsKey.toString()}`)
|
|
111
|
-
await this.
|
|
109
|
+
await this.components.getDatastore().put(dsKey, fixupRec)
|
|
112
110
|
} catch (err: any) {
|
|
113
111
|
this.log.error('Failed error correcting self', err)
|
|
114
112
|
}
|
|
@@ -149,7 +147,7 @@ export class ContentFetching {
|
|
|
149
147
|
// store the record locally
|
|
150
148
|
const dsKey = bufferToRecordKey(key)
|
|
151
149
|
this.log(`storing record for key ${dsKey.toString()}`)
|
|
152
|
-
await this.
|
|
150
|
+
await this.components.getDatastore().put(dsKey, record)
|
|
153
151
|
|
|
154
152
|
// put record to the closest peers
|
|
155
153
|
yield * pipe(
|
|
@@ -247,7 +245,7 @@ export class ContentFetching {
|
|
|
247
245
|
|
|
248
246
|
yield valueEvent({
|
|
249
247
|
value: localRec.value,
|
|
250
|
-
from: this.
|
|
248
|
+
from: this.components.getPeerId()
|
|
251
249
|
})
|
|
252
250
|
} catch (err: any) {
|
|
253
251
|
this.log('error getting local value for %b', key, err)
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
providerEvent
|
|
11
11
|
} from '../query/events.js'
|
|
12
12
|
import { logger } from '@libp2p/logger'
|
|
13
|
-
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
14
13
|
import type { QueryEvent, QueryOptions } from '@libp2p/interfaces/dht'
|
|
15
14
|
import type { PeerRouting } from '../peer-routing/index.js'
|
|
16
15
|
import type { QueryManager } from '../query/manager.js'
|
|
@@ -18,46 +17,44 @@ import type { RoutingTable } from '../routing-table/index.js'
|
|
|
18
17
|
import type { Network } from '../network.js'
|
|
19
18
|
import type { Logger } from '@libp2p/logger'
|
|
20
19
|
import type { Providers } from '../providers.js'
|
|
21
|
-
import type { PeerStore } from '@libp2p/interfaces/peer-store'
|
|
22
20
|
import type { QueryFunc } from '../query/types.js'
|
|
23
21
|
import type { CID } from 'multiformats/cid'
|
|
24
22
|
import type { AbortOptions } from '@libp2p/interfaces'
|
|
25
23
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
26
|
-
import type {
|
|
27
|
-
import {
|
|
24
|
+
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
|
|
25
|
+
import { Components, Initializable } from '@libp2p/interfaces/components'
|
|
28
26
|
|
|
29
|
-
export interface
|
|
30
|
-
peerId: PeerId
|
|
27
|
+
export interface ContentRoutingInit {
|
|
31
28
|
network: Network
|
|
32
29
|
peerRouting: PeerRouting
|
|
33
30
|
queryManager: QueryManager
|
|
34
31
|
routingTable: RoutingTable
|
|
35
32
|
providers: Providers
|
|
36
|
-
peerStore: PeerStore
|
|
37
33
|
lan: boolean
|
|
38
34
|
}
|
|
39
35
|
|
|
40
|
-
export class ContentRouting {
|
|
36
|
+
export class ContentRouting implements Initializable {
|
|
41
37
|
private readonly log: Logger
|
|
42
|
-
private
|
|
38
|
+
private components: Components = new Components()
|
|
43
39
|
private readonly network: Network
|
|
44
40
|
private readonly peerRouting: PeerRouting
|
|
45
41
|
private readonly queryManager: QueryManager
|
|
46
42
|
private readonly routingTable: RoutingTable
|
|
47
43
|
private readonly providers: Providers
|
|
48
|
-
private readonly peerStore: PeerStore
|
|
49
44
|
|
|
50
|
-
constructor (
|
|
51
|
-
const {
|
|
45
|
+
constructor (init: ContentRoutingInit) {
|
|
46
|
+
const { network, peerRouting, queryManager, routingTable, providers, lan } = init
|
|
52
47
|
|
|
53
48
|
this.log = logger(`libp2p:kad-dht:${lan ? 'lan' : 'wan'}:content-routing`)
|
|
54
|
-
this.peerId = peerId
|
|
55
49
|
this.network = network
|
|
56
50
|
this.peerRouting = peerRouting
|
|
57
51
|
this.queryManager = queryManager
|
|
58
52
|
this.routingTable = routingTable
|
|
59
53
|
this.providers = providers
|
|
60
|
-
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
init (components: Components): void {
|
|
57
|
+
this.components = components
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
/**
|
|
@@ -68,11 +65,11 @@ export class ContentRouting {
|
|
|
68
65
|
this.log('provide %s', key)
|
|
69
66
|
|
|
70
67
|
// Add peer as provider
|
|
71
|
-
await this.providers.addProvider(key, this.
|
|
68
|
+
await this.providers.addProvider(key, this.components.getPeerId())
|
|
72
69
|
|
|
73
70
|
const msg = new Message(MESSAGE_TYPE.ADD_PROVIDER, key.bytes, 0)
|
|
74
71
|
msg.providerPeers = [{
|
|
75
|
-
id: this.
|
|
72
|
+
id: this.components.getPeerId(),
|
|
76
73
|
multiaddrs,
|
|
77
74
|
protocols: []
|
|
78
75
|
}]
|
|
@@ -142,18 +139,18 @@ export class ContentRouting {
|
|
|
142
139
|
|
|
143
140
|
// yield values if we have some, also slice because maybe we got lucky and already have too many?
|
|
144
141
|
if (provs.length > 0) {
|
|
145
|
-
const providers:
|
|
142
|
+
const providers: PeerInfo[] = []
|
|
146
143
|
|
|
147
144
|
for (const peerId of provs.slice(0, toFind)) {
|
|
148
145
|
providers.push({
|
|
149
146
|
id: peerId,
|
|
150
|
-
multiaddrs: ((await this.
|
|
147
|
+
multiaddrs: ((await this.components.getPeerStore().addressBook.get(peerId)) ?? []).map(address => address.multiaddr),
|
|
151
148
|
protocols: []
|
|
152
149
|
})
|
|
153
150
|
}
|
|
154
151
|
|
|
155
|
-
yield peerResponseEvent({ from: this.
|
|
156
|
-
yield providerEvent({ from: this.
|
|
152
|
+
yield peerResponseEvent({ from: this.components.getPeerId(), messageType: MESSAGE_TYPE.GET_PROVIDERS, providers })
|
|
153
|
+
yield providerEvent({ from: this.components.getPeerId(), providers: providers })
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
// All done
|
|
@@ -170,7 +167,7 @@ export class ContentRouting {
|
|
|
170
167
|
yield * self.network.sendRequest(peer, request, { signal })
|
|
171
168
|
}
|
|
172
169
|
|
|
173
|
-
const providers = new Set(provs.map(p => p.toString(
|
|
170
|
+
const providers = new Set(provs.map(p => p.toString()))
|
|
174
171
|
|
|
175
172
|
for await (const event of this.queryManager.run(target, this.routingTable.closestPeers(id), findProvidersQuery, options)) {
|
|
176
173
|
yield event
|
|
@@ -181,11 +178,11 @@ export class ContentRouting {
|
|
|
181
178
|
const newProviders = []
|
|
182
179
|
|
|
183
180
|
for (const peer of event.providers) {
|
|
184
|
-
if (providers.has(peer.id.toString(
|
|
181
|
+
if (providers.has(peer.id.toString())) {
|
|
185
182
|
continue
|
|
186
183
|
}
|
|
187
184
|
|
|
188
|
-
providers.add(peer.id.toString(
|
|
185
|
+
providers.add(peer.id.toString())
|
|
189
186
|
newProviders.push(peer)
|
|
190
187
|
}
|
|
191
188
|
|
package/src/dual-kad-dht.ts
CHANGED
|
@@ -3,12 +3,12 @@ import errCode from 'err-code'
|
|
|
3
3
|
import merge from 'it-merge'
|
|
4
4
|
import { queryErrorEvent } from './query/events.js'
|
|
5
5
|
import type { KadDHT } from './kad-dht.js'
|
|
6
|
-
import type {
|
|
6
|
+
import type { DualDHT, QueryOptions } from '@libp2p/interfaces/dht'
|
|
7
7
|
import { AbortOptions, EventEmitter, CustomEvent } from '@libp2p/interfaces'
|
|
8
8
|
import type { CID } from 'multiformats'
|
|
9
9
|
import type { PeerId } from '@libp2p/interfaces/peer-id'
|
|
10
10
|
import type { PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
|
|
11
|
-
import
|
|
11
|
+
import { Components, Initializable } from '@libp2p/interfaces/components'
|
|
12
12
|
|
|
13
13
|
const log = logger('libp2p:kad-dht')
|
|
14
14
|
|
|
@@ -16,19 +16,16 @@ const log = logger('libp2p:kad-dht')
|
|
|
16
16
|
* A DHT implementation modelled after Kademlia with S/Kademlia modifications.
|
|
17
17
|
* Original implementation in go: https://github.com/libp2p/go-libp2p-kad-dht.
|
|
18
18
|
*/
|
|
19
|
-
export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements
|
|
19
|
+
export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements DualDHT, Initializable {
|
|
20
20
|
public wan: KadDHT
|
|
21
21
|
public lan: KadDHT
|
|
22
|
-
public
|
|
23
|
-
public peerStore: PeerStore
|
|
22
|
+
public components: Components = new Components()
|
|
24
23
|
|
|
25
|
-
constructor (wan: KadDHT, lan: KadDHT
|
|
24
|
+
constructor (wan: KadDHT, lan: KadDHT) {
|
|
26
25
|
super()
|
|
27
26
|
|
|
28
27
|
this.wan = wan
|
|
29
28
|
this.lan = lan
|
|
30
|
-
this.peerId = peerId
|
|
31
|
-
this.peerStore = peerStore
|
|
32
29
|
|
|
33
30
|
// handle peers being discovered during processing of DHT messages
|
|
34
31
|
this.wan.addEventListener('peer', (evt) => {
|
|
@@ -43,6 +40,12 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements DHT
|
|
|
43
40
|
})
|
|
44
41
|
}
|
|
45
42
|
|
|
43
|
+
init (components: Components): void {
|
|
44
|
+
this.components = components
|
|
45
|
+
this.wan.init(components)
|
|
46
|
+
this.lan.init(components)
|
|
47
|
+
}
|
|
48
|
+
|
|
46
49
|
/**
|
|
47
50
|
* Is this DHT running.
|
|
48
51
|
*/
|
|
@@ -133,7 +136,7 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements DHT
|
|
|
133
136
|
|
|
134
137
|
if (!foundValue) {
|
|
135
138
|
yield queryErrorEvent({
|
|
136
|
-
from: this.
|
|
139
|
+
from: this.components.getPeerId(),
|
|
137
140
|
error: errCode(new Error('Not found'), 'ERR_NOT_FOUND')
|
|
138
141
|
})
|
|
139
142
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { KadDHT
|
|
1
|
+
import { KadDHT as SingleKadDHT } from './kad-dht.js'
|
|
2
2
|
import { DualKadDHT } from './dual-kad-dht.js'
|
|
3
|
-
import type {
|
|
3
|
+
import type { Selectors, Validators } from '@libp2p/interfaces/dht'
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export interface KadDHTInit {
|
|
6
|
+
kBucketSize?: number
|
|
7
|
+
clientMode?: boolean
|
|
8
|
+
selectors?: Selectors
|
|
9
|
+
validators?: Validators
|
|
10
|
+
querySelfInterval?: number
|
|
11
|
+
lan?: boolean
|
|
12
|
+
protocolPrefix?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class KadDHT extends DualKadDHT {
|
|
16
|
+
constructor (init?: KadDHTInit) {
|
|
17
|
+
super(new SingleKadDHT({
|
|
18
|
+
protocolPrefix: '/ipfs',
|
|
19
|
+
...init,
|
|
10
20
|
lan: false
|
|
11
21
|
}),
|
|
12
|
-
new
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
new SingleKadDHT({
|
|
23
|
+
protocolPrefix: '/ipfs',
|
|
24
|
+
...init,
|
|
15
25
|
clientMode: false,
|
|
16
26
|
lan: true
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
opts.peerStore
|
|
20
|
-
)
|
|
27
|
+
}))
|
|
28
|
+
}
|
|
21
29
|
}
|