@libp2p/kad-dht 14.2.15 → 15.0.0-3833353bd
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 +20 -4
- package/dist/index.min.js +1 -1
- package/dist/src/index.d.ts +22 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +20 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/kad-dht.d.ts.map +1 -1
- package/dist/src/kad-dht.js +2 -1
- package/dist/src/kad-dht.js.map +1 -1
- package/dist/src/routing-table/index.d.ts +2 -0
- package/dist/src/routing-table/index.d.ts.map +1 -1
- package/dist/src/routing-table/index.js +6 -15
- package/dist/src/routing-table/index.js.map +1 -1
- package/dist/src/routing-table/k-bucket.d.ts +1 -2
- package/dist/src/routing-table/k-bucket.d.ts.map +1 -1
- package/dist/src/routing-table/k-bucket.js.map +1 -1
- package/package.json +13 -12
- package/src/index.ts +22 -4
- package/src/kad-dht.ts +2 -1
- package/src/routing-table/index.ts +8 -18
- package/src/routing-table/k-bucket.ts +1 -2
- package/dist/typedoc-urls.json +0 -59
package/README.md
CHANGED
|
@@ -34,12 +34,16 @@ The Kademlia DHT allow for several operations such as finding peers, searching f
|
|
|
34
34
|
import { kadDHT } from '@libp2p/kad-dht'
|
|
35
35
|
import { createLibp2p } from 'libp2p'
|
|
36
36
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
37
|
+
import { ping } from '@libp2p/ping'
|
|
38
|
+
import { identify } from '@libp2p/identify'
|
|
37
39
|
|
|
38
40
|
const node = await createLibp2p({
|
|
39
41
|
services: {
|
|
40
42
|
dht: kadDHT({
|
|
41
43
|
// DHT options
|
|
42
|
-
})
|
|
44
|
+
}),
|
|
45
|
+
ping: ping(),
|
|
46
|
+
identify: identify()
|
|
43
47
|
}
|
|
44
48
|
})
|
|
45
49
|
|
|
@@ -59,13 +63,17 @@ If you are trying to access content on the public internet, this is the implemen
|
|
|
59
63
|
import { kadDHT, removePrivateAddressesMapper } from '@libp2p/kad-dht'
|
|
60
64
|
import { createLibp2p } from 'libp2p'
|
|
61
65
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
66
|
+
import { ping } from '@libp2p/ping'
|
|
67
|
+
import { identify } from '@libp2p/identify'
|
|
62
68
|
|
|
63
69
|
const node = await createLibp2p({
|
|
64
70
|
services: {
|
|
65
71
|
aminoDHT: kadDHT({
|
|
66
72
|
protocol: '/ipfs/kad/1.0.0',
|
|
67
73
|
peerInfoMapper: removePrivateAddressesMapper
|
|
68
|
-
})
|
|
74
|
+
}),
|
|
75
|
+
ping: ping(),
|
|
76
|
+
identify: identify()
|
|
69
77
|
}
|
|
70
78
|
})
|
|
71
79
|
|
|
@@ -85,6 +93,8 @@ This is for use when peers are on the local area network.
|
|
|
85
93
|
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht'
|
|
86
94
|
import { createLibp2p } from 'libp2p'
|
|
87
95
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
96
|
+
import { ping } from '@libp2p/ping'
|
|
97
|
+
import { identify } from '@libp2p/identify'
|
|
88
98
|
|
|
89
99
|
const node = await createLibp2p({
|
|
90
100
|
services: {
|
|
@@ -92,7 +102,9 @@ const node = await createLibp2p({
|
|
|
92
102
|
protocol: '/ipfs/lan/kad/1.0.0',
|
|
93
103
|
peerInfoMapper: removePublicAddressesMapper,
|
|
94
104
|
clientMode: false
|
|
95
|
-
})
|
|
105
|
+
}),
|
|
106
|
+
ping: ping(),
|
|
107
|
+
identify: identify()
|
|
96
108
|
}
|
|
97
109
|
})
|
|
98
110
|
|
|
@@ -111,6 +123,8 @@ log prefixes to ensure that data is kept separate for each instance.
|
|
|
111
123
|
import { kadDHT, removePublicAddressesMapper, removePrivateAddressesMapper } from '@libp2p/kad-dht'
|
|
112
124
|
import { createLibp2p } from 'libp2p'
|
|
113
125
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
126
|
+
import { ping } from '@libp2p/ping'
|
|
127
|
+
import { identify } from '@libp2p/identify'
|
|
114
128
|
|
|
115
129
|
const node = await createLibp2p({
|
|
116
130
|
services: {
|
|
@@ -128,7 +142,9 @@ const node = await createLibp2p({
|
|
|
128
142
|
logPrefix: 'libp2p:dht-amino',
|
|
129
143
|
datastorePrefix: '/dht-amino',
|
|
130
144
|
metricsPrefix: 'libp2p_dht_amino'
|
|
131
|
-
})
|
|
145
|
+
}),
|
|
146
|
+
ping: ping(),
|
|
147
|
+
identify: identify()
|
|
132
148
|
}
|
|
133
149
|
})
|
|
134
150
|
|