@libp2p/kad-dht 16.4.2 → 16.4.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.
|
@@ -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.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/tree/main/packages/kad-dht#readme",
|
|
@@ -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) {
|