@libp2p/kad-dht 1.0.16 → 2.0.0
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/README.md +18 -22
- package/dist/src/content-fetching/index.d.ts +6 -6
- package/dist/src/content-fetching/index.d.ts.map +1 -1
- 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 +3 -3
- package/dist/src/content-routing/index.d.ts.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/dual-kad-dht.d.ts +11 -11
- package/dist/src/dual-kad-dht.d.ts.map +1 -1
- package/dist/src/dual-kad-dht.js +2 -2
- package/dist/src/dual-kad-dht.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/kad-dht.d.ts +12 -12
- package/dist/src/kad-dht.d.ts.map +1 -1
- package/dist/src/kad-dht.js +2 -2
- 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 +5 -5
- 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 +9 -9
- 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 +2 -2
- package/dist/src/providers.d.ts.map +1 -1
- package/dist/src/providers.js +1 -1
- package/dist/src/providers.js.map +1 -1
- package/dist/src/query/events.d.ts +3 -3
- package/dist/src/query/events.d.ts.map +1 -1
- package/dist/src/query/manager.d.ts +4 -4
- package/dist/src/query/manager.d.ts.map +1 -1
- package/dist/src/query/manager.js +1 -1
- package/dist/src/query/manager.js.map +1 -1
- package/dist/src/query/query-path.d.ts +2 -2
- package/dist/src/query/query-path.d.ts.map +1 -1
- package/dist/src/query/types.d.ts +2 -2
- package/dist/src/query/types.d.ts.map +1 -1
- package/dist/src/query-self.d.ts +1 -1
- 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/routing-table/index.d.ts +2 -2
- 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/refresh.d.ts +2 -2
- package/dist/src/routing-table/refresh.d.ts.map +1 -1
- package/dist/src/rpc/handlers/add-provider.d.ts +2 -2
- package/dist/src/rpc/handlers/add-provider.d.ts.map +1 -1
- package/dist/src/rpc/handlers/find-node.d.ts +3 -3
- package/dist/src/rpc/handlers/find-node.d.ts.map +1 -1
- package/dist/src/rpc/handlers/find-node.js +1 -1
- package/dist/src/rpc/handlers/find-node.js.map +1 -1
- package/dist/src/rpc/handlers/get-providers.d.ts +3 -3
- 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 +2 -2
- 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 +2 -2
- package/dist/src/rpc/handlers/ping.d.ts.map +1 -1
- package/dist/src/rpc/handlers/put-value.d.ts +3 -3
- 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 +4 -4
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/topology-listener.d.ts +2 -2
- 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 +2 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +20 -9
- package/src/content-fetching/index.ts +2 -2
- package/src/content-routing/index.ts +3 -3
- package/src/dual-kad-dht.ts +5 -5
- package/src/index.ts +1 -1
- package/src/kad-dht.ts +6 -6
- package/src/message/index.ts +1 -1
- package/src/network.ts +4 -4
- package/src/peer-list/index.ts +1 -1
- package/src/peer-list/peer-distance-list.ts +1 -1
- package/src/peer-routing/index.ts +4 -4
- package/src/providers.ts +2 -2
- package/src/query/events.ts +3 -3
- package/src/query/manager.ts +3 -3
- package/src/query/query-path.ts +2 -2
- package/src/query/types.ts +2 -2
- package/src/query-self.ts +1 -1
- package/src/routing-table/index.ts +2 -2
- package/src/routing-table/refresh.ts +1 -1
- package/src/rpc/handlers/add-provider.ts +2 -2
- package/src/rpc/handlers/find-node.ts +4 -4
- package/src/rpc/handlers/get-providers.ts +3 -3
- package/src/rpc/handlers/get-value.ts +2 -2
- package/src/rpc/handlers/ping.ts +2 -2
- package/src/rpc/handlers/put-value.ts +3 -3
- package/src/rpc/index.ts +4 -4
- package/src/topology-listener.ts +2 -2
- package/src/utils.ts +2 -2
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
import { bufferToRecordKey, isPublicKeyKey, fromPublicKeyKey } from '../../utils.js'
|
|
8
8
|
import { logger } from '@libp2p/logger'
|
|
9
9
|
import type { DHTMessageHandler } from '../index.js'
|
|
10
|
-
import type { PeerId } from '@libp2p/
|
|
10
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
11
11
|
import type { PeerRouting } from '../../peer-routing/index.js'
|
|
12
|
-
import { Components, Initializable } from '@libp2p/
|
|
12
|
+
import { Components, Initializable } from '@libp2p/components'
|
|
13
13
|
|
|
14
14
|
const log = logger('libp2p:kad-dht:rpc:handlers:get-value')
|
|
15
15
|
|
package/src/rpc/handlers/ping.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { logger } from '@libp2p/logger'
|
|
2
2
|
import type { Message } from '../../message/index.js'
|
|
3
3
|
import type { DHTMessageHandler } from '../index.js'
|
|
4
|
-
import type { PeerId } from '@libp2p/
|
|
5
|
-
import type { Initializable } from '@libp2p/
|
|
4
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
5
|
+
import type { Initializable } from '@libp2p/components'
|
|
6
6
|
|
|
7
7
|
const log = logger('libp2p:kad-dht:rpc:handlers:ping')
|
|
8
8
|
|
|
@@ -3,10 +3,10 @@ import errcode from 'err-code'
|
|
|
3
3
|
import { verifyRecord } from '@libp2p/record/validators'
|
|
4
4
|
import { Logger, logger } from '@libp2p/logger'
|
|
5
5
|
import type { DHTMessageHandler } from '../index.js'
|
|
6
|
-
import type { Validators } from '@libp2p/
|
|
7
|
-
import type { PeerId } from '@libp2p/
|
|
6
|
+
import type { Validators } from '@libp2p/interface-dht'
|
|
7
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
8
8
|
import type { Message } from '../../message/index.js'
|
|
9
|
-
import { Components, Initializable } from '@libp2p/
|
|
9
|
+
import { Components, Initializable } from '@libp2p/components'
|
|
10
10
|
|
|
11
11
|
export interface PutValueHandlerInit {
|
|
12
12
|
validators: Validators
|
package/src/rpc/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { pipe } from 'it-pipe'
|
|
|
2
2
|
import * as lp from 'it-length-prefixed'
|
|
3
3
|
import { Logger, logger } from '@libp2p/logger'
|
|
4
4
|
import type { RoutingTable } from '../routing-table'
|
|
5
|
-
import type { PeerId } from '@libp2p/
|
|
5
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
6
6
|
import { Message, MESSAGE_TYPE } from '../message/index.js'
|
|
7
7
|
import { AddProviderHandler } from './handlers/add-provider.js'
|
|
8
8
|
import { FindNodeHandler } from './handlers/find-node.js'
|
|
@@ -10,11 +10,11 @@ import { GetProvidersHandler } from './handlers/get-providers.js'
|
|
|
10
10
|
import { GetValueHandler } from './handlers/get-value.js'
|
|
11
11
|
import { PingHandler } from './handlers/ping.js'
|
|
12
12
|
import { PutValueHandler } from './handlers/put-value.js'
|
|
13
|
-
import type { IncomingStreamData } from '@libp2p/
|
|
13
|
+
import type { IncomingStreamData } from '@libp2p/interface-registrar'
|
|
14
14
|
import type { Providers } from '../providers'
|
|
15
15
|
import type { PeerRouting } from '../peer-routing'
|
|
16
|
-
import type { Validators } from '@libp2p/
|
|
17
|
-
import type { Components, Initializable } from '@libp2p/
|
|
16
|
+
import type { Validators } from '@libp2p/interface-dht'
|
|
17
|
+
import type { Components, Initializable } from '@libp2p/components'
|
|
18
18
|
|
|
19
19
|
export interface DHTMessageHandler extends Initializable {
|
|
20
20
|
handle: (peerId: PeerId, msg: Message) => Promise<Message | undefined>
|
package/src/topology-listener.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
|
3
3
|
import { logger } from '@libp2p/logger'
|
|
4
4
|
import type { Logger } from '@libp2p/logger'
|
|
5
5
|
import type { Startable } from '@libp2p/interfaces/startable'
|
|
6
|
-
import type { PeerId } from '@libp2p/
|
|
7
|
-
import { Components, Initializable } from '@libp2p/
|
|
6
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
7
|
+
import { Components, Initializable } from '@libp2p/components'
|
|
8
8
|
|
|
9
9
|
export interface TopologyListenerInit {
|
|
10
10
|
protocol: string
|
package/src/utils.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
|
5
5
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
6
6
|
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
|
|
7
7
|
import isPrivateIp from 'private-ip'
|
|
8
|
-
import type { PeerInfo } from '@libp2p/
|
|
8
|
+
import type { PeerInfo } from '@libp2p/interface-peer-info'
|
|
9
9
|
import { peerIdFromBytes } from '@libp2p/peer-id'
|
|
10
|
-
import type { PeerId } from '@libp2p/
|
|
10
|
+
import type { PeerId } from '@libp2p/interface-peer-id'
|
|
11
11
|
import { RECORD_KEY_PREFIX } from './constants.js'
|
|
12
12
|
|
|
13
13
|
// const IPNS_PREFIX = uint8ArrayFromString('/ipns/')
|