@libp2p/kad-dht 10.0.15-e2267d437 → 11.0.0-06e6d235f
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 +19 -19
- package/dist/src/content-fetching/index.js +1 -1
- package/dist/src/content-fetching/index.js.map +1 -1
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/content-routing/index.js.map +1 -1
- package/dist/src/dual-kad-dht.d.ts +5 -8
- package/dist/src/dual-kad-dht.d.ts.map +1 -1
- package/dist/src/dual-kad-dht.js +4 -8
- package/dist/src/dual-kad-dht.js.map +1 -1
- package/dist/src/index.d.ts +2 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/kad-dht.d.ts +2 -4
- package/dist/src/kad-dht.d.ts.map +1 -1
- package/dist/src/kad-dht.js +1 -1
- package/dist/src/kad-dht.js.map +1 -1
- package/dist/src/message/index.d.ts +1 -1
- package/dist/src/message/index.d.ts.map +1 -1
- package/dist/src/network.d.ts +2 -6
- package/dist/src/network.d.ts.map +1 -1
- package/dist/src/network.js +1 -1
- package/dist/src/network.js.map +1 -1
- package/dist/src/peer-list/index.d.ts +1 -1
- package/dist/src/peer-list/index.d.ts.map +1 -1
- package/dist/src/peer-list/peer-distance-list.d.ts +1 -1
- package/dist/src/peer-list/peer-distance-list.d.ts.map +1 -1
- package/dist/src/peer-routing/index.d.ts +1 -3
- package/dist/src/peer-routing/index.d.ts.map +1 -1
- package/dist/src/peer-routing/index.js +1 -1
- package/dist/src/peer-routing/index.js.map +1 -1
- package/dist/src/providers.d.ts +1 -3
- package/dist/src/providers.d.ts.map +1 -1
- package/dist/src/providers.js.map +1 -1
- package/dist/src/query/events.d.ts +1 -2
- package/dist/src/query/events.d.ts.map +1 -1
- package/dist/src/query/events.js +1 -1
- package/dist/src/query/events.js.map +1 -1
- package/dist/src/query/manager.d.ts +1 -4
- package/dist/src/query/manager.d.ts.map +1 -1
- package/dist/src/query/manager.js +1 -2
- package/dist/src/query/manager.js.map +1 -1
- package/dist/src/query/query-path.d.ts +1 -3
- package/dist/src/query/query-path.d.ts.map +1 -1
- package/dist/src/query/query-path.js.map +1 -1
- package/dist/src/query/types.d.ts +1 -1
- package/dist/src/query/types.d.ts.map +1 -1
- package/dist/src/query/utils.d.ts +1 -2
- package/dist/src/query/utils.d.ts.map +1 -1
- package/dist/src/query/utils.js +1 -1
- package/dist/src/query/utils.js.map +1 -1
- package/dist/src/query-self.d.ts +1 -3
- package/dist/src/query-self.d.ts.map +1 -1
- package/dist/src/query-self.js +1 -1
- package/dist/src/query-self.js.map +1 -1
- package/dist/src/record/selectors.js +1 -1
- package/dist/src/record/selectors.js.map +1 -1
- package/dist/src/record/validators.js +1 -1
- package/dist/src/record/validators.js.map +1 -1
- package/dist/src/routing-table/index.d.ts +3 -7
- package/dist/src/routing-table/index.d.ts.map +1 -1
- package/dist/src/routing-table/index.js +1 -1
- package/dist/src/routing-table/index.js.map +1 -1
- package/dist/src/routing-table/k-bucket.d.ts +2 -2
- package/dist/src/routing-table/k-bucket.d.ts.map +1 -1
- package/dist/src/routing-table/k-bucket.js +1 -1
- package/dist/src/routing-table/k-bucket.js.map +1 -1
- package/dist/src/routing-table/refresh.d.ts +1 -2
- package/dist/src/routing-table/refresh.d.ts.map +1 -1
- package/dist/src/routing-table/refresh.js.map +1 -1
- package/dist/src/rpc/handlers/add-provider.d.ts +1 -2
- package/dist/src/rpc/handlers/add-provider.d.ts.map +1 -1
- package/dist/src/rpc/handlers/add-provider.js +1 -1
- package/dist/src/rpc/handlers/add-provider.js.map +1 -1
- package/dist/src/rpc/handlers/find-node.d.ts +2 -3
- package/dist/src/rpc/handlers/find-node.d.ts.map +1 -1
- package/dist/src/rpc/handlers/find-node.js.map +1 -1
- package/dist/src/rpc/handlers/get-providers.d.ts +1 -4
- package/dist/src/rpc/handlers/get-providers.d.ts.map +1 -1
- package/dist/src/rpc/handlers/get-providers.js +1 -1
- package/dist/src/rpc/handlers/get-providers.js.map +1 -1
- package/dist/src/rpc/handlers/get-value.d.ts +1 -3
- package/dist/src/rpc/handlers/get-value.d.ts.map +1 -1
- package/dist/src/rpc/handlers/get-value.js +1 -1
- package/dist/src/rpc/handlers/get-value.js.map +1 -1
- package/dist/src/rpc/handlers/ping.d.ts +1 -2
- package/dist/src/rpc/handlers/ping.d.ts.map +1 -1
- package/dist/src/rpc/handlers/ping.js.map +1 -1
- package/dist/src/rpc/handlers/put-value.d.ts +1 -2
- package/dist/src/rpc/handlers/put-value.d.ts.map +1 -1
- package/dist/src/rpc/handlers/put-value.js +1 -1
- package/dist/src/rpc/handlers/put-value.js.map +1 -1
- package/dist/src/rpc/index.d.ts +2 -2
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/src/topology-listener.d.ts +2 -3
- package/dist/src/topology-listener.d.ts.map +1 -1
- package/dist/src/topology-listener.js +1 -1
- package/dist/src/topology-listener.js.map +1 -1
- package/dist/src/utils.d.ts +1 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js.map +1 -1
- package/package.json +15 -11
- package/src/content-fetching/index.ts +1 -1
- package/src/content-routing/index.ts +1 -2
- package/src/dual-kad-dht.ts +5 -11
- package/src/index.ts +2 -9
- package/src/kad-dht.ts +2 -5
- package/src/message/index.ts +1 -1
- package/src/network.ts +2 -6
- package/src/peer-list/index.ts +1 -1
- package/src/peer-list/peer-distance-list.ts +1 -1
- package/src/peer-routing/index.ts +2 -5
- package/src/providers.ts +1 -3
- package/src/query/events.ts +2 -3
- package/src/query/manager.ts +2 -6
- package/src/query/query-path.ts +1 -3
- package/src/query/types.ts +1 -1
- package/src/query/utils.ts +2 -3
- package/src/query-self.ts +2 -4
- package/src/record/selectors.ts +1 -1
- package/src/record/validators.ts +1 -1
- package/src/routing-table/index.ts +3 -7
- package/src/routing-table/k-bucket.ts +2 -2
- package/src/routing-table/refresh.ts +1 -2
- package/src/rpc/handlers/add-provider.ts +2 -3
- package/src/rpc/handlers/find-node.ts +2 -4
- package/src/rpc/handlers/get-providers.ts +2 -5
- package/src/rpc/handlers/get-value.ts +2 -4
- package/src/rpc/handlers/ping.ts +1 -2
- package/src/rpc/handlers/put-value.ts +2 -3
- package/src/rpc/index.ts +2 -3
- package/src/topology-listener.ts +2 -4
- package/src/utils.ts +1 -2
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { TypedEventEmitter } from '@libp2p/interface
|
|
1
|
+
import { TypedEventEmitter } from '@libp2p/interface'
|
|
2
2
|
import { PeerSet } from '@libp2p/peer-collections'
|
|
3
3
|
import Queue from 'p-queue'
|
|
4
4
|
import * as utils from '../utils.js'
|
|
5
5
|
import { KBucket, type PingEventDetails } from './k-bucket.js'
|
|
6
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
7
|
-
import type {
|
|
8
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
9
|
-
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
10
|
-
import type { Startable } from '@libp2p/interface/startable'
|
|
11
|
-
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
|
|
6
|
+
import type { ComponentLogger, Logger, Metric, Metrics, PeerId, PeerStore, Startable } from '@libp2p/interface'
|
|
7
|
+
import type { ConnectionManager } from '@libp2p/interface-internal'
|
|
12
8
|
|
|
13
9
|
export const KAD_CLOSE_TAG_NAME = 'kad-close'
|
|
14
10
|
export const KAD_CLOSE_TAG_VALUE = 50
|
|
@@ -27,8 +27,8 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
27
27
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
import { TypedEventEmitter } from '@libp2p/interface
|
|
31
|
-
import type { PeerId } from '@libp2p/interface
|
|
30
|
+
import { TypedEventEmitter } from '@libp2p/interface'
|
|
31
|
+
import type { PeerId } from '@libp2p/interface'
|
|
32
32
|
|
|
33
33
|
function arrayEquals (array1: Uint8Array, array2: Uint8Array): boolean {
|
|
34
34
|
if (array1 === array2) {
|
|
@@ -7,8 +7,7 @@ import { TABLE_REFRESH_INTERVAL, TABLE_REFRESH_QUERY_TIMEOUT } from '../constant
|
|
|
7
7
|
import GENERATED_PREFIXES from './generated-prefix-list.js'
|
|
8
8
|
import type { RoutingTable } from './index.js'
|
|
9
9
|
import type { PeerRouting } from '../peer-routing/index.js'
|
|
10
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
11
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
10
|
+
import type { ComponentLogger, Logger, PeerId } from '@libp2p/interface'
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Cannot generate random KadIds longer than this + 1
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CodeError } from '@libp2p/interface
|
|
1
|
+
import { CodeError } from '@libp2p/interface'
|
|
2
2
|
import { CID } from 'multiformats/cid'
|
|
3
3
|
import type { Message } from '../../message/index.js'
|
|
4
4
|
import type { Providers } from '../../providers'
|
|
5
5
|
import type { DHTMessageHandler } from '../index.js'
|
|
6
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
7
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
6
|
+
import type { ComponentLogger, Logger, PeerId } from '@libp2p/interface'
|
|
8
7
|
|
|
9
8
|
export interface AddProviderComponents {
|
|
10
9
|
logger: ComponentLogger
|
|
@@ -7,10 +7,8 @@ import {
|
|
|
7
7
|
} from '../../utils.js'
|
|
8
8
|
import type { PeerRouting } from '../../peer-routing/index.js'
|
|
9
9
|
import type { DHTMessageHandler } from '../index.js'
|
|
10
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
11
|
-
import type {
|
|
12
|
-
import type { PeerInfo } from '@libp2p/interface/peer-info'
|
|
13
|
-
import type { AddressManager } from '@libp2p/interface-internal/address-manager'
|
|
10
|
+
import type { ComponentLogger, Logger, PeerId, PeerInfo } from '@libp2p/interface'
|
|
11
|
+
import type { AddressManager } from '@libp2p/interface-internal'
|
|
14
12
|
|
|
15
13
|
export interface FindNodeHandlerInit {
|
|
16
14
|
peerRouting: PeerRouting
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeError } from '@libp2p/interface
|
|
1
|
+
import { CodeError } from '@libp2p/interface'
|
|
2
2
|
import { CID } from 'multiformats/cid'
|
|
3
3
|
import { Message } from '../../message/index.js'
|
|
4
4
|
import {
|
|
@@ -8,10 +8,7 @@ import {
|
|
|
8
8
|
import type { PeerRouting } from '../../peer-routing/index.js'
|
|
9
9
|
import type { Providers } from '../../providers.js'
|
|
10
10
|
import type { DHTMessageHandler } from '../index.js'
|
|
11
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
12
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
13
|
-
import type { PeerInfo } from '@libp2p/interface/peer-info'
|
|
14
|
-
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
11
|
+
import type { ComponentLogger, Logger, PeerId, PeerInfo, PeerStore } from '@libp2p/interface'
|
|
15
12
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
16
13
|
|
|
17
14
|
export interface GetProvidersHandlerInit {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeError } from '@libp2p/interface
|
|
1
|
+
import { CodeError } from '@libp2p/interface'
|
|
2
2
|
import {
|
|
3
3
|
MAX_RECORD_AGE
|
|
4
4
|
} from '../../constants.js'
|
|
@@ -7,9 +7,7 @@ import { Libp2pRecord } from '../../record/index.js'
|
|
|
7
7
|
import { bufferToRecordKey, isPublicKeyKey, fromPublicKeyKey } from '../../utils.js'
|
|
8
8
|
import type { PeerRouting } from '../../peer-routing/index.js'
|
|
9
9
|
import type { DHTMessageHandler } from '../index.js'
|
|
10
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
11
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
12
|
-
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
10
|
+
import type { ComponentLogger, Logger, PeerId, PeerStore } from '@libp2p/interface'
|
|
13
11
|
import type { Datastore } from 'interface-datastore'
|
|
14
12
|
|
|
15
13
|
export interface GetValueHandlerInit {
|
package/src/rpc/handlers/ping.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Message } from '../../message/index.js'
|
|
2
2
|
import type { DHTMessageHandler } from '../index.js'
|
|
3
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
4
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
3
|
+
import type { ComponentLogger, Logger, PeerId } from '@libp2p/interface'
|
|
5
4
|
|
|
6
5
|
export interface PingComponents {
|
|
7
6
|
logger: ComponentLogger
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { CodeError } from '@libp2p/interface
|
|
1
|
+
import { CodeError } from '@libp2p/interface'
|
|
2
2
|
import { verifyRecord } from '../../record/validators.js'
|
|
3
3
|
import { bufferToRecordKey } from '../../utils.js'
|
|
4
4
|
import type { Validators } from '../../index.js'
|
|
5
5
|
import type { Message } from '../../message/index.js'
|
|
6
6
|
import type { DHTMessageHandler } from '../index.js'
|
|
7
|
-
import type { ComponentLogger, Logger } from '@libp2p/interface'
|
|
8
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
7
|
+
import type { ComponentLogger, Logger, PeerId } from '@libp2p/interface'
|
|
9
8
|
import type { Datastore } from 'interface-datastore'
|
|
10
9
|
|
|
11
10
|
export interface PutValueHandlerInit {
|
package/src/rpc/index.ts
CHANGED
|
@@ -11,9 +11,8 @@ import type { Validators } from '../index.js'
|
|
|
11
11
|
import type { PeerRouting } from '../peer-routing'
|
|
12
12
|
import type { Providers } from '../providers'
|
|
13
13
|
import type { RoutingTable } from '../routing-table'
|
|
14
|
-
import type { Logger } from '@libp2p/interface'
|
|
15
|
-
import type {
|
|
16
|
-
import type { IncomingStreamData } from '@libp2p/interface-internal/registrar'
|
|
14
|
+
import type { Logger, PeerId } from '@libp2p/interface'
|
|
15
|
+
import type { IncomingStreamData } from '@libp2p/interface-internal'
|
|
17
16
|
|
|
18
17
|
export interface DHTMessageHandler {
|
|
19
18
|
handle(peerId: PeerId, msg: Message): Promise<Message | undefined>
|
package/src/topology-listener.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { CustomEvent, TypedEventEmitter } from '@libp2p/interface
|
|
1
|
+
import { CustomEvent, TypedEventEmitter } from '@libp2p/interface'
|
|
2
2
|
import type { KadDHTComponents } from '.'
|
|
3
|
-
import type { Logger } from '@libp2p/interface'
|
|
4
|
-
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
5
|
-
import type { Startable } from '@libp2p/interface/startable'
|
|
3
|
+
import type { Logger, PeerId, Startable } from '@libp2p/interface'
|
|
6
4
|
|
|
7
5
|
export interface TopologyListenerInit {
|
|
8
6
|
protocol: string
|
package/src/utils.ts
CHANGED
|
@@ -7,8 +7,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
|
7
7
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
8
8
|
import { RECORD_KEY_PREFIX } from './constants.js'
|
|
9
9
|
import { Libp2pRecord } from './record/index.js'
|
|
10
|
-
import type { PeerId } from '@libp2p/interface
|
|
11
|
-
import type { PeerInfo } from '@libp2p/interface/peer-info'
|
|
10
|
+
import type { PeerId, PeerInfo } from '@libp2p/interface'
|
|
12
11
|
|
|
13
12
|
// const IPNS_PREFIX = uint8ArrayFromString('/ipns/')
|
|
14
13
|
const PK_PREFIX = uint8ArrayFromString('/pk/')
|