@libp2p/bootstrap 1.0.6 → 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 +26 -15
- package/dist/src/index.d.ts +2 -2
- 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 +9 -5
- package/src/index.ts +3 -3
package/README.md
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @libp2p/bootstrap <!-- omit in toc -->
|
|
2
2
|
|
|
3
|
-
[](https://github.com/libp2p/js-libp2p-bootstrap/actions/workflows/js-test-and-release.yml)
|
|
9
|
-
[](https://github.com/feross/standard)
|
|
10
|
-

|
|
3
|
+
[](http://libp2p.io/)
|
|
4
|
+
[](http://webchat.freenode.net/?channels=%23libp2p)
|
|
5
|
+
[](https://discuss.libp2p.io)
|
|
6
|
+
[](https://codecov.io/gh/libp2p/js-libp2p-bootstrap)
|
|
7
|
+
[](https://github.com/libp2p/js-libp2p-bootstrap/actions/workflows/js-test-and-release.yml)
|
|
11
8
|
|
|
12
|
-
>
|
|
9
|
+
> Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list
|
|
10
|
+
|
|
11
|
+
## Table of contents <!-- omit in toc -->
|
|
12
|
+
|
|
13
|
+
- [Install](#install)
|
|
14
|
+
- [Usage](#usage)
|
|
15
|
+
- [Contribute](#contribute)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
- [Contribution](#contribution)
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
$ npm i @libp2p/bootstrap
|
|
23
|
+
```
|
|
13
24
|
|
|
14
25
|
## Usage
|
|
15
26
|
|
|
@@ -60,16 +71,16 @@ start()
|
|
|
60
71
|
|
|
61
72
|
The libp2p implementation in JavaScript is a work in progress. As such, there are a few things you can do right now to help out:
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
- Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
|
|
75
|
+
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
|
|
65
76
|
|
|
66
77
|
## License
|
|
67
78
|
|
|
68
79
|
Licensed under either of
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
82
|
+
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
## Contribution
|
|
74
85
|
|
|
75
86
|
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '@libp2p/interfaces/events';
|
|
2
|
-
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/
|
|
3
|
-
import { symbol } from '@libp2p/
|
|
2
|
+
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery';
|
|
3
|
+
import { symbol } from '@libp2p/interface-peer-discovery';
|
|
4
4
|
export interface BootstrapOptions {
|
|
5
5
|
/**
|
|
6
6
|
* The list of peer addresses in multi-address format
|
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,2BAA2B,CAAA;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,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,kCAAkC,CAAA;AAG1F,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAIzD,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,IAAI,CAAC,MAAM,CAAC,IAAK,IAAI,CAEpB;IAED,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAEvB;IAED,SAAS;IAIT;;OAEG;IACH,KAAK;IAUL;;OAEG;IACH,uBAAuB;IAUvB;;OAEG;IACH,IAAI;CAOL"}
|
package/dist/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { P2P } from '@multiformats/mafmt';
|
|
|
3
3
|
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events';
|
|
4
4
|
import { logger } from '@libp2p/logger';
|
|
5
5
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
6
|
-
import { symbol } from '@libp2p/
|
|
6
|
+
import { symbol } from '@libp2p/interface-peer-discovery';
|
|
7
7
|
const log = logger('libp2p:bootstrap');
|
|
8
8
|
/**
|
|
9
9
|
* Emits 'peer' events on a regular interval for each peer in the provided list.
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot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Q,EAAE,EAAE;YAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAW,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;;AAtFM,aAAG,GAAG,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/bootstrap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
+
"types": "./src/index.d.ts",
|
|
31
32
|
"import": "./dist/src/index.js"
|
|
32
33
|
}
|
|
33
34
|
},
|
|
@@ -133,14 +134,17 @@
|
|
|
133
134
|
"release": "aegir release"
|
|
134
135
|
},
|
|
135
136
|
"dependencies": {
|
|
136
|
-
"@libp2p/
|
|
137
|
-
"@libp2p/
|
|
137
|
+
"@libp2p/interface-peer-discovery": "^1.0.0",
|
|
138
|
+
"@libp2p/interface-peer-info": "^1.0.1",
|
|
139
|
+
"@libp2p/interfaces": "^3.0.2",
|
|
140
|
+
"@libp2p/logger": "^2.0.0",
|
|
138
141
|
"@libp2p/peer-id": "^1.1.9",
|
|
139
142
|
"@multiformats/mafmt": "^11.0.2",
|
|
140
143
|
"@multiformats/multiaddr": "^10.1.7"
|
|
141
144
|
},
|
|
142
145
|
"devDependencies": {
|
|
143
|
-
"@libp2p/interface-compliance-tests": "^
|
|
144
|
-
"
|
|
146
|
+
"@libp2p/interface-peer-discovery-compliance-tests": "^1.0.0",
|
|
147
|
+
"@libp2p/interface-peer-id": "^1.0.2",
|
|
148
|
+
"aegir": "^37.2.0"
|
|
145
149
|
}
|
|
146
150
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { Multiaddr } from '@multiformats/multiaddr'
|
|
|
2
2
|
import { P2P } from '@multiformats/mafmt'
|
|
3
3
|
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
|
|
4
4
|
import { logger } from '@libp2p/logger'
|
|
5
|
-
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/
|
|
6
|
-
import type { PeerInfo } from '@libp2p/
|
|
5
|
+
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
|
|
6
|
+
import type { PeerInfo } from '@libp2p/interface-peer-info'
|
|
7
7
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
8
|
-
import { symbol } from '@libp2p/
|
|
8
|
+
import { symbol } from '@libp2p/interface-peer-discovery'
|
|
9
9
|
|
|
10
10
|
const log = logger('libp2p:bootstrap')
|
|
11
11
|
|