Skip to content

Commit a7eb258

Browse files
chore: release main (#2240)
* chore: add contents permission to gh token * chore: update token perms * chore: update token perms * chore: release main --------- Co-authored-by: achingbrain <alex@achingbrain.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8f921ee commit a7eb258

File tree

395 files changed

+2154
-1827
lines changed

Some content is hidden

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

395 files changed

+2154
-1827
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ jobs:
222222
permissions:
223223
id-token: write
224224
contents: write
225+
pull-requests: write
225226
steps:
226227
- uses: GoogleCloudPlatform/release-please-action@v2
227228
id: release

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"interop":"1.0.14","packages/crypto":"2.0.8","packages/interface":"0.1.6","packages/interface-compliance-tests":"4.1.5","packages/interface-internal":"0.1.9","packages/kad-dht":"10.0.15","packages/keychain":"3.0.8","packages/libp2p":"0.46.21","packages/logger":"3.1.0","packages/metrics-prometheus":"2.0.12","packages/multistream-select":"4.0.6","packages/peer-collections":"4.0.8","packages/peer-discovery-bootstrap":"9.0.12","packages/peer-discovery-mdns":"9.0.14","packages/peer-id":"3.0.6","packages/peer-id-factory":"3.0.8","packages/peer-record":"6.0.9","packages/peer-store":"9.0.9","packages/protocol-perf":"2.0.1","packages/pubsub":"8.0.10","packages/pubsub-floodsub":"8.0.13","packages/stream-multiplexer-mplex":"9.0.12","packages/transport-tcp":"8.0.13","packages/transport-webrtc":"3.2.11","packages/transport-websockets":"7.0.13","packages/transport-webtransport":"3.1.10","packages/utils":"4.0.7"}
1+
{"interop":"2.0.0","packages/connection-encrypter-plaintext":"1.0.0","packages/crypto":"3.0.0","packages/interface":"1.0.0","packages/interface-compliance-tests":"5.0.0","packages/interface-internal":"0.1.10","packages/kad-dht":"11.0.0","packages/keychain":"4.0.0","packages/libp2p":"1.0.0","packages/logger":"4.0.0","packages/metrics-prometheus":"3.0.0","packages/multistream-select":"4.0.7","packages/peer-collections":"4.0.9","packages/peer-discovery-bootstrap":"10.0.0","packages/peer-discovery-mdns":"10.0.0","packages/peer-id":"4.0.0","packages/peer-id-factory":"3.0.9","packages/peer-record":"6.0.10","packages/peer-store":"9.0.10","packages/protocol-autonat":"1.0.0","packages/protocol-dcutr":"1.0.0","packages/protocol-fetch":"1.0.0","packages/protocol-identify":"1.0.0","packages/protocol-perf":"3.0.0","packages/protocol-ping":"1.0.0","packages/pubsub":"8.0.11","packages/pubsub-floodsub":"8.0.14","packages/stream-multiplexer-mplex":"10.0.0","packages/transport-circuit-relay-v2":"1.0.0","packages/transport-tcp":"9.0.0","packages/transport-webrtc":"4.0.0","packages/transport-websockets":"8.0.0","packages/transport-webtransport":"4.0.0","packages/upnp-nat":"1.0.0","packages/utils":"5.0.0"}

doc/migrations/v0.46-v1.0.0.md

