@libp2p/bootstrap 1.0.1 → 1.0.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/package.json +3 -3
- package/src/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/bootstrap",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p-bootstrap#readme",
|
|
@@ -133,14 +133,14 @@
|
|
|
133
133
|
"release": "semantic-release"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
+
"@libp2p/interfaces": "^1.3.18",
|
|
136
137
|
"@libp2p/logger": "^1.1.2",
|
|
137
138
|
"@libp2p/peer-id": "^1.1.8",
|
|
138
139
|
"@multiformats/mafmt": "^11.0.2",
|
|
139
140
|
"@multiformats/multiaddr": "^10.1.7"
|
|
140
141
|
},
|
|
141
142
|
"devDependencies": {
|
|
142
|
-
"@libp2p/interface-compliance-tests": "^1.1.
|
|
143
|
-
"@libp2p/interfaces": "^1.3.14",
|
|
143
|
+
"@libp2p/interface-compliance-tests": "^1.1.20",
|
|
144
144
|
"aegir": "^36.1.3"
|
|
145
145
|
}
|
|
146
146
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { P2P } from '@multiformats/mafmt'
|
|
|
3
3
|
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
|
|
4
4
|
import { logger } from '@libp2p/logger'
|
|
5
5
|
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
|
|
6
|
-
import type {
|
|
6
|
+
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
|
|
7
7
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
8
8
|
|
|
9
9
|
const log = logger('libp2p:bootstrap')
|
|
@@ -27,7 +27,7 @@ export class Bootstrap extends EventEmitter<PeerDiscoveryEvents> implements Peer
|
|
|
27
27
|
static tag = 'bootstrap'
|
|
28
28
|
|
|
29
29
|
private timer?: ReturnType<typeof setInterval>
|
|
30
|
-
private readonly list:
|
|
30
|
+
private readonly list: PeerInfo[]
|
|
31
31
|
private readonly interval: number
|
|
32
32
|
|
|
33
33
|
constructor (options: BootstrapOptions = { list: [] }) {
|
|
@@ -53,7 +53,7 @@ export class Bootstrap extends EventEmitter<PeerDiscoveryEvents> implements Peer
|
|
|
53
53
|
continue
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const peerData:
|
|
56
|
+
const peerData: PeerInfo = {
|
|
57
57
|
id: peerIdFromString(peerIdStr),
|
|
58
58
|
multiaddrs: [ma],
|
|
59
59
|
protocols: []
|
|
@@ -89,7 +89,7 @@ export class Bootstrap extends EventEmitter<PeerDiscoveryEvents> implements Peer
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
this.list.forEach((peerData) => {
|
|
92
|
-
this.dispatchEvent(new CustomEvent<
|
|
92
|
+
this.dispatchEvent(new CustomEvent<PeerInfo>('peer', { detail: peerData }))
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
|