libp2p 0.46.16 → 0.46.17-f4fac961

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.
Files changed (76) hide show
  1. package/README.md +20 -63
  2. package/dist/index.min.js +29 -29
  3. package/dist/src/autonat/index.d.ts.map +1 -1
  4. package/dist/src/autonat/index.js +3 -11
  5. package/dist/src/autonat/index.js.map +1 -1
  6. package/dist/src/circuit-relay/server/index.d.ts.map +1 -1
  7. package/dist/src/circuit-relay/server/index.js +2 -7
  8. package/dist/src/circuit-relay/server/index.js.map +1 -1
  9. package/dist/src/circuit-relay/transport/discovery.d.ts.map +1 -1
  10. package/dist/src/circuit-relay/transport/discovery.js +1 -0
  11. package/dist/src/circuit-relay/transport/discovery.js.map +1 -1
  12. package/dist/src/circuit-relay/transport/listener.d.ts.map +1 -1
  13. package/dist/src/circuit-relay/transport/listener.js +3 -17
  14. package/dist/src/circuit-relay/transport/listener.js.map +1 -1
  15. package/dist/src/connection/index.d.ts.map +1 -1
  16. package/dist/src/connection/index.js +5 -6
  17. package/dist/src/connection/index.js.map +1 -1
  18. package/dist/src/connection-manager/dial-queue.d.ts +4 -0
  19. package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
  20. package/dist/src/connection-manager/dial-queue.js +58 -29
  21. package/dist/src/connection-manager/dial-queue.js.map +1 -1
  22. package/dist/src/connection-manager/index.d.ts.map +1 -1
  23. package/dist/src/connection-manager/index.js +7 -5
  24. package/dist/src/connection-manager/index.js.map +1 -1
  25. package/dist/src/connection-manager/utils.d.ts.map +1 -1
  26. package/dist/src/connection-manager/utils.js +3 -11
  27. package/dist/src/connection-manager/utils.js.map +1 -1
  28. package/dist/src/dcutr/dcutr.d.ts +0 -5
  29. package/dist/src/dcutr/dcutr.d.ts.map +1 -1
  30. package/dist/src/dcutr/dcutr.js +4 -28
  31. package/dist/src/dcutr/dcutr.js.map +1 -1
  32. package/dist/src/dcutr/utils.d.ts +8 -0
  33. package/dist/src/dcutr/utils.d.ts.map +1 -0
  34. package/dist/src/dcutr/utils.js +27 -0
  35. package/dist/src/dcutr/utils.js.map +1 -0
  36. package/dist/src/fetch/index.d.ts.map +1 -1
  37. package/dist/src/fetch/index.js +2 -6
  38. package/dist/src/fetch/index.js.map +1 -1
  39. package/dist/src/identify/consts.d.ts +1 -1
  40. package/dist/src/identify/consts.d.ts.map +1 -1
  41. package/dist/src/identify/identify.d.ts.map +1 -1
  42. package/dist/src/identify/identify.js +61 -48
  43. package/dist/src/identify/identify.js.map +1 -1
  44. package/dist/src/libp2p.d.ts.map +1 -1
  45. package/dist/src/libp2p.js +3 -7
  46. package/dist/src/libp2p.js.map +1 -1
  47. package/dist/src/registrar.d.ts +7 -6
  48. package/dist/src/registrar.d.ts.map +1 -1
  49. package/dist/src/registrar.js +16 -41
  50. package/dist/src/registrar.js.map +1 -1
  51. package/dist/src/upgrader.d.ts.map +1 -1
  52. package/dist/src/upgrader.js +4 -12
  53. package/dist/src/upgrader.js.map +1 -1
  54. package/dist/src/version.d.ts +1 -1
  55. package/dist/src/version.d.ts.map +1 -1
  56. package/dist/src/version.js +1 -1
  57. package/dist/src/version.js.map +1 -1
  58. package/package.json +23 -24
  59. package/src/autonat/index.ts +3 -9
  60. package/src/circuit-relay/server/index.ts +2 -6
  61. package/src/circuit-relay/transport/discovery.ts +1 -0
  62. package/src/circuit-relay/transport/listener.ts +3 -21
  63. package/src/connection/index.ts +6 -5
  64. package/src/connection-manager/dial-queue.ts +71 -32
  65. package/src/connection-manager/index.ts +7 -5
  66. package/src/connection-manager/utils.ts +3 -9
  67. package/src/dcutr/dcutr.ts +4 -35
  68. package/src/dcutr/utils.ts +33 -0
  69. package/src/fetch/index.ts +2 -5
  70. package/src/identify/identify.ts +71 -48
  71. package/src/libp2p.ts +3 -6
  72. package/src/pnet/README.md +0 -4
  73. package/src/registrar.ts +19 -50
  74. package/src/upgrader.ts +4 -10
  75. package/src/version.ts +1 -1
  76. package/dist/typedoc-urls.json +0 -71
