Skip to content

Commit 3dee5df

Browse files
committed
chore: rename master to main
1 parent adea7bb commit 3dee5df

File tree

90 files changed

+248
-251
lines changed

Some content is hidden

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

90 files changed

+248
-251
lines changed

.github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<!---
33
The title of the PR will be the commit message of the merge commit, so please make sure it is descriptive enough.
44
We utilize the Conventional Commits specification for our commit messages. See <https://www.conventionalcommits.org/en/v1.0.0/#specification> for more information.
5-
The commit tag types can be of one of the following: feat, fix, deps, refactor, chore, docs. See <https://github.com/libp2p/js-libp2p/blob/master/.github/workflows/main.yml#L235-L242>
6-
The title must also be fewer than 72 characters long or it will fail the Semantic PR check. See <https://github.com/libp2p/js-libp2p/blob/master/.github/workflows/semantic-pull-request.yml>
5+
The commit tag types can be of one of the following: feat, fix, deps, refactor, chore, docs. See <https://github.com/libp2p/js-libp2p/blob/main/.github/workflows/main.yml#L235-L242>
6+
The title must also be fewer than 72 characters long or it will fail the Semantic PR check. See <https://github.com/libp2p/js-libp2p/blob/main/.github/workflows/semantic-pull-request.yml>
77
--->
88

99
## Description

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- master
5+
- main
66
pull_request:
77
branches:
88
- '**'
@@ -217,7 +217,7 @@ jobs:
217217
test-interop,
218218
transport-interop
219219
]
220-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
220+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
221221
steps:
222222
- uses: GoogleCloudPlatform/release-please-action@v2
223223
id: release