+106-47
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,56 @@ A migration guide for refactoring your application code from libp2p `v0.46` to `
55

66
## Table of Contents <!-- omit in toc -->
77

8-
- [AutoNAT](#autonat)
9-
- [Ping](#ping)
10-
- [Identify](#identify)
11-
- [DCUtR](#dcutr)
12-
- [Fetch](#fetch)
13-
- [KeyChain](#keychain)
14-
- [UPnPNat](#upnpnat)
15-
- [Perf](#perf)
16-
- [Plaintext](#plaintext)
17-
- [Pnet](#pnet)
8+
- [Type imports](#type-imports)
9+
- [Extracted modules](#extracted-modules)
10+
- [Services](#services)
11+
- [AutoNAT](#autonat)
12+
- [Ping](#ping)
13+
- [Identify](#identify)
14+
- [DCUtR](#dcutr)
15+
- [Fetch](#fetch)
16+
- [UPnPNat](#upnpnat)
17+
- [Perf](#perf)
18+
- [Connection encryption](#connection-encryption)
19+
- [Plaintext](#plaintext)
20+
- [Misc](#misc)
21+
- [KeyChain](#keychain)
22+
- [Pnet](#pnet)
1823
- [Metrics](#metrics)
1924
- [Connection Manager](#connection-manager)
2025

21-
## AutoNAT
26+
## Type imports
27+
28+
All exports from `@libp2p/interface` and `@libp2p/interface-internal` are
29+
now exported from the root of the module, no more having to work out which
30+
subpath to import from.
31+
32+
**Before**
33+
34+
```ts
35+
import type { PeerId } from '@libp2p/interface/peer-id'
36+
import type { Connection } from '@libp2p/interface/connection'
37+
import type { Stream } from '@libp2p/interface/stream-muxer'
38+
```
39+
40+
**After**
41+
42+
```ts
43+
import type { Connection, PeerId, Stream } from '@libp2p/interface'
44+
```
45+
46+
## Extracted modules
47+
48+
`js-libp2p` has always had a focus on being a modular, composable ecosystem of
49+
modules. `v1.x.x` takes this further and extracts all of the optional
50+
functionality out of the core and into modules that you can include in your app
51+
if you need them, or omit them if you don't.
52+
53+
### Services
54+
55+
These modules can be configured as services to enable optional functionality.
56+
57+
#### AutoNAT
2258

2359
The AutoNAT service is now published in its own package.
2460

@@ -48,7 +84,7 @@ const node = await createLibp2p({
4884
})
4985
```
5086

51-
## Ping
87+
#### Ping
5288

5389
The Ping service is now published in its own package.
5490

@@ -78,7 +114,7 @@ const node = await createLibp2p({
78114
})
79115
```
80116

81-
## Identify
117+
#### Identify
82118

83119
The Identify service is now published in its own package.
84120

@@ -108,7 +144,7 @@ const node = await createLibp2p({
108144
})
109145
```
110146

111-
## DCUtR
147+
#### DCUtR
112148

113149
The DCUtR service is now published in its own package.
114150

@@ -138,7 +174,7 @@ const node = await createLibp2p({
138174
})
139175
```
140176

141-
## Fetch
177+
#### Fetch
142178

143179
The Fetch service is now published in its own package.
144180

@@ -168,36 +204,8 @@ const node = await createLibp2p({
168204
})
169205
```
170206

171-
## KeyChain
172-
173-
The KeyChain object is no longer included on Libp2p and must be instantiated explicitly if desired.
174-
175-
**Before**
176-
177-
```ts
178-
import type { KeyChain } from '@libp2p/interface/keychain'
179-
180-
const libp2p = await createLibp2p(...)
181-
182-
const keychain: KeyChain = libp2p.keychain
183-
```
184-
185-
**After**
186-
187-
```ts
188-
import { keychain, type Keychain } from '@libp2p/keychain'
189-
190-
const libp2p = await createLibp2p({
191-
...
192-
services: {
193-
keychain: keychain()
194-
}
195-
})
196-
197-
const keychain: Keychain = libp2p.services.keychain
198-
```
199207

200-
## UPnPNat
208+
#### UPnPNat
201209

202210
The UPnPNat service module is now published in its own package.
203211

@@ -227,7 +235,7 @@ const node = await createLibp2p({
227235
})
228236
```
229237

230-
## Perf
238+
#### Perf
231239

232240
The Perf service module exports have been renamed in line with the other changes
233241
here.
@@ -258,7 +266,9 @@ const node = await createLibp2p({
258266
})
259267
```
260268

261-
## Plaintext
269+
### Connection encryption
270+
271+
#### Plaintext
262272

263273
The Plaintext connection encrypter module is now published in its own package.
264274