package/README.md CHANGED
@@ -1,48 +1,3 @@
1
- # libp2p <!-- omit in toc -->
2
-
3
- [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
- [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
5
- [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)
6
- [![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amaster)
7
-
8
- > JavaScript implementation of libp2p, a modular peer to peer network stack
9
-
10
- ## Table of contents <!-- omit in toc -->
11
-
12
- - [Install](#install)
13
- - [Browser `<script>` tag](#browser-script-tag)
14
- - [Project status](#project-status)
15
- - [Background](#background)
16
- - [Roadmap](#roadmap)
17
- - [Usage](#usage)
18
- - [Configuration](#configuration)
19
- - [Limits](#limits)
20
- - [Getting started](#getting-started)
21
- - [Tutorials and Examples](#tutorials-and-examples)
22
- - [Development](#development)
23
- - [Tests](#tests)
24
- - [Run unit tests](#run-unit-tests)
25
- - [Packages](#packages)
26
- - [Used by](#used-by)
27
- - [Contribute](#contribute)
28
- - [API Docs](#api-docs)
29
- - [License](#license)
30
- - [Contribution](#contribution)
31
-
32
- ## Install
33
-
34
- ```console
35
- $ npm i libp2p
36
- ```
37
-
38
- ### Browser `<script>` tag
39
-
40
- Loading this module through a script tag will make it's exports available as `Libp2p` in the global namespace.
41
-
42
- ```html
43
- <script src="https://unpkg.com/libp2p/dist/index.min.js"></script>
44
- ```
45
-
46
1
  <h1 align="center">
47
2
  <a href="https://libp2p.io"><img width="250" src="https://github.com/libp2p/js-libp2p/blob/master/img/libp2p.png?raw=true" alt="libp2p hex logo" /></a>
48
3
  </h1>
@@ -71,18 +26,20 @@ Loading this module through a script tag will make it's exports available as `Li
71
26
  <br>
72
27
  </p>
73
28
 
74
- ### Project status
29
+ > JavaScript implementation of libp2p, a modular peer to peer network stack
30
+
31
+ # Project status
75
32
 
76
33
  We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons 🐉..
77
34
 
78
35
  The documentation in the master branch may contain changes from a pre-release.
79
36
  If you are looking for the documentation of the latest release, you can view the latest release on [**npm**](https://www.npmjs.com/package/libp2p), or select the tag in github that matches the version you are looking for.
80
37
 
81
- **Want to get started?** Check our [GETTING\_STARTED.md](./doc/GETTING_STARTED.md) guide and [examples folder](/examples).
38
+ **Want to get started?** Check our [GETTING\_STARTED.md](./doc/GETTING_STARTED.md) guide and [examples repo](https://github.com/libp2p/js-libp2p-examples).
82
39
 
83
40
  **Want to update libp2p in your project?** Check our [migrations folder](./doc/migrations).
84
41
 
85
- ## Background
42
+ # Background
86
43
 
87
44
  libp2p is the product of a long and arduous quest to understand the evolution of the Internet networking stack. In order to build P2P applications, devs have long had to make custom ad-hoc solutions to fit their needs, sometimes making some hard assumptions about their runtimes and the state of the network at the time of their development. Today, looking back more than 20 years, we see a clear pattern in the types of mechanisms built around the Internet Protocol, IP, which can be found throughout many layers of the OSI layer system, libp2p distils these mechanisms into flat categories and defines clear interfaces that once exposed, enable other protocols and applications to use and swap them, enabling upgradability and adaptability for the runtime, without breaking the API.
88
45
 
@@ -99,7 +56,7 @@ We are in the process of writing better documentation, blog posts, tutorials and
99
56
 
100
57
  To sum up, libp2p is a "network stack" -- a protocol suite -- that cleanly separates concerns, and enables sophisticated applications to only use the protocols they absolutely need, without giving up interoperability and upgradeability. libp2p grew out of IPFS, but it is built so that lots of people can use it, for lots of different projects.
101
58
 
102
- ## Roadmap
59
+ # Roadmap
103
60
 
104
61
  The js-libp2p roadmap can be found here: <https://github.com/libp2p/js-libp2p/blob/master/ROADMAP.md>
105
62
 
@@ -107,25 +64,25 @@ It represents current projects the js-libp2p maintainers are focused on and prov
107
64
 
108
65
  It is complementary to the overarching libp2p project roadmap: <https://github.com/libp2p/specs/blob/master/ROADMAP.md>
109
66
 
110
- ## Usage
67
+ # Usage
111
68
 
112
69
  ### Configuration
113
70
 
114
71
  For all the information on how you can configure libp2p see [CONFIGURATION.md](./doc/CONFIGURATION.md).
115
72
 
116
- ### Limits
73
+ ## Limits
117
74
 
118
75
  For help configuring your node to resist malicious network peers, see [LIMITS.md](./doc/LIMITS.md)
119
76
 
120
- ### Getting started
77
+ ## Getting started
121
78
 
122
79
  If you are starting your journey with `js-libp2p`, read the [GETTING\_STARTED.md](./doc/GETTING_STARTED.md) guide.
123
80
 
124
- ### Tutorials and Examples
81
+ ## Tutorials and Examples
125
82
 
126
- You can find multiple examples on the [examples folder](./examples) that will guide you through using libp2p for several scenarios.
83
+ You can find multiple examples on the [examples repo](https://github.com/libp2p/js-libp2p-examples) that will guide you through using libp2p for several scenarios.
127
84
 
128
- ## Development
85
+ # Development
129
86
 
130
87
  **Clone and install dependencies:**
131
88
 
@@ -136,9 +93,9 @@ You can find multiple examples on the [examples folder](./examples) that will gu
136
93
  > npm run build
137
94
  ```
138
95
 
139
- ### Tests
96
+ # Tests
140
97
 
141
- #### Run unit tests
98
+ ## Run unit tests
142
99
 
143
100
  ```sh
144
101
  # run all the unit tsts
@@ -151,7 +108,7 @@ You can find multiple examples on the [examples folder](./examples) that will gu
151
108
  > npm run test:chrome
152
109
  ```
153
110
 
154
- ### Packages
111
+ # Packages
155
112
 
156
113
  List of packages currently in existence for libp2p
157
114
 
@@ -195,7 +152,7 @@ List of packages currently in existence for libp2p
195
152
  | [`@ChainSafe/libp2p-gossipsub`](//github.com/ChainSafe/js-libp2p-gossipsub) | [![npm](https://img.shields.io/npm/v/%40ChainSafe%2Flibp2p-gossipsub.svg?maxAge=86400\&style=flat-square)](//github.com/ChainSafe/js-libp2p-gossipsub/releases) | [![Deps](https://img.shields.io/librariesio/release/npm/%40ChainSafe%2Flibp2p-gossipsub?logo=Libraries.io\&logoColor=white\&style=flat-square)](//libraries.io/npm/%40ChainSafe%2Flibp2p-gossipsub) | [![GitHub CI](https://img.shields.io/github/actions/workflow/status/ChainSafe/js-libp2p-gossipsub/main.yml?branch=master\&label=ci\&style=flat-square)](//github.com/ChainSafe/js-libp2p-gossipsub/actions?query=branch%3Amaster+workflow%3Aci+) | [![codecov](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub) |
196
153
  | [`@libp2p/floodsub`](//github.com/libp2p/js-libp2p-floodsub) | [![npm](https://img.shields.io/npm/v/%40libp2p%2Ffloodsub.svg?maxAge=86400\&style=flat-square)](//github.com/libp2p/js-libp2p-floodsub/releases) | [![Deps](https://img.shields.io/librariesio/release/npm/%40libp2p%2Ffloodsub?logo=Libraries.io\&logoColor=white\&style=flat-square)](//libraries.io/npm/%40libp2p%2Ffloodsub) | [![GitHub CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-floodsub/js-test-and-release.yml?branch=master\&label=ci\&style=flat-square)](//github.com/libp2p/js-libp2p-floodsub/actions?query=branch%3Amaster+workflow%3Aci+) | [![codecov](https://codecov.io/gh/libp2p/js-libp2p-floodsub/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-floodsub) |
197
154
 
198
- ## Used by
155
+ # Used by
199
156
 
200
157
  <div style="padding: 20px">
201
158
  <p align="middle">
@@ -207,7 +164,7 @@ List of packages currently in existence for libp2p
207
164
 
208
165
  And [many others...](https://github.com/libp2p/js-libp2p/network/dependents)
209
166
 
210
- ## Contribute
167
+ # Contribute
211
168
 
212
169
  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:
213
170
 
@@ -215,17 +172,17 @@ The libp2p implementation in JavaScript is a work in progress. As such, there ar
215
172
  - **Perform code reviews**. Most of this has been developed by @diasdavid, which means that more eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
216
173
  - **Add tests**. There can never be enough tests.
217
174
 
218
- ## API Docs
175
+ # API Docs
219
176
 
220
177
  - <https://libp2p.github.io/js-libp2p/modules/libp2p.html>
221
178
 
222
- ## License
179
+ # License
223
180
 
224
181
  Licensed under either of
225
182
 
226
183
  - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
227
184
  - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
228
185
 
229
- ## Contribution
186
+ # Contribution
230
187
 
231
188
  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.