@libp2p/bootstrap 1.0.1 → 1.0.4
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/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +5 -5
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAM3F,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,YAAY,CAAC,mBAAmB,CAAE,YAAW,aAAa;IACvF,MAAM,CAAC,GAAG,SAAc;IAExB,OAAO,CAAC,KAAK,CAAC,CAAgC;IAC9C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAEpB,OAAO,GAAE,gBAA+B;IAiCrD,SAAS;IAIT;;OAEG;IACH,KAAK;IAUL;;OAEG;IACH,uBAAuB;IAUvB;;OAEG;IACH,IAAI;CAOL"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Multiaddr } from '@multiformats/multiaddr';
|
|
2
2
|
import { P2P } from '@multiformats/mafmt';
|
|
3
|
-
import { CustomEvent, EventEmitter } from '@libp2p/interfaces';
|
|
3
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events';
|
|
4
4
|
import { logger } from '@libp2p/logger';
|
|
5
5
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
6
6
|
const log = logger('libp2p:bootstrap');
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AActC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAiC;IAO9D,YAAa,UAA4B,EAAE,IAAI,EAAE,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;SAC/D;QACD,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAA;QACzC,IAAI,CAAC,IA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W,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAA;QAC7E,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,IAAI;QACF,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;YACtB,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAC1B;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;IACxB,CAAC;;AA9EM,aAAG,GAAG,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/bootstrap",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -119,28 +119,28 @@
|
|
|
119
119
|
]
|
|
120
120
|
},
|
|
121
121
|
"scripts": {
|
|
122
|
+
"clean": "aegir clean",
|
|
122
123
|
"lint": "aegir lint",
|
|
123
|
-
"dep-check": "aegir dep-check
|
|
124
|
-
"build": "
|
|
125
|
-
"
|
|
126
|
-
"test": "aegir test -
|
|
127
|
-
"test:chrome": "
|
|
128
|
-
"test:
|
|
129
|
-
"test:firefox": "
|
|
130
|
-
"test:
|
|
131
|
-
"test:
|
|
132
|
-
"
|
|
133
|
-
"release": "semantic-release"
|
|
124
|
+
"dep-check": "aegir dep-check",
|
|
125
|
+
"build": "aegir build",
|
|
126
|
+
"test": "aegir test",
|
|
127
|
+
"test:chrome": "aegir test -t browser --cov",
|
|
128
|
+
"test:chrome-webworker": "aegir test -t webworker",
|
|
129
|
+
"test:firefox": "aegir test -t browser -- --browser firefox",
|
|
130
|
+
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
|
|
131
|
+
"test:node": "aegir test -t node --cov",
|
|
132
|
+
"test:electron-main": "aegir test -t electron-main",
|
|
133
|
+
"release": "aegir release"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@libp2p/
|
|
137
|
-
"@libp2p/
|
|
136
|
+
"@libp2p/interfaces": "^1.3.31",
|
|
137
|
+
"@libp2p/logger": "^1.1.3",
|
|
138
|
+
"@libp2p/peer-id": "^1.1.9",
|
|
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
|
-
"
|
|
144
|
-
"aegir": "^36.1.3"
|
|
143
|
+
"@libp2p/interface-compliance-tests": "^1.1.32",
|
|
144
|
+
"aegir": "^37.0.7"
|
|
145
145
|
}
|
|
146
146
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Multiaddr } from '@multiformats/multiaddr'
|
|
2
2
|
import { P2P } from '@multiformats/mafmt'
|
|
3
|
-
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
|
|
3
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
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
|
|