@libp2p/kad-dht 16.0.0 → 16.0.1-334f91bdc
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 +9 -10
- package/dist/index.min.js.map +4 -4
- package/dist/src/content-fetching/index.js +2 -2
- package/dist/src/content-fetching/index.js.map +1 -1
- package/dist/src/content-routing/index.js +1 -1
- package/dist/src/content-routing/index.js.map +1 -1
- package/dist/src/kad-dht.js +4 -4
- package/dist/src/kad-dht.js.map +1 -1
- package/dist/src/network.js +2 -2
- package/dist/src/network.js.map +1 -1
- package/dist/src/query/manager.js +1 -1
- package/dist/src/query/manager.js.map +1 -1
- package/dist/src/query-self.js +3 -3
- package/dist/src/query-self.js.map +1 -1
- package/dist/src/reprovider.js +1 -1
- package/dist/src/routing-table/refresh.js +4 -4
- package/dist/src/routing-table/refresh.js.map +1 -1
- package/dist/src/rpc/handlers/put-value.d.ts.map +1 -1
- package/dist/src/rpc/handlers/put-value.js +2 -3
- package/dist/src/rpc/handlers/put-value.js.map +1 -1
- package/package.json +12 -12
- package/src/content-fetching/index.ts +2 -2
- package/src/content-routing/index.ts +1 -1
- package/src/kad-dht.ts +4 -4
- package/src/network.ts +2 -2
- package/src/query/manager.ts +1 -1
- package/src/query-self.ts +3 -3
- package/src/reprovider.ts +1 -1
- package/src/routing-table/refresh.ts +4 -4
- package/src/rpc/handlers/put-value.ts +2 -4
- package/dist/typedoc-urls.json +0 -65
package/src/query/manager.ts
CHANGED
|
@@ -217,7 +217,7 @@ export class QueryManager implements Startable {
|
|
|
217
217
|
// Execute the query along each disjoint path and yield their results as they become available
|
|
218
218
|
for await (const event of merge(...paths)) {
|
|
219
219
|
if (event.name === 'QUERY_ERROR') {
|
|
220
|
-
log.error('query error', event.error)
|
|
220
|
+
log.error('query error - %e', event.error)
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
if (event.name === 'PEER_RESPONSE') {
|
package/src/query-self.ts
CHANGED
|
@@ -76,7 +76,7 @@ export class QuerySelf implements Startable {
|
|
|
76
76
|
this.timeoutId = setTimeout(() => {
|
|
77
77
|
this.querySelf()
|
|
78
78
|
.catch(err => {
|
|
79
|
-
this.log.error('error running self-query', err)
|
|
79
|
+
this.log.error('error running self-query - %e', err)
|
|
80
80
|
})
|
|
81
81
|
}, this.initialInterval)
|
|
82
82
|
}
|
|
@@ -146,7 +146,7 @@ export class QuerySelf implements Startable {
|
|
|
146
146
|
}
|
|
147
147
|
}))
|
|
148
148
|
} catch (err: any) {
|
|
149
|
-
this.log.error('self-query error', err)
|
|
149
|
+
this.log.error('self-query error - %e', err)
|
|
150
150
|
} finally {
|
|
151
151
|
signal.clear()
|
|
152
152
|
|
|
@@ -167,7 +167,7 @@ export class QuerySelf implements Startable {
|
|
|
167
167
|
this.timeoutId = setTimeout(() => {
|
|
168
168
|
this.querySelf()
|
|
169
169
|
.catch(err => {
|
|
170
|
-
this.log.error('error running self-query', err)
|
|
170
|
+
this.log.error('error running self-query - %e', err)
|
|
171
171
|
})
|
|
172
172
|
}, this.interval)
|
|
173
173
|
}
|
package/src/reprovider.ts
CHANGED
|
@@ -152,7 +152,7 @@ export class Reprovider extends TypedEventEmitter<ReprovideEvents> {
|
|
|
152
152
|
})
|
|
153
153
|
}
|
|
154
154
|
} catch (err: any) {
|
|
155
|
-
this.log.error('error processing datastore key %s - %
|
|
155
|
+
this.log.error('error processing datastore key %s - %s', entry.key, err.message)
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -107,16 +107,16 @@ export class RoutingTableRefresh {
|
|
|
107
107
|
try {
|
|
108
108
|
await this._refreshCommonPrefixLength(n, lastRefresh, force, options)
|
|
109
109
|
} catch (err: any) {
|
|
110
|
-
this.log.error(err)
|
|
110
|
+
this.log.error('failed to refresh entries with common prefix length %d - %e', n, err)
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
} catch (err: any) {
|
|
115
|
-
this.log.error(err)
|
|
115
|
+
this.log.error('failed to refresh entries with common prefix length - %e', err)
|
|
116
116
|
}
|
|
117
117
|
})
|
|
118
118
|
).catch(err => {
|
|
119
|
-
this.log.error(err)
|
|
119
|
+
this.log.error('failed to refresh table - %e', err)
|
|
120
120
|
}).then(() => {
|
|
121
121
|
this.refreshTimeoutId = setTimeout(this.refreshTable, this.refreshInterval)
|
|
122
122
|
|
|
@@ -124,7 +124,7 @@ export class RoutingTableRefresh {
|
|
|
124
124
|
this.refreshTimeoutId.unref()
|
|
125
125
|
}
|
|
126
126
|
}).catch(err => {
|
|
127
|
-
this.log.error(err)
|
|
127
|
+
this.log.error('failed to set refresh timeout - %e', err)
|
|
128
128
|
})
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -39,10 +39,8 @@ export class PutValueHandler implements DHTMessageHandler {
|
|
|
39
39
|
this.log('%p asked us to store value for key %b', peerId, key)
|
|
40
40
|
|
|
41
41
|
if (msg.record == null) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.log.error(errMsg)
|
|
45
|
-
throw new InvalidMessageError(errMsg)
|
|
42
|
+
this.log.error('empty record from %p', peerId)
|
|
43
|
+
throw new InvalidMessageError(`Empty record from: ${peerId}`)
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
try {
|
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
|
-
}
|