.release-please.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"last-release-sha": "17d980c902fa5314e954508255a41c0854416d47",
23
"plugins": ["node-workspace"],
34
"group-pull-request-title-pattern": "chore: release ${component}",
45
"packages": {

README.md

+42-43
Large diffs are not rendered by default.

doc/CONFIGURATION.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ Bear in mind that a **transport** and **connection encryption** module are **req
7171
7272
Some available transports are:
7373

74-
- [@libp2p/tcp](https://github.com/libp2p/tree/master/packages/transport-tcp) (not available in browsers)
75-
- [@libp2p/webrtc](https://github.com/libp2p/js-libp2p/tree/master/packages/transport-webrtc)
76-
- [@libp2p/websockets](https://github.com/libp2p/js-libp2p/tree/master/packages/transport-websockets)
77-
- [@libp2p/webtransport](https://github.com/libp2p/js-libp2p/tree/master/packages/transport-webtransport)
74+
- [@libp2p/tcp](https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp) (not available in browsers)
75+
- [@libp2p/webrtc](https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc)
76+
- [@libp2p/websockets](https://github.com/libp2p/js-libp2p/tree/main/packages/transport-websockets)
77+
- [@libp2p/webtransport](https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webtransport)
7878

79-
If none of the available transports fulfils your needs, you can create a libp2p compatible transport. A libp2p transport just needs to be compliant with the [Transport Interface](https://github.com/libp2p/js-interfaces/tree/master/src/transport).
79+
If none of the available transports fulfils your needs, you can create a libp2p compatible transport. A libp2p transport just needs to be compliant with the [Transport Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/transport).
8080

8181
If you want to know more about libp2p transports, you should read the following content:
8282

@@ -89,12 +89,12 @@ If you want to know more about libp2p transports, you should read the following
8989
9090
Some available stream multiplexers are:
9191

92-
- [@libp2p/mplex](https://github.com/libp2p/js-libp2p/tree/master/packages/stream-multiplexer-mplex)
92+
- [@libp2p/mplex](https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex)
9393
- [@chainsafe/libp2p-yamux](https://github.com/chainsafe/js-libp2p-yamux)
9494

9595
Some transports such as WebRTC and WebTransport come with their own built-in stream multiplexing capabilities.
9696

97-
If none of the available stream multiplexers fulfills your needs, you can create a libp2p compatible stream multiplexer. A libp2p multiplexer just needs to be compliant with the [Stream Muxer Interface](https://github.com/libp2p/js-interfaces/tree/master/src/stream-muxer).
97+
If none of the available stream multiplexers fulfills your needs, you can create a libp2p compatible stream multiplexer. A libp2p multiplexer just needs to be compliant with the [Stream Muxer Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/stream-muxer).
9898

9999
If you want to know more about libp2p stream multiplexing, you should read the following content:
100100

@@ -113,9 +113,9 @@ If you configure multiple muxers for use in your application, js-libp2p will cho
113113
Some available connection encryption protocols:
114114

115115
- [@chainsafe/libp2p-noise](https://github.com/chainsafe/js-libp2p-noise)
116-
- [Plaintext](https://github.com/libp2p/js-libp2p/blob/master/src/insecure/index.ts) (Not for production use)
116+
- [@libp2p/plaintext](https://github.com/libp2p/js-libp2p/blob/main/src/packages/connection-encrypter-plaintext/index.ts) (Not for production use)
117117

118-
If none of the available connection encryption mechanisms fulfills your needs, you can create a libp2p compatible one. A libp2p connection encryption protocol just needs to be compliant with the [Crypto Interface](https://github.com/libp2p/js-interfaces/tree/master/src/crypto).
118+
If none of the available connection encryption mechanisms fulfills your needs, you can create a libp2p compatible one. A libp2p connection encryption protocol just needs to be compliant with the [Crypto Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/crypto).
119119

120120
If you want to know more about libp2p connection encryption, you should read the following content:
121121

@@ -128,12 +128,12 @@ If you want to know more about libp2p connection encryption, you should read the
128128
129129
Some available peer discovery modules are:
130130

131-
- [@libp2p/mdns](https://github.com/libp2p/js-libp2p/tree/master/packages/peer-discovery-mdns)
132-
- [@libp2p/bootstrap](https://github.com/libp2p/js-libp2p/tree/master/packages/peer-discovery-bootstrap)
133-
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht)
131+
- [@libp2p/mdns](https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-mdns)
132+
- [@libp2p/bootstrap](https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-bootstrap)
133+
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht)
134134
- [@chainsafe/discv5](https://github.com/chainsafe/discv5)
135135

136-
If none of the available peer discovery protocols fulfills your needs, you can create a libp2p compatible one. A libp2p peer discovery protocol just needs to be compliant with the [Peer Discovery Interface](https://github.com/libp2p/js-interfaces/tree/master/src/peer-discovery).
136+
If none of the available peer discovery protocols fulfills your needs, you can create a libp2p compatible one. A libp2p peer discovery protocol just needs to be compliant with the [Peer Discovery Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/peer-discovery).
137137

138138
If you want to know more about libp2p peer discovery, you should read the following content:
139139

@@ -145,11 +145,11 @@ If you want to know more about libp2p peer discovery, you should read the follow
145145
146146
Some available content routing modules are:
147147

148-
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht)
148+
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht)
149149
- [@libp2p/delegated-content-routing](https://github.com/libp2p/js-libp2p-delegated-content-routing)
150150
- [@libp2p/ipni-content-routing](https://github.com/libp2p/js-ipni-content-routing)
151151

152-
If none of the available content routing protocols fulfil your needs, you can create a libp2p compatible one. A libp2p content routing protocol just needs to be compliant with the [Content Routing Interface](https://github.com/libp2p/js-interfaces/tree/master/src/content-routing).
152+
If none of the available content routing protocols fulfil your needs, you can create a libp2p compatible one. A libp2p content routing protocol just needs to be compliant with the [Content Routing Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/content-routing).
153153

154154
If you want to know more about libp2p content routing, you should read the following content:
155155

@@ -161,10 +161,10 @@ If you want to know more about libp2p content routing, you should read the follo
161161
162162
Some available peer routing modules are:
163163

164-
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht)
164+
- [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht)
165165
- [@libp2p/delegated-peer-routing](https://github.com/libp2p/js-libp2p-delegated-peer-routing)
166166

167-
If none of the available peer routing protocols fulfills your needs, you can create a libp2p compatible one. A libp2p peer routing protocol just needs to be compliant with the [Peer Routing Interface](https://github.com/libp2p/js-interfaces/tree/master/src/peer-routing). **(WIP: This module is not yet implemented)**
167+
If none of the available peer routing protocols fulfills your needs, you can create a libp2p compatible one. A libp2p peer routing protocol just needs to be compliant with the [Peer Routing Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/peer-routing). **(WIP: This module is not yet implemented)**
168168

169169
If you want to know more about libp2p peer routing, you should read the following content:
170170

@@ -174,7 +174,7 @@ If you want to know more about libp2p peer routing, you should read the followin
174174

175175
> A DHT can provide content and peer routing capabilities in a p2p system, as well as peer discovery capabilities.
176176
177-
The DHT implementation currently available is [@libp2p/kad-dht](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht). This implementation is largely based on the Kademlia whitepaper, augmented with notions from S/Kademlia, Coral and mainlineDHT.
177+
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.
178178

179179
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.
180180

@@ -227,7 +227,7 @@ Besides the `modules` and `config`, libp2p allows other internal options and con
227227
- `addresses`: an object containing `listen`, `announce` and `announceFilter`:
228228
- `listen` addresses will be provided to the libp2p underlying transports for listening on them.
229229
- `announce` addresses will be used to compute the advertises that the node should advertise to the network.
230-
- `announceFilter`: filter function used to filter announced addresses programmatically: `(ma: Array<multiaddr>) => Array<multiaddr>`. Default: returns all addresses. [`libp2p-utils`](https://github.com/libp2p/js-libp2p-utils) provides useful [multiaddr utilities](https://github.com/libp2p/js-libp2p-utils/blob/master/API.md#multiaddr-isloopbackma) to create your filters.
230+
- `announceFilter`: filter function used to filter announced addresses programmatically: `(ma: Array<multiaddr>) => Array<multiaddr>`. Default: returns all addresses. [`libp2p-utils`](https://github.com/libp2p/js-libp2p/tree/main/packages/utils) provides useful [multiaddr utilities](https://libp2p.github.io/js-libp2p/modules/_libp2p_utils.html) to create your filters.
231231

232232
It's important to note that some services depend on others in order to function optimally, this is further explained in the examples below.
233233

@@ -866,7 +866,7 @@ const node = await createLibp2p({
866866

867867
#### Customizing Transports
868868

869-
Some Transports can be passed additional options when they are created. For example, [webRTC](../packages/transport-webrtc) accepts optional [DataChannel Options](https://github.com/libp2p/js-libp2p/blob/master/packages/transport-webrtc/src/stream.ts#L13-L17). In addition to libp2p passing itself and an `Upgrader` to handle connection upgrading, libp2p will also pass the options, if they are provided, from `config.transport`.
869+
Some Transports can be passed additional options when they are created. For example, [webRTC](../packages/transport-webrtc) accepts optional [DataChannel Options](https://github.com/libp2p/js-libp2p/blob/main/packages/transport-webrtc/src/stream.ts#L13-L17). In addition to libp2p passing itself and an `Upgrader` to handle connection upgrading, libp2p will also pass the options, if they are provided, from `config.transport`.
870870

871871
```js
872872
import { createLibp2p } from 'libp2p'

doc/GETTING_STARTED.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,6 @@ localStorage.setItem('debug', 'libp2p:websockets,libp2p:webtransport,libp2p:kad-
279279
There are a lot of other concepts within `libp2p`, that are not covered in this guide. For additional configuration options we recommend checking out the [Configuration Readme](./CONFIGURATION.md) and the [examples repo](https://github.com/libp2p/js-libp2p-examples). If you have any problems getting started, or if anything isn't clear, please let us know by submitting an issue!
280280

281281

282-
[transport]: https://github.com/libp2p/js-interfaces/tree/master/src/transport
283-
[crypto]: https://github.com/libp2p/js-interfaces/tree/master/src/crypto
284-
[streamMuxer]: https://github.com/libp2p/js-interfaces/tree/master/src/stream-muxer
282+
[transport]: https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/transport
283+
[crypto]: https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/crypto
284+
[streamMuxer]: https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/stream-muxer

doc/LIMITS.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ It's possible to limit the total amount of connections a node is able to make (c
2626

2727
We can also limit the number of connections in a 'pending' state. These connections have been opened by a remote peer but peer IDs have yet to be exchanged and/or connection encryption and multiplexing negotiated. Once this limit is hit further connections will be closed unless the remote peer has an address in the [allow list](#allowdeny-lists).
2828

29-
All fields are optional. The default values are defined in [src/connection-manager/index.ts](https://github.com/libp2p/js-libp2p/blob/master/src/connection-manager/index.ts) - please see that file for the current values.
29+
All fields are optional. The default values are defined in [src/connection-manager/index.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/libp2p/src/connection-manager/index.ts) - please see that file for the current values.
3030

3131
```ts
3232
import { createLibp2p } from 'libp2p'
@@ -83,7 +83,7 @@ await libp2p.peerStore.merge(peerId, {
8383

8484
To prevent individual peers from opening multiple connections to a node, an `inboundConnectionThreshold` is configurable. This is the number of connections per second an individual peer can open to a node, once this threshold is crossed all further connections opened by that peer will be rejected until the threshold resets in the next second.
8585

86-
All fields are optional. The default values are defined in [src/connection-manager/index.ts](https://github.com/libp2p/js-libp2p/blob/master/src/connection-manager/index.ts) - please see that file for the current values.
86+
All fields are optional. The default values are defined in [src/connection-manager/index.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/libp2p/src/connection-manager/index.ts) - please see that file for the current values.
8787

8888
```ts
8989
import { createLibp2p } from 'libp2p'
@@ -109,9 +109,9 @@ These settings are done on a per-muxer basis, please see the README of the relev
109109

110110
### Mplex
111111

112-
[@libp2p/mplex](https://github.com/libp2p/js-libp2p-mplex) supports the following.
112+
[@libp2p/mplex](https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex) supports the following.
113113

114-
All fields are optional. The default values are defined in [@libp2p/mplex/src/mplex.ts](https://github.com/libp2p/js-libp2p-mplex/blob/master/src/mplex.ts) - please see that file for the current values.
114+
All fields are optional. The default values are defined in [@libp2p/mplex/src/mplex.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/stream-multiplexer-mplex/src/mplex.ts) - please see that file for the current values.
115115

116116
```ts
117117
import { createLibp2p } from 'libp2p'
@@ -186,13 +186,13 @@ const node = await createLibp2p({
186186

187187
### Protocol limits
188188

189-
When registering listeners for custom protocols, the maximum number of simultaneously open inbound and outbound streams per-connection can be specified. If not specified these will default to [32 inbound streams and 64 outbound streams](https://github.com/libp2p/js-libp2p/blob/master/src/registrar.ts#L14-L15).
189+
When registering listeners for custom protocols, the maximum number of simultaneously open inbound and outbound streams per-connection can be specified. If not specified these will default to [32 inbound streams and 64 outbound streams](https://github.com/libp2p/js-libp2p/blob/main/packages/libp2p/src/registrar.ts#L14-L15).
190190

191191
If more than this number of streams for the given protocol are opened on a single connection, subsequent new streams for that protocol will be immediately reset.
192192

193193
Since incoming stream data is buffered until it is consumed, you should attempt to specify the minimum amount of streams required to keep memory usage to a minimum.
194194

195-
All fields are optional. The default values are defined in [src/registrar.ts](https://github.com/libp2p/js-libp2p/blob/master/src/registrar.ts) - please see that file for the current values.
195+
All fields are optional. The default values are defined in [src/registrar.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/libp2p/src/registrar.ts) - please see that file for the current values.
196196

197197
```ts
198198
import { createLibp2p } from 'libp2p';
@@ -220,9 +220,9 @@ A non-exhaustive list follows:
220220

221221
### TCP
222222

223-
The [@libp2p/tcp](https://github.com/libp2p/js-libp2p-tcp) transport allows additional limits to be configured.
223+
The [@libp2p/tcp](https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp) transport allows additional limits to be configured.
224224

225-
All fields are optional. The full list of options is defined in [@libp2p/tcp/src/index.ts](https://github.com/libp2p/js-libp2p-tcp/blob/master/src/index.ts) - please see that file for more details.
225+
All fields are optional. The full list of options is defined in [@libp2p/tcp/src/index.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/transport-tcp/src/index.ts) - please see that file for more details.
226226

227227
```ts
228228
import { createLibp2p } from 'libp2p'

doc/METRICS.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ Metrics allow you to gather run time statistics on your libp2p node.
1616
- See the [API](./API.md) for Metrics usage. Metrics in libp2p do not emit events, as such applications wishing to read Metrics will need to do so actively. This ensures that the system is not unnecessarily firing update notifications.
1717
- For large installations you may wish to combine the statistics with a visualizer such as [Graphana](https://grafana.com/)
1818

19-
There are two types of metrics [`StreamMetrics`](https://github.com/libp2p/js-libp2p-interfaces/blob/master/packages/interface-metrics/src/index.ts#L66-L115) and [`ComponentMetrics`](https://github.com/libp2p/js-libp2p-interfaces/blob/master/packages/interface-metrics/src/index.ts#L183-L193). `StreamMetrics` track data in and out of streams, `ComponentMetrics` allow system components to record metrics that are of interest to the observer.
20-
2119
Although designed to primarily integrate with tools such as [Prometheus](https://prometheus.io/) it does not introduce any dependencies that require you to use any particular tool to store or graph metrics.
2220

2321
## Tracking
@@ -28,7 +26,7 @@ Although designed to primarily integrate with tools such as [Prometheus](https:/
2826

2927
### Enable metrics
3028

31-
First enable metrics tracking by supplying a [Metrics](https://www.npmjs.com/package/@libp2p/interface-metrics) implementation:
29+
First enable metrics tracking by supplying a [Metrics](https://github.com/libp2p/js-libp2p/blob/main/packages/interface/src/metrics/index.ts#L150) implementation:
3230

3331
```ts
3432
import { createLibp2p } from 'libp2p'

0 commit comments

Comments
 (0)