libp2p 2.7.2 → 2.7.3-4939ef7ae
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 +33 -4
- package/dist/index.min.js +15 -10
- package/dist/src/address-manager/index.js +8 -8
- package/dist/src/address-manager/index.js.map +1 -1
- package/dist/src/config/connection-gater.browser.d.ts +1 -1
- package/dist/src/config/connection-gater.browser.js +1 -1
- package/dist/src/connection-manager/address-sorter.js +4 -4
- package/dist/src/connection-manager/constants.defaults.d.ts +4 -4
- package/dist/src/connection-manager/constants.defaults.d.ts.map +1 -1
- package/dist/src/connection-manager/constants.defaults.js +4 -4
- package/dist/src/connection-manager/constants.defaults.js.map +1 -1
- package/dist/src/connection-manager/dial-queue.d.ts +1 -0
- package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
- package/dist/src/connection-manager/dial-queue.js +106 -74
- package/dist/src/connection-manager/dial-queue.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +8 -6
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/errors.d.ts +6 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +12 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +2 -3
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/random-walk.js +2 -2
- package/dist/src/random-walk.js.map +1 -1
- package/dist/src/transport-manager.d.ts +1 -0
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/transport-manager.js +70 -26
- package/dist/src/transport-manager.js.map +1 -1
- package/dist/src/upgrader.d.ts +5 -11
- package/dist/src/upgrader.d.ts.map +1 -1
- package/dist/src/upgrader.js +25 -18
- package/dist/src/upgrader.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +11 -11
- package/src/address-manager/index.ts +8 -8
- package/src/config/connection-gater.browser.ts +1 -1
- package/src/connection-manager/address-sorter.ts +4 -4
- package/src/connection-manager/constants.defaults.ts +4 -4
- package/src/connection-manager/dial-queue.ts +122 -78
- package/src/connection-manager/index.ts +8 -6
- package/src/errors.ts +14 -0
- package/src/index.ts +1 -1
- package/src/libp2p.ts +2 -3
- package/src/random-walk.ts +2 -2
- package/src/transport-manager.ts +94 -26
- package/src/upgrader.ts +30 -28
- package/src/version.ts +1 -1
- package/dist/typedoc-urls.json +0 -21
package/README.md
CHANGED
|
@@ -8,10 +8,39 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/libp2p)
|
|
9
9
|
[](https://discuss.libp2p.io)
|
|
10
10
|
[](http://webchat.freenode.net/?channels=%23libp2p)
|
|
11
|
-
[](https://discord.com/invite/Ae4TbahHaT)
|
|
12
12
|
[](https://codecov.io/gh/libp2p/js-libp2p)
|
|
13
13
|
[](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amain)
|
|
14
14
|
|
|
15
|
+
# About
|
|
16
|
+
|
|
17
|
+
<!--
|
|
18
|
+
|
|
19
|
+
!IMPORTANT!
|
|
20
|
+
|
|
21
|
+
Everything in this README between "# About" and "# Install" is automatically
|
|
22
|
+
generated and will be overwritten the next time the doc generator is run.
|
|
23
|
+
|
|
24
|
+
To make changes to this section, please update the @packageDocumentation section
|
|
25
|
+
of src/index.js or src/index.ts
|
|
26
|
+
|
|
27
|
+
To experiment with formatting, please run "npm run docs" from the root of this
|
|
28
|
+
repo and examine the changes made.
|
|
29
|
+
|
|
30
|
+
-->
|
|
31
|
+
|
|
32
|
+
Use the `createLibp2p` function to create a libp2p node.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createLibp2p } from 'libp2p'
|
|
38
|
+
|
|
39
|
+
const node = await createLibp2p({
|
|
40
|
+
// ...other options
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
15
44
|
# Background
|
|
16
45
|
|
|
17
46
|
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.
|
|
@@ -27,7 +56,7 @@ We are in the process of writing better documentation, blog posts, tutorials and
|
|
|
27
56
|
- Articles
|
|
28
57
|
- [The overview of libp2p](https://github.com/libp2p/libp2p#description)
|
|
29
58
|
|
|
30
|
-
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
|
|
59
|
+
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 upgradability. libp2p grew out of IPFS, but it is built so that lots of people can use it, for lots of different projects.
|
|
31
60
|
|
|
32
61
|
# Roadmap
|
|
33
62
|
|
|
@@ -69,7 +98,7 @@ You can find multiple examples on the [examples repo](https://github.com/libp2p/
|
|
|
69
98
|
## Run unit tests
|
|
70
99
|
|
|
71
100
|
```sh
|
|
72
|
-
# run all the unit
|
|
101
|
+
# run all the unit tests
|
|
73
102
|
> npm test
|
|
74
103
|
|
|
75
104
|
# run just Node.js tests
|
|
@@ -142,7 +171,7 @@ And [many others...](https://github.com/libp2p/js-libp2p/network/dependents)
|
|
|
142
171
|
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:
|
|
143
172
|
|
|
144
173
|
- Go through the modules and **check out existing issues**. This would be 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.
|
|
145
|
-
- **Perform code reviews**.
|
|
174
|
+
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
|
|
146
175
|
- **Add tests**. There can never be enough tests.
|
|
147
176
|
|
|
148
177
|
# API Docs
|