@libp2p/kad-dht 16.2.0-f60bd85b0 → 16.2.2
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 +1 -4
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +3 -3
- package/dist/src/kad-dht.d.ts +5 -5
- package/dist/src/kad-dht.js +16 -16
- package/dist/src/message/utils.d.ts +1 -1
- package/dist/src/network.d.ts +2 -2
- package/dist/src/network.js +3 -3
- package/dist/src/peer-distance-list.d.ts +1 -1
- package/dist/src/peer-distance-list.js +1 -1
- package/dist/src/providers.js +1 -1
- package/dist/src/query/manager.d.ts +1 -1
- package/dist/src/query/manager.js +1 -1
- package/dist/src/query/query-path.js +1 -1
- package/dist/src/query-self.d.ts +2 -2
- package/dist/src/query-self.js +2 -2
- package/dist/src/reprovider.d.ts +2 -2
- package/dist/src/reprovider.js +2 -2
- package/dist/src/routing-table/closest-peers.d.ts +1 -1
- package/dist/src/routing-table/index.d.ts +2 -2
- package/dist/src/routing-table/index.js +2 -2
- package/dist/src/routing-table/k-bucket.js +1 -1
- package/dist/src/routing-table/refresh.d.ts +1 -1
- package/dist/src/routing-table/refresh.js +1 -1
- package/dist/src/rpc/index.d.ts +4 -4
- package/dist/src/rpc/index.js +6 -6
- package/dist/src/topology-listener.d.ts +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/typedoc-urls.json +65 -0
- package/package.json +13 -12
- package/src/index.ts +3 -3
- package/src/kad-dht.ts +17 -17
- package/src/message/utils.ts +1 -1
- package/src/network.ts +4 -4
- package/src/peer-distance-list.ts +2 -2
- package/src/providers.ts +1 -1
- package/src/query/manager.ts +2 -2
- package/src/query/query-path.ts +1 -1
- package/src/query-self.ts +4 -4
- package/src/reprovider.ts +4 -4
- package/src/routing-table/closest-peers.ts +1 -1
- package/src/routing-table/index.ts +3 -3
- package/src/routing-table/k-bucket.ts +1 -1
- package/src/routing-table/refresh.ts +2 -2
- package/src/rpc/index.ts +10 -10
- package/src/topology-listener.ts +1 -1
- package/src/utils.ts +1 -1
package/src/reprovider.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AdaptiveTimeout, Queue } from '@libp2p/utils'
|
|
2
2
|
import drain from 'it-drain'
|
|
3
3
|
import { TypedEventEmitter, setMaxListeners } from 'main-event'
|
|
4
|
-
import { PROVIDERS_VALIDITY, REPROVIDE_CONCURRENCY, REPROVIDE_INTERVAL, REPROVIDE_MAX_QUEUE_SIZE, REPROVIDE_THRESHOLD, REPROVIDE_TIMEOUT } from './constants.
|
|
5
|
-
import { parseProviderKey, readProviderTime, timeOperationMethod } from './utils.
|
|
6
|
-
import type { ContentRouting } from './content-routing/index.
|
|
7
|
-
import type { OperationMetrics } from './kad-dht.
|
|
4
|
+
import { PROVIDERS_VALIDITY, REPROVIDE_CONCURRENCY, REPROVIDE_INTERVAL, REPROVIDE_MAX_QUEUE_SIZE, REPROVIDE_THRESHOLD, REPROVIDE_TIMEOUT } from './constants.ts'
|
|
5
|
+
import { parseProviderKey, readProviderTime, timeOperationMethod } from './utils.ts'
|
|
6
|
+
import type { ContentRouting } from './content-routing/index.ts'
|
|
7
|
+
import type { OperationMetrics } from './kad-dht.ts'
|
|
8
8
|
import type { AbortOptions, ComponentLogger, Logger, Metrics, PeerId } from '@libp2p/interface'
|
|
9
9
|
import type { AddressManager } from '@libp2p/interface-internal'
|
|
10
10
|
import type { AdaptiveTimeoutInit } from '@libp2p/utils'
|
|
@@ -2,7 +2,7 @@ import { PeerSet } from '@libp2p/peer-collections'
|
|
|
2
2
|
import { KEEP_ALIVE_TAG } from '../constants.js'
|
|
3
3
|
import { PeerDistanceList } from '../peer-distance-list.js'
|
|
4
4
|
import { convertPeerId } from '../utils.js'
|
|
5
|
-
import type { RoutingTable } from './index.
|
|
5
|
+
import type { RoutingTable } from './index.ts'
|
|
6
6
|
import type { ComponentLogger, Logger, Metrics, PeerId, PeerStore, Startable } from '@libp2p/interface'
|
|
7
7
|
|
|
8
8
|
export const PEER_SET_SIZE = 20
|
|
@@ -4,9 +4,9 @@ import { anySignal } from 'any-signal'
|
|
|
4
4
|
import parallel from 'it-parallel'
|
|
5
5
|
import { TypedEventEmitter, setMaxListeners } from 'main-event'
|
|
6
6
|
import * as utils from '../utils.js'
|
|
7
|
-
import { ClosestPeers } from './closest-peers.
|
|
8
|
-
import { KBucket, isLeafBucket } from './k-bucket.
|
|
9
|
-
import type { Bucket, GetClosestPeersOptions, LeafBucket, Peer } from './k-bucket.
|
|
7
|
+
import { ClosestPeers } from './closest-peers.ts'
|
|
8
|
+
import { KBucket, isLeafBucket } from './k-bucket.ts'
|
|
9
|
+
import type { Bucket, GetClosestPeersOptions, LeafBucket, Peer } from './k-bucket.ts'
|
|
10
10
|
import type { Network } from '../network.js'
|
|
11
11
|
import type { AbortOptions, ComponentLogger, CounterGroup, Logger, Metric, Metrics, PeerId, PeerStore, Startable, Stream } from '@libp2p/interface'
|
|
12
12
|
import type { Ping } from '@libp2p/ping'
|
|
@@ -5,7 +5,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
|
5
5
|
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
|
|
6
6
|
import { PeerDistanceList } from '../peer-distance-list.js'
|
|
7
7
|
import { convertPeerId } from '../utils.js'
|
|
8
|
-
import { KBUCKET_SIZE, LAST_PING_THRESHOLD, PING_OLD_CONTACT_COUNT, PREFIX_LENGTH } from './index.
|
|
8
|
+
import { KBUCKET_SIZE, LAST_PING_THRESHOLD, PING_OLD_CONTACT_COUNT, PREFIX_LENGTH } from './index.ts'
|
|
9
9
|
import type { PeerId, AbortOptions, Metrics } from '@libp2p/interface'
|
|
10
10
|
|
|
11
11
|
export interface PingFunction {
|
|
@@ -7,8 +7,8 @@ import * as Digest from 'multiformats/hashes/digest'
|
|
|
7
7
|
import { sha256 } from 'multiformats/hashes/sha2'
|
|
8
8
|
import { xor as uint8ArrayXor } from 'uint8arrays/xor'
|
|
9
9
|
import { TABLE_REFRESH_INTERVAL, TABLE_REFRESH_QUERY_TIMEOUT } from '../constants.js'
|
|
10
|
-
import GENERATED_PREFIXES from './generated-prefix-list.
|
|
11
|
-
import type { RoutingTable } from './index.
|
|
10
|
+
import GENERATED_PREFIXES from './generated-prefix-list.ts'
|
|
11
|
+
import type { RoutingTable } from './index.ts'
|
|
12
12
|
import type { PeerRouting } from '../peer-routing/index.js'
|
|
13
13
|
import type { AbortOptions, ComponentLogger, Logger, PeerId } from '@libp2p/interface'
|
|
14
14
|
|
package/src/rpc/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { TimeoutError } from '@libp2p/interface'
|
|
2
2
|
import { pbStream } from '@libp2p/utils'
|
|
3
3
|
import { Message, MessageType } from '../message/dht.js'
|
|
4
|
-
import { AddProviderHandler } from './handlers/add-provider.
|
|
5
|
-
import { FindNodeHandler } from './handlers/find-node.
|
|
6
|
-
import { GetProvidersHandler } from './handlers/get-providers.
|
|
7
|
-
import { GetValueHandler } from './handlers/get-value.
|
|
8
|
-
import { PingHandler } from './handlers/ping.
|
|
9
|
-
import { PutValueHandler } from './handlers/put-value.
|
|
4
|
+
import { AddProviderHandler } from './handlers/add-provider.ts'
|
|
5
|
+
import { FindNodeHandler } from './handlers/find-node.ts'
|
|
6
|
+
import { GetProvidersHandler } from './handlers/get-providers.ts'
|
|
7
|
+
import { GetValueHandler } from './handlers/get-value.ts'
|
|
8
|
+
import { PingHandler } from './handlers/ping.ts'
|
|
9
|
+
import { PutValueHandler } from './handlers/put-value.ts'
|
|
10
10
|
import type { PeerInfoMapper, Validators } from '../index.js'
|
|
11
11
|
import type { PeerRouting } from '../peer-routing/index.js'
|
|
12
12
|
import type { Providers } from '../providers.js'
|
|
13
|
-
import type { FindNodeHandlerComponents } from './handlers/find-node.
|
|
14
|
-
import type { GetProvidersHandlerComponents } from './handlers/get-providers.
|
|
15
|
-
import type { GetValueHandlerComponents } from './handlers/get-value.
|
|
16
|
-
import type { PutValueHandlerComponents } from './handlers/put-value.
|
|
13
|
+
import type { FindNodeHandlerComponents } from './handlers/find-node.ts'
|
|
14
|
+
import type { GetProvidersHandlerComponents } from './handlers/get-providers.ts'
|
|
15
|
+
import type { GetValueHandlerComponents } from './handlers/get-value.ts'
|
|
16
|
+
import type { PutValueHandlerComponents } from './handlers/put-value.ts'
|
|
17
17
|
import type { RoutingTable } from '../routing-table/index.js'
|
|
18
18
|
import type { CounterGroup, Logger, Metrics, PeerId, MetricGroup, Connection, Stream } from '@libp2p/interface'
|
|
19
19
|
|
package/src/topology-listener.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -10,7 +10,7 @@ import * as varint from 'uint8-varint'
|
|
|
10
10
|
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
|
|
11
11
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
12
12
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
13
|
-
import type { Operation, OperationMetrics } from './kad-dht.
|
|
13
|
+
import type { Operation, OperationMetrics } from './kad-dht.ts'
|
|
14
14
|
import type { AbortOptions, PeerId, PeerInfo } from '@libp2p/interface'
|
|
15
15
|
|
|
16
16
|
// const IPNS_PREFIX = uint8ArrayFromString('/ipns/')
|