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