@@ -290,20 +300,69 @@ const node = await createLibp2p({
290300
})
291301
```
292302

293-
## Pnet
303+
304+
### Misc
305+
306+
#### KeyChain
307+
308+
The KeyChain object is no longer included on Libp2p and must be instantiated
309+
explicitly if desired.
310+
311+
**Before**
312+
313+
```ts
314+
import type { KeyChain } from '@libp2p/interface/keychain'
315+
316+
const libp2p = await createLibp2p(...)
317+
318+
const keychain: KeyChain = libp2p.keychain
319+
```
320+
321+
**After**
322+
323+
```ts
324+
import { keychain, type Keychain } from '@libp2p/keychain'
325+
326+
const libp2p = await createLibp2p({
327+
...
328+
services: {
329+
keychain: keychain()
330+
}
331+
})
332+
333+
const keychain: Keychain = libp2p.services.keychain
334+
```
335+
336+
### Pnet
294337

295338
The pnet module is now published in its own package.
296339

297340
**Before**
298341

299342
```ts
343+
import { createLibp2p } from 'libp2p'
300344
import { preSharedKey, generateKey } from 'libp2p/pnet'
345+
346+
const node = await createLibp2p({
347+
// ...other options
348+
connectionProtector: preSharedKey({
349+
psk: generateKey(new Uint8Array(95))
350+
})
351+
})
301352
```
302353

303354
**After**
304355

305356
```ts
357+
import { createLibp2p } from 'libp2p'
306358
import { preSharedKey, generateKey } from '@libp2p/pnet'
359+
360+
const node = await createLibp2p({
361+
// ...other options
362+
connectionProtector: preSharedKey({
363+
psk: generateKey(new Uint8Array(95))
364+
})
365+
})
307366
```
308367

309368
## Metrics

doc/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
},
2525
"dependencies": {
2626
"@chainsafe/libp2p-yamux": "^5.0.0",
27-
"@libp2p/interface": "^0.1.0",
28-
"@libp2p/mplex": "^9.0.0",
29-
"@libp2p/prometheus-metrics": "^2.0.0",
30-
"@libp2p/tcp": "^8.0.0",
27+
"@libp2p/interface": "^1.0.0",
28+
"@libp2p/mplex": "^10.0.0",
29+
"@libp2p/prometheus-metrics": "^3.0.0",
30+
"@libp2p/tcp": "^9.0.0",
3131
"aegir": "^41.0.2",
32-
"libp2p": "^0.46.0",
32+
"libp2p": "^1.0.0",
3333
"prom-client": "^15.0.0"
3434
},
3535
"private": true

interop/CHANGELOG.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## [2.0.0](https://www.github.com/libp2p/js-libp2p/compare/multidim-interop-v1.0.14...multidim-interop-v2.0.0) (2023-11-28)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* imports from `libp2p/circuit-relay` should be updated to `@libp2p/circuit-relay-v2`
9+
* imports from `libp2p/identify` need to change to `@libp2p/identify`
10+
* imports from `libp2p/ping` must be updated to `@libp2p/ping`
11+
12+
### Code Refactoring
13+
14+
* extract circuit relay v2 to separate module ([#2222](https://www.github.com/libp2p/js-libp2p/issues/2222)) ([24afba3](https://www.github.com/libp2p/js-libp2p/commit/24afba30004fb7f24af1f0180229bb164340f00b))
15+
* extract identify service into separate module ([#2219](https://www.github.com/libp2p/js-libp2p/issues/2219)) ([72c2f77](https://www.github.com/libp2p/js-libp2p/commit/72c2f775bd85bd4928048dda0fd14740d6fb6a69))
16+
* extract ping service into separate module ([#2218](https://www.github.com/libp2p/js-libp2p/issues/2218)) ([556282a](https://www.github.com/libp2p/js-libp2p/commit/556282afdc9b328fd58df1045dc7c792199be932))
17+
18+
19+
### Dependencies
20+
21+
* The following workspace dependencies were updated
22+
* dependencies
23+
* @libp2p/circuit-relay-v2 bumped from ^0.0.0 to ^1.0.0
24+
* @libp2p/identify bumped from ^0.0.0 to ^1.0.0
25+
* @libp2p/mplex bumped from ^9.0.12 to ^10.0.0
26+
* @libp2p/ping bumped from ^0.0.0 to ^1.0.0
27+
* @libp2p/tcp bumped from ^8.0.13 to ^9.0.0
28+
* @libp2p/webrtc bumped from ^3.2.11 to ^4.0.0
29+
* @libp2p/websockets bumped from ^7.0.13 to ^8.0.0
30+
* @libp2p/webtransport bumped from ^3.1.10 to ^4.0.0
31+
* libp2p bumped from ^0.46.21 to ^1.0.0
32+
333
### [1.0.14](https://www.github.com/libp2p/js-libp2p/compare/multidim-interop-v1.0.13...multidim-interop-v1.0.14) (2023-11-10)
434

535

@@ -172,4 +202,4 @@
172202
* @libp2p/webrtc bumped from ^3.0.0 to ^3.1.10
173203
* @libp2p/websockets bumped from ^7.0.0 to ^7.0.6
174204
* @libp2p/webtransport bumped from ^3.0.0 to ^3.0.10
175-
* libp2p bumped from ^0.46.0 to ^0.46.10
205+
* libp2p bumped from ^0.46.0 to ^0.46.10

interop/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@libp2p/multidim-interop",
3-
"version": "1.0.14",
3+
"version": "2.0.0",
44
"description": "Multidimensional interop tests",
55
"author": "Glen De Cauwsemaecker <glen@littlebearlabs.io> / @marcopolo",
66
"license": "Apache-2.0 OR MIT",
@@ -53,18 +53,18 @@
5353
"dependencies": {
5454
"@chainsafe/libp2p-noise": "^13.0.0",
5555
"@chainsafe/libp2p-yamux": "^5.0.0",
56-
"@libp2p/circuit-relay-v2": "^0.0.0",
57-
"@libp2p/identify": "^0.0.0",
58-
"@libp2p/mplex": "^9.0.12",
59-
"@libp2p/ping": "^0.0.0",
60-
"@libp2p/tcp": "^8.0.13",
61-
"@libp2p/webrtc": "^3.2.11",
62-
"@libp2p/websockets": "^7.0.13",
63-
"@libp2p/webtransport": "^3.1.10",
56+
"@libp2p/circuit-relay-v2": "^1.0.0",
57+
"@libp2p/identify": "^1.0.0",
58+
"@libp2p/mplex": "^10.0.0",
59+
"@libp2p/ping": "^1.0.0",
60+
"@libp2p/tcp": "^9.0.0",
61+
"@libp2p/webrtc": "^4.0.0",
62+
"@libp2p/websockets": "^8.0.0",
63+
"@libp2p/webtransport": "^4.0.0",
6464
"@multiformats/mafmt": "^12.1.6",
6565
"@multiformats/multiaddr": "^12.1.10",
6666
"aegir": "^41.0.2",
67-
"libp2p": "^0.46.21",
67+
"libp2p": "^1.0.0",
6868
"redis": "^4.5.1"
6969
},
7070
"browser": {

interop/test/ping.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ describe('ping test', function () {
122122
skipSecureChannel = true
123123
skipMuxer = true
124124
// Setup yamux and noise to connect to the relay node
125+
// @ts-expect-error TODO: yamux needs to be upgraded
125126
options.streamMuxers = [yamux()]
127+
// @ts-expect-error TODO: noise needs to be upgraded
126128
options.connectionEncryption = [noise()]
127129
break
128130
default:
@@ -132,6 +134,7 @@ describe('ping test', function () {
132134
if (!skipSecureChannel) {
133135
switch (SECURE_CHANNEL) {
134136
case 'noise':
137+
// @ts-expect-error TODO: noise needs to be upgraded
135138
options.connectionEncryption = [noise()]
136139
break
137140
default:
@@ -145,6 +148,7 @@ describe('ping test', function () {
145148
options.streamMuxers = [mplex()]
146149
break
147150
case 'yamux':
151+
// @ts-expect-error TODO: yamux needs to be upgraded
148152
options.streamMuxers = [yamux()]
149153
break
150154
default:

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"docs:no-publish": "aegir docs --publish false -- --exclude interop --exclude doc"
3636
},
3737
"devDependencies": {
38-
"aegir": "^41.0.2"
38+
"aegir": "^41.0.2",
39+
"npm-run-all": "^4.1.5"
3940
},
4041
"eslintConfig": {
4142
"extends": "ipfs",

0 commit comments

Comments
 (0)