Skip to content

Commit 0828261

Browse files
committed
fixed merge conflicts
2 parents e219b6b + 907518b commit 0828261

File tree

316 files changed

+6468
-2097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+6468
-2097
lines changed

.cspell.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"import": [
3+
"./node_modules/aegir/cspell.json"
4+
],
5+
"dictionaries": ["project"],
6+
"dictionaryDefinitions": [{
7+
"name": "project",
8+
"path": "./.github/dictionary.txt",
9+
"addWords": true
10+
}]
11+
}

.github/dictionary.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
setbit
2+
getbit
3+
stopstr
4+
rlflx
5+
incrby
6+
hopr
7+
dout
8+
supercop
9+
nothrow
10+
buildx
11+
blpop
12+
rpush
13+
additionals

.github/workflows/main.yml

+28-26
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,31 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
22-
- uses: actions/setup-node@v4
23-
with:
24-
node-version: lts/*
25-
- uses: ipfs/aegir/actions/cache-node-modules@main
26-
with:
27-
directories: ${{ env.CACHE_DIRS }}
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: lts/*
25+
- uses: ipfs/aegir/actions/cache-node-modules@main
26+
with:
27+
directories: ${{ env.CACHE_DIRS }}
2828

2929
check:
3030
needs: build
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v4
34-
- uses: actions/setup-node@v4
35-
with:
36-
node-version: lts/*
37-
- uses: ipfs/aegir/actions/cache-node-modules@main
38-
with:
39-
directories: ${{ env.CACHE_DIRS }}
40-
- run: npm run --if-present lint
41-
- run: npm run --if-present dep-check
42-
- run: npm run --if-present docs:no-publish
43-
- run: npm run --if-present doc-check
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: lts/*
37+
- uses: ipfs/aegir/actions/cache-node-modules@main
38+
with:
39+
directories: ${{ env.CACHE_DIRS }}
40+
- run: npm run --if-present lint
41+
- run: npm run --if-present dep-check
42+
- run: npm run --if-present docs:no-publish
43+
- run: npm run --if-present doc-check
44+
- run: npm run --if-present spell-check
45+
4446
test-node:
4547
needs: build
4648
runs-on: ${{ matrix.os }}
@@ -58,7 +60,7 @@ jobs:
5860
with:
5961
directories: ${{ env.CACHE_DIRS }}
6062
- run: npm run --if-present test:node
61-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
63+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
6264
with:
6365
flags: node
6466
files: .coverage/*,packages/*/.coverage/*
@@ -76,7 +78,7 @@ jobs:
7678
with:
7779
directories: ${{ env.CACHE_DIRS }}
7880
- run: npm run --if-present test:chrome
79-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
81+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
8082
with:
8183
flags: chrome
8284
files: .coverage/*,packages/*/.coverage/*
@@ -94,7 +96,7 @@ jobs:
9496
with:
9597
directories: ${{ env.CACHE_DIRS }}
9698
- run: npm run --if-present test:chrome-webworker
97-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
99+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
98100
with:
99101
flags: chrome-webworker
100102
files: .coverage/*,packages/*/.coverage/*
@@ -112,7 +114,7 @@ jobs:
112114
with:
113115
directories: ${{ env.CACHE_DIRS }}
114116
- run: npm run --if-present test:firefox
115-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
117+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
116118
with:
117119
flags: firefox
118120
files: .coverage/*,packages/*/.coverage/*
@@ -130,7 +132,7 @@ jobs:
130132
with:
131133
directories: ${{ env.CACHE_DIRS }}
132134
- run: npm run --if-present test:firefox-webworker
133-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
135+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
134136
with:
135137
flags: firefox-webworker
136138
files: .coverage/*,packages/*/.coverage/*
@@ -153,7 +155,7 @@ jobs:
153155
sudo apt-get update
154156
- run: npx playwright install-deps
155157
- run: npm run --if-present test:webkit
156-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
158+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
157159
with:
158160
flags: webkit
159161
files: .coverage/*,packages/*/.coverage/*
@@ -171,7 +173,7 @@ jobs:
171173
with:
172174
directories: ${{ env.CACHE_DIRS }}
173175
- run: npx xvfb-maybe npm run --if-present test:electron-main
174-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
176+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
175177
with:
176178
flags: electron-main
177179
files: .coverage/*,packages/*/.coverage/*
@@ -189,7 +191,7 @@ jobs:
189191
with:
190192
directories: ${{ env.CACHE_DIRS }}
191193
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
192-
- uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
194+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
193195
with:
194196
flags: electron-renderer
195197
files: .coverage/*,packages/*/.coverage/*

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"packages/config":"1.1.0","packages/connection-encrypter-plaintext":"2.0.16","packages/connection-encrypter-tls":"2.0.16","packages/crypto":"5.0.12","packages/interface":"2.6.0","packages/interface-compliance-tests":"6.3.4","packages/interface-internal":"2.3.4","packages/kad-dht":"14.2.9","packages/keychain":"5.1.0","packages/libp2p":"2.7.2","packages/logger":"5.1.9","packages/metrics-devtools":"1.2.7","packages/metrics-opentelemetry":"1.0.6","packages/metrics-prometheus":"4.3.9","packages/metrics-simple":"1.3.3","packages/multistream-select":"6.0.16","packages/peer-collections":"6.0.20","packages/peer-discovery-bootstrap":"11.0.26","packages/peer-discovery-mdns":"11.0.26","packages/peer-id":"5.0.13","packages/peer-record":"8.0.20","packages/peer-store":"11.0.20","packages/pnet":"2.0.26","packages/protocol-autonat":"2.0.23","packages/protocol-dcutr":"2.0.22","packages/protocol-echo":"2.1.13","packages/protocol-fetch":"3.0.7","packages/protocol-identify":"3.0.22","packages/protocol-perf":"4.0.26","packages/protocol-ping":"2.0.22","packages/pubsub":"10.1.3","packages/pubsub-floodsub":"10.1.25","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.26","packages/transport-circuit-relay-v2":"3.2.2","packages/transport-memory":"1.1.0","packages/transport-tcp":"10.1.2","packages/transport-webrtc":"5.2.3","packages/transport-websockets":"9.2.2","packages/transport-webtransport":"5.0.31","packages/upnp-nat":"3.1.6","packages/utils":"6.5.4"}
1+
{"packages/config":"1.1.4","packages/connection-encrypter-plaintext":"2.0.20","packages/connection-encrypter-tls":"2.1.1","packages/crypto":"5.0.15","packages/interface":"2.7.0","packages/interface-compliance-tests":"6.4.1","packages/interface-internal":"2.3.8","packages/kad-dht":"14.2.14","packages/keychain":"5.1.4","packages/libp2p":"2.8.1","packages/logger":"5.1.13","packages/metrics-devtools":"1.2.11","packages/metrics-opentelemetry":"1.0.10","packages/metrics-prometheus":"4.3.14","packages/metrics-simple":"1.3.7","packages/multistream-select":"6.0.20","packages/peer-collections":"6.0.24","packages/peer-discovery-bootstrap":"11.0.31","packages/peer-discovery-mdns":"11.0.31","packages/peer-id":"5.1.0","packages/peer-record":"8.0.24","packages/peer-store":"11.1.1","packages/pnet":"2.0.31","packages/protocol-autonat":"2.0.27","packages/protocol-dcutr":"2.0.26","packages/protocol-echo":"2.1.17","packages/protocol-fetch":"3.0.11","packages/protocol-identify":"3.0.26","packages/protocol-perf":"4.0.31","packages/protocol-ping":"2.0.26","packages/pubsub":"10.1.7","packages/pubsub-floodsub":"10.1.30","packages/record":"4.0.5","packages/stream-multiplexer-mplex":"11.0.31","packages/transport-circuit-relay-v2":"3.2.7","packages/transport-memory":"1.1.4","packages/transport-tcp":"10.1.7","packages/transport-webrtc":"5.2.8","packages/transport-websockets":"9.2.7","packages/transport-webtransport":"5.0.36","packages/upnp-nat":"3.1.10","packages/utils":"6.5.8"}

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
👉 Please see the [IPFS JavaScript Community contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for how to collaborate and contribute to js-libp2p.
66

7-
💪 The [core maintainers](https://github.com/libp2p/js-libp2p/blob/main/CODEOWNERS) hang out in #libp2p-implementers in ipfs.io Matrix, FIL Slack, and IPFS Discord. They perform weekly triage of issues and PRs per https://lu.ma/libp2p
7+
💪 The [core maintainers](https://github.com/libp2p/js-libp2p/blob/main/CODEOWNERS) hang out in #libp2p-implementers in ipfs.io Matrix, FIL Slack, and IPFS Discord. They perform weekly triage of issues and PRs on the Open Maintainers Call - see the [Libp2p Events Calendar](https://lu.ma/libp2p) to find out when the next one is.
88

99
🤲 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 in [README.md](https://github.com/libp2p/js-libp2p/blob/main/README.md), without any additional terms or conditions.
1010

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=main\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amain)
1414

1515
> [!NOTE]
16-
> Are you tring to upgrade libp2p to the latest version? Check out the [migration guides](https://github.com/libp2p/js-libp2p/tree/main/doc/migrations) for any changes you need to make.
16+
> Are you trying to upgrade libp2p to the latest version? Check out the [migration guides](https://github.com/libp2p/js-libp2p/tree/main/doc/migrations) for any changes you need to make.
1717
1818
### Project status
1919

@@ -24,7 +24,7 @@ The documentation in the main branch may contain changes from a pre-release.
2424
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.
2525

2626
> [!TIP]
27-
> Just tring to figure out what this is all about? Check our [GETTING\_STARTED.md](https://github.com/libp2p/js-libp2p/blob/main/doc/GETTING_STARTED.md) guide and [examples](https://github.com/libp2p/js-libp2p-examples).
27+
> Just trying to figure out what this is all about? Check our [GETTING\_STARTED.md](https://github.com/libp2p/js-libp2p/blob/main/doc/GETTING_STARTED.md) guide and [examples](https://github.com/libp2p/js-libp2p-examples).
2828
2929
## Background
3030

@@ -41,7 +41,7 @@ We are in the process of writing better documentation, blog posts, tutorials and
4141
- Articles
4242
- [The overview of libp2p](https://github.com/libp2p/libp2p#description)
4343

44-
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.
44+
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.
4545

4646
## Roadmap
4747

@@ -76,7 +76,7 @@ You can find multiple examples on the [examples repo](https://github.com/libp2p/
7676
## Structure
7777

7878
- [`/doc`](https://github.com/libp2p/js-libp2p/blob/main/doc) Docs for libp2p
79-
- [`/interop`](https://github.com/libp2p/js-libp2p/tree/main/interop) Multidimension Interop Test
79+
- [`/interop`](https://github.com/libp2p/js-libp2p/tree/main/interop) Multidimensional Interop Test
8080
- [`/packages/crypto`](https://github.com/libp2p/js-libp2p/tree/main/packages/crypto) Crypto primitives for libp2p
8181
- [`/packages/interface`](https://github.com/libp2p/js-libp2p/tree/main/packages/interface) The interface implemented by a libp2p node
8282
- [`/packages/interface-compliance-tests`](https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests) Compliance tests for JS libp2p interfaces
@@ -121,7 +121,7 @@ You can find multiple examples on the [examples repo](https://github.com/libp2p/
121121
#### Run unit tests
122122

123123
```sh
124-
# run all the unit tsts
124+
# run all the unit tests
125125
> npm test
126126

127127
# run just Node.js tests

ROADMAP.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ js-libp2p is deployed in many production environments so to take adoption to the
88

99
### js-libp2p amino DHT bootstrapper
1010

11-
Deploying a public bootstrapper is a great test of the capacity of js-libp2p since it will need to maintain several thousand simultaneous connections and service many DHT RPC requests. Comprehensive metrics and logging will also give us insight into real world usage patterns that can further direct performance optimisations.
11+
Deploying a public bootstrapper is a great test of the capacity of js-libp2p since it will need to maintain several thousand simultaneous connections and service many DHT RPC requests. Comprehensive metrics and logging will also give us insight into real world usage patterns that can further direct performance optimizations.
1212

1313
- Deploy a bootstrap server that acts as an entry point to the network for DHT clients
1414
- Ship it in the default config of majority libp2p/IPFS implementations
@@ -74,7 +74,7 @@ The specification is [in progress](https://github.com/libp2p/specs/pull/625) the
7474

7575
### QUIC in Node.js
7676

77-
There's a decent chance the Node.js QUIC implementation is [not going to be exposed to userland](https://github.com/nodejs/node/pull/52628#issuecomment-2143475066), but we need this to have compatibility with other libp2p implementations.
77+
There's a decent chance the Node.js QUIC implementation is [not going to be exposed to user land](https://github.com/nodejs/node/pull/52628#issuecomment-2143475066), but we need this to have compatibility with other libp2p implementations.
7878

7979
https://github.com/ChainSafe/js-libp2p-quic is in-progress to add QUIC support via a native module that uses the Rust implementation.
8080

doc/ARCHITECTURE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Libp2p Architecture
22

3-
js-libp2p is comprised of a number of components that work together to provide functionality such as dailling peers, managing connections, registering protocols, storing information about peers and much more. This document aims to provide a high level overview of the components and how they interact with each other.
3+
js-libp2p is comprised of a number of components that work together to provide functionality such as dialing peers, managing connections, registering protocols, storing information about peers and much more. This document aims to provide a high level overview of the components and how they interact with each other.
44

55
- [Libp2p Architecture](#libp2p-architecture)
66
- [Component Diagram](#component-diagram)

doc/CONFIGURATION.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- [Setup with Delegated Content and Peer Routing](#setup-with-delegated-content-and-peer-routing)
2121
- [Setup with Relay](#setup-with-relay)
2222
- [Setup with Automatic Reservations](#setup-with-automatic-reservations)
23-
- [Setup with Preconfigured Reservations](#setup-with-preconfigured-reservations)
23+
- [Setup with Pre-configured Reservations](#setup-with-pre-configured-reservations)
2424
- [Setup with Keychain](#setup-with-keychain)
2525
- [Configuring Connection Manager](#configuring-connection-manager)
2626
- [Configuring Connection Gater](#configuring-connection-gater)
@@ -175,7 +175,7 @@ If none of the available peer routing protocols fulfills your needs, you can cre
175175

176176
> A DHT can provide content and peer routing capabilities in a p2p system, as well as peer discovery capabilities.
177177
178-
The DHT implementation currently available is [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht). This implementation is largely based on the Kademlia whitepaper, augmented with notions from S/Kademlia, Coral and mainlineDHT.
178+
The DHT implementation currently available is [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht). This implementation is largely based on the Kademlia white paper, augmented with notions from S/Kademlia, Coral and mainlineDHT.
179179

180180
If this DHT implementation does not fulfill your needs and you want to create or use your own implementation, please get in touch with us through a github issue. We plan to work on improving the ability to bring your own DHT in a future release.
181181

@@ -501,7 +501,7 @@ const node = await createLibp2p({
501501
})
502502
```
503503

504-
#### Setup with Preconfigured Reservations
504+
#### Setup with Pre-configured Reservations
505505

506506
In this configuration the libp2p node is a circuit relay client which connects to a relay, `/ip4/123.123.123.123/p2p/QmRelay` which has been configured to have slots available.
507507

@@ -563,7 +563,7 @@ const node = await createLibp2p({
563563
noise()
564564
],
565565
keychain: {
566-
pass: 'notsafepassword123456789',
566+
pass: 'not-safe-password-123456789',
567567
},
568568
datastore
569569
})
@@ -640,7 +640,7 @@ const node = await createLibp2p({
640640
* multiaddr for the given peer.
641641
*
642642
* This is called by the dialer.connectToPeer implementation after it has
643-
* resolved the peer's addrs, and prior to dialling each.
643+
* resolved the peer's addresses, and prior to dialling each.
644644
*
645645
* Return true to prevent dialing the passed peer on the passed multiaddr.
646646
*/
@@ -795,7 +795,7 @@ const node = await createLibp2p({
795795

796796
PeerStore persistence is disabled in libp2p by default. You can enable and configure it as follows. Aside from enabled being `false` by default, it will need an implementation of a [datastore](https://github.com/ipfs/interface-datastore). Take into consideration that using the memory datastore will be ineffective for persistence.
797797

798-
The threshold number represents the maximum number of "dirty peers" allowed in the PeerStore, i.e. peers that are not updated in the datastore. In this context, browser nodes should use a threshold of 1, since they might not "stop" properly in several scenarios and the PeerStore might end up with unflushed records when the window is closed.
798+
The threshold number represents the maximum number of "dirty peers" allowed in the PeerStore, i.e. peers that are not updated in the datastore. In this context, browser nodes should use a threshold of 1, since they might not "stop" properly in several scenarios and the PeerStore might end up with un-flushed records when the window is closed.
799799

800800
| Name | Type | Description |
801801
| ----------- | --------- | ------------------------------ |

doc/GETTING_STARTED.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Other systems have tried to fill this gap, notably CommonJS, AMD, RequireJS and
5050
}
5151
```
5252

53-
For more info on enablng ES modules in Node, see [this guide](https://nodejs.org/api/esm.html).
53+
For more info on enabling ES modules in Node, see [this guide](https://nodejs.org/api/esm.html).
5454

5555
### Basic setup
5656

@@ -176,8 +176,8 @@ const node = await createLibp2p({
176176
await node.start()
177177
console.log('libp2p has started')
178178

179-
const listenAddrs = node.getMultiaddrs()
180-
console.log('libp2p is listening on the following addresses: ', listenAddrs)
179+
const listenAddresses = node.getMultiaddrs()
180+
console.log('libp2p is listening on the following addresses: ', listenAddresses)
181181

182182
// stop libp2p
183183
await node.stop()
@@ -254,17 +254,17 @@ When running libp2p you may want to see what things are happening behind the sce
254254

255255
### Node
256256

257-
```javascript
257+
```JavaScript
258258
# all libp2p debug logs
259-
DEBUG="libp2p:*" node myscript.js
259+
DEBUG="libp2p:*" node my-script.js
260260

261261
# networking debug logs
262-
DEBUG="libp2p:tcp,libp2p:websockets,libp2p:webtransport,libp2p:kad-dht,libp2p:dialer" node myscript.js
262+
DEBUG="libp2p:tcp,libp2p:websockets,libp2p:webtransport,libp2p:kad-dht,libp2p:dialer" node my-script.js
263263
```
264264

265265
### Browser
266266

267-
```javascript
267+
```JavaScript
268268
// all libp2p debug logs
269269
localStorage.setItem('debug', 'libp2p:*') // then refresh the page to ensure the libraries can read this when spinning up.
270270

0 commit comments

Comments
 (0)