@libp2p/kad-dht 16.4.1 → 16.4.2-47cf9cdc1
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/index.min.js +2 -1
- package/dist/index.min.js.map +4 -4
- package/dist/src/content-fetching/index.js +2 -2
- package/dist/src/rpc/handlers/put-value.js +1 -1
- package/package.json +11 -11
- package/src/content-fetching/index.ts +2 -2
- package/src/rpc/handlers/put-value.ts +1 -1
- package/dist/typedoc-urls.json +0 -65
|
@@ -44,9 +44,9 @@ export class ContentFetching {
|
|
|
44
44
|
async getLocal(key, options) {
|
|
45
45
|
this.log('getLocal %b', key);
|
|
46
46
|
const dsKey = bufferToRecordKey(this.datastorePrefix, key);
|
|
47
|
-
this.log('fetching record for key %
|
|
47
|
+
this.log('fetching record for key %s', dsKey);
|
|
48
48
|
const raw = await this.components.datastore.get(dsKey, options);
|
|
49
|
-
this.log('found %
|
|
49
|
+
this.log('found %s in local datastore', dsKey);
|
|
50
50
|
const rec = Libp2pRecord.deserialize(raw);
|
|
51
51
|
await verifyRecord(this.validators, rec, options);
|
|
52
52
|
return rec;
|
|
@@ -27,7 +27,7 @@ export class PutValueHandler {
|
|
|
27
27
|
deserializedRecord.timeReceived = new Date();
|
|
28
28
|
const recordKey = bufferToRecordKey(this.datastorePrefix, deserializedRecord.key);
|
|
29
29
|
await this.components.datastore.put(recordKey, deserializedRecord.serialize().subarray());
|
|
30
|
-
this.log('accepted put for key %b under %
|
|
30
|
+
this.log('accepted put for key %b under %s', key, recordKey);
|
|
31
31
|
return msg;
|
|
32
32
|
}
|
|
33
33
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/kad-dht",
|
|
3
|
-
"version": "16.4.
|
|
3
|
+
"version": "16.4.2-47cf9cdc1",
|
|
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/tree/main/packages/kad-dht#readme",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"doc-check": "aegir doc-check"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@libp2p/crypto": "
|
|
52
|
-
"@libp2p/interface": "
|
|
53
|
-
"@libp2p/interface-internal": "
|
|
54
|
-
"@libp2p/peer-collections": "
|
|
55
|
-
"@libp2p/peer-id": "
|
|
56
|
-
"@libp2p/ping": "
|
|
57
|
-
"@libp2p/record": "
|
|
58
|
-
"@libp2p/utils": "
|
|
51
|
+
"@libp2p/crypto": "5.1.22-47cf9cdc1",
|
|
52
|
+
"@libp2p/interface": "3.2.5-47cf9cdc1",
|
|
53
|
+
"@libp2p/interface-internal": "3.1.11-47cf9cdc1",
|
|
54
|
+
"@libp2p/peer-collections": "7.0.26-47cf9cdc1",
|
|
55
|
+
"@libp2p/peer-id": "6.0.14-47cf9cdc1",
|
|
56
|
+
"@libp2p/ping": "3.1.11-47cf9cdc1",
|
|
57
|
+
"@libp2p/record": "4.0.15-47cf9cdc1",
|
|
58
|
+
"@libp2p/utils": "7.3.2-47cf9cdc1",
|
|
59
59
|
"@multiformats/multiaddr": "^13.0.3",
|
|
60
60
|
"@multiformats/multiaddr-matcher": "^3.0.2",
|
|
61
61
|
"any-signal": "^4.1.1",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"uint8arrays": "^6.1.1"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@libp2p/logger": "
|
|
85
|
-
"@libp2p/peer-store": "
|
|
84
|
+
"@libp2p/logger": "6.2.12-47cf9cdc1",
|
|
85
|
+
"@libp2p/peer-store": "12.0.26-47cf9cdc1",
|
|
86
86
|
"@types/lodash.random": "^3.2.9",
|
|
87
87
|
"@types/lodash.range": "^3.2.9",
|
|
88
88
|
"@types/sinon": "^22.0.0",
|
|
@@ -73,10 +73,10 @@ export class ContentFetching {
|
|
|
73
73
|
|
|
74
74
|
const dsKey = bufferToRecordKey(this.datastorePrefix, key)
|
|
75
75
|
|
|
76
|
-
this.log('fetching record for key %
|
|
76
|
+
this.log('fetching record for key %s', dsKey)
|
|
77
77
|
|
|
78
78
|
const raw = await this.components.datastore.get(dsKey, options)
|
|
79
|
-
this.log('found %
|
|
79
|
+
this.log('found %s in local datastore', dsKey)
|
|
80
80
|
|
|
81
81
|
const rec = Libp2pRecord.deserialize(raw)
|
|
82
82
|
|
|
@@ -52,7 +52,7 @@ export class PutValueHandler implements DHTMessageHandler {
|
|
|
52
52
|
const recordKey = bufferToRecordKey(this.datastorePrefix, deserializedRecord.key)
|
|
53
53
|
await this.components.datastore.put(recordKey, deserializedRecord.serialize().subarray())
|
|
54
54
|
|
|
55
|
-
this.log('accepted put for key %b under %
|
|
55
|
+
this.log('accepted put for key %b under %s', key, recordKey)
|
|
56
56
|
|
|
57
57
|
return msg
|
|
58
58
|
} catch (err: any) {
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"codec": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.MessageType.codec.html",
|
|
3
|
-
"EventTypes": "https://libp2p.github.io/js-libp2p/enums/_libp2p_kad-dht.EventTypes.html",
|
|
4
|
-
".:EventTypes": "https://libp2p.github.io/js-libp2p/enums/_libp2p_kad-dht.EventTypes.html",
|
|
5
|
-
"MessageType": "https://libp2p.github.io/js-libp2p/enums/_libp2p_kad-dht.MessageType.html",
|
|
6
|
-
"AddPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.AddPeerEvent.html",
|
|
7
|
-
".:AddPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.AddPeerEvent.html",
|
|
8
|
-
"DHTRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DHTRecord.html",
|
|
9
|
-
".:DHTRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DHTRecord.html",
|
|
10
|
-
"DialPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DialPeerEvent.html",
|
|
11
|
-
".:DialPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DialPeerEvent.html",
|
|
12
|
-
"DisjointPath": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DisjointPath.html",
|
|
13
|
-
".:DisjointPath": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.DisjointPath.html",
|
|
14
|
-
"FinalPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.FinalPeerEvent.html",
|
|
15
|
-
".:FinalPeerEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.FinalPeerEvent.html",
|
|
16
|
-
"KadDHT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHT.html",
|
|
17
|
-
".:KadDHT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHT.html",
|
|
18
|
-
"KadDHTComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHTComponents.html",
|
|
19
|
-
".:KadDHTComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHTComponents.html",
|
|
20
|
-
"KadDHTInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHTInit.html",
|
|
21
|
-
".:KadDHTInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.KadDHTInit.html",
|
|
22
|
-
"PathEndedEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PathEndedEvent.html",
|
|
23
|
-
".:PathEndedEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PathEndedEvent.html",
|
|
24
|
-
"PeerInfoMapper": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PeerInfoMapper.html",
|
|
25
|
-
".:PeerInfoMapper": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PeerInfoMapper.html",
|
|
26
|
-
"PeerResponseEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PeerResponseEvent.html",
|
|
27
|
-
".:PeerResponseEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.PeerResponseEvent.html",
|
|
28
|
-
"ProviderEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ProviderEvent.html",
|
|
29
|
-
".:ProviderEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ProviderEvent.html",
|
|
30
|
-
"ProvidersInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ProvidersInit.html",
|
|
31
|
-
".:ProvidersInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ProvidersInit.html",
|
|
32
|
-
"QueryErrorEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.QueryErrorEvent.html",
|
|
33
|
-
".:QueryErrorEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.QueryErrorEvent.html",
|
|
34
|
-
"ReProvideInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ReProvideInit.html",
|
|
35
|
-
".:ReProvideInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ReProvideInit.html",
|
|
36
|
-
"RoutingTable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.RoutingTable.html",
|
|
37
|
-
".:RoutingTable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.RoutingTable.html",
|
|
38
|
-
"SelectFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SelectFn.html",
|
|
39
|
-
".:SelectFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SelectFn.html",
|
|
40
|
-
"SendQueryEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SendQueryEvent.html",
|
|
41
|
-
".:SendQueryEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SendQueryEvent.html",
|
|
42
|
-
"SetModeOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SetModeOptions.html",
|
|
43
|
-
".:SetModeOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SetModeOptions.html",
|
|
44
|
-
"SingleKadDHT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SingleKadDHT.html",
|
|
45
|
-
".:SingleKadDHT": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.SingleKadDHT.html",
|
|
46
|
-
"ValidateFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ValidateFn.html",
|
|
47
|
-
".:ValidateFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ValidateFn.html",
|
|
48
|
-
"ValueEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ValueEvent.html",
|
|
49
|
-
".:ValueEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_kad-dht.ValueEvent.html",
|
|
50
|
-
"DHTProgressEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.DHTProgressEvents.html",
|
|
51
|
-
".:DHTProgressEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.DHTProgressEvents.html",
|
|
52
|
-
"MessageName": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.MessageName.html",
|
|
53
|
-
".:MessageName": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.MessageName.html",
|
|
54
|
-
"QueryEvent": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.QueryEvent.html",
|
|
55
|
-
".:QueryEvent": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.QueryEvent.html",
|
|
56
|
-
"Selectors": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.Selectors.html",
|
|
57
|
-
".:Selectors": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.Selectors.html",
|
|
58
|
-
"Validators": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.Validators.html",
|
|
59
|
-
".:Validators": "https://libp2p.github.io/js-libp2p/types/_libp2p_kad-dht.Validators.html",
|
|
60
|
-
"kadDHT": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.kadDHT.html",
|
|
61
|
-
".:kadDHT": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.kadDHT.html",
|
|
62
|
-
"passthroughMapper": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.passthroughMapper.html",
|
|
63
|
-
"removePrivateAddressesMapper": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.removePrivateAddressesMapper.html",
|
|
64
|
-
"removePublicAddressesMapper": "https://libp2p.github.io/js-libp2p/functions/_libp2p_kad-dht.removePublicAddressesMapper.html"
|
|
65
|
-
}
|