From 5feb1bb30909cbb97645412984fc07bb32b218f9 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 18 Nov 2024 08:17:11 +0000 Subject: [PATCH 01/10] chore: release main (#2793) * chore: release main --- .release-please-manifest.json | 2 +- packages/integration-tests/package.json | 2 +- .../interface-compliance-tests/CHANGELOG.md | 14 ++++++++++++++ .../interface-compliance-tests/package.json | 14 +++++++------- packages/interface-internal/CHANGELOG.md | 14 ++++++++++++++ packages/interface-internal/package.json | 4 ++-- packages/kad-dht/CHANGELOG.md | 19 +++++++++++++++++++ packages/kad-dht/package.json | 12 ++++++------ packages/libp2p/CHANGELOG.md | 17 +++++++++++++++++ packages/libp2p/package.json | 10 +++++----- packages/metrics-devtools/CHANGELOG.md | 9 +++++++++ packages/metrics-devtools/package.json | 4 ++-- packages/metrics-prometheus/CHANGELOG.md | 9 +++++++++ packages/metrics-prometheus/package.json | 4 ++-- packages/peer-collections/CHANGELOG.md | 9 +++++++++ packages/peer-collections/package.json | 4 ++-- .../peer-discovery-bootstrap/CHANGELOG.md | 11 +++++++++++ .../peer-discovery-bootstrap/package.json | 6 +++--- packages/peer-discovery-mdns/CHANGELOG.md | 12 ++++++++++++ packages/peer-discovery-mdns/package.json | 8 ++++---- packages/peer-record/CHANGELOG.md | 9 +++++++++ packages/peer-record/package.json | 4 ++-- packages/peer-store/CHANGELOG.md | 9 +++++++++ packages/peer-store/package.json | 4 ++-- packages/pnet/CHANGELOG.md | 9 +++++++++ packages/pnet/package.json | 4 ++-- packages/protocol-autonat/CHANGELOG.md | 10 ++++++++++ packages/protocol-autonat/package.json | 6 +++--- packages/protocol-dcutr/CHANGELOG.md | 10 ++++++++++ packages/protocol-dcutr/package.json | 6 +++--- packages/protocol-echo/CHANGELOG.md | 14 ++++++++++++++ packages/protocol-echo/package.json | 4 ++-- packages/protocol-fetch/CHANGELOG.md | 9 +++++++++ packages/protocol-fetch/package.json | 4 ++-- packages/protocol-identify/CHANGELOG.md | 11 +++++++++++ packages/protocol-identify/package.json | 8 ++++---- packages/protocol-perf/CHANGELOG.md | 11 +++++++++++ packages/protocol-perf/package.json | 6 +++--- packages/protocol-ping/CHANGELOG.md | 14 ++++++++++++++ packages/protocol-ping/package.json | 4 ++-- packages/pubsub-floodsub/CHANGELOG.md | 12 ++++++++++++ packages/pubsub-floodsub/package.json | 8 ++++---- packages/pubsub/CHANGELOG.md | 11 +++++++++++ packages/pubsub/package.json | 8 ++++---- .../stream-multiplexer-mplex/CHANGELOG.md | 11 +++++++++++ .../stream-multiplexer-mplex/package.json | 6 +++--- .../transport-circuit-relay-v2/CHANGELOG.md | 19 +++++++++++++++++++ .../transport-circuit-relay-v2/package.json | 12 ++++++------ packages/transport-memory/CHANGELOG.md | 9 +++++++++ packages/transport-memory/package.json | 2 +- packages/transport-tcp/CHANGELOG.md | 9 +++++++++ packages/transport-tcp/package.json | 4 ++-- packages/transport-webrtc/CHANGELOG.md | 17 +++++++++++++++++ packages/transport-webrtc/package.json | 8 ++++---- packages/transport-websockets/CHANGELOG.md | 9 +++++++++ packages/transport-websockets/package.json | 4 ++-- packages/transport-webtransport/CHANGELOG.md | 12 ++++++++++++ packages/transport-webtransport/package.json | 8 ++++---- packages/upnp-nat/CHANGELOG.md | 16 ++++++++++++++++ packages/upnp-nat/package.json | 6 +++--- packages/utils/CHANGELOG.md | 12 ++++++++++++ packages/utils/package.json | 2 +- 62 files changed, 451 insertions(+), 94 deletions(-) create mode 100644 packages/transport-memory/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fec9fa0774..758847d692 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"packages/connection-encrypter-plaintext":"2.0.10","packages/connection-encrypter-tls":"2.0.10","packages/crypto":"5.0.6","packages/interface":"2.2.0","packages/interface-compliance-tests":"6.1.8","packages/interface-internal":"2.0.10","packages/kad-dht":"14.1.0","packages/keychain":"5.0.9","packages/libp2p":"2.2.1","packages/logger":"5.1.3","packages/metrics-devtools":"1.1.8","packages/metrics-prometheus":"4.2.4","packages/metrics-simple":"1.2.6","packages/multistream-select":"6.0.8","packages/peer-collections":"6.0.10","packages/peer-discovery-bootstrap":"11.0.10","packages/peer-discovery-mdns":"11.0.10","packages/peer-id":"5.0.7","packages/peer-record":"8.0.10","packages/peer-store":"11.0.10","packages/pnet":"2.0.10","packages/protocol-autonat":"2.0.10","packages/protocol-dcutr":"2.0.10","packages/protocol-echo":"2.1.1","packages/protocol-fetch":"2.0.10","packages/protocol-identify":"3.0.10","packages/protocol-perf":"4.0.10","packages/protocol-ping":"2.0.10","packages/pubsub":"10.0.10","packages/pubsub-floodsub":"10.1.8","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.10","packages/transport-circuit-relay-v2":"3.1.0","packages/transport-memory":"0.0.0","packages/transport-tcp":"10.0.11","packages/transport-webrtc":"5.0.16","packages/transport-websockets":"9.0.11","packages/transport-webtransport":"5.0.16","packages/upnp-nat":"2.0.10","packages/utils":"6.1.3"} +{"packages/connection-encrypter-plaintext":"2.0.10","packages/connection-encrypter-tls":"2.0.10","packages/crypto":"5.0.6","packages/interface":"2.2.0","packages/interface-compliance-tests":"6.1.9","packages/interface-internal":"2.1.0","packages/kad-dht":"14.1.1","packages/keychain":"5.0.9","packages/libp2p":"2.3.0","packages/logger":"5.1.3","packages/metrics-devtools":"1.1.9","packages/metrics-prometheus":"4.2.5","packages/metrics-simple":"1.2.6","packages/multistream-select":"6.0.8","packages/peer-collections":"6.0.11","packages/peer-discovery-bootstrap":"11.0.11","packages/peer-discovery-mdns":"11.0.11","packages/peer-id":"5.0.7","packages/peer-record":"8.0.11","packages/peer-store":"11.0.11","packages/pnet":"2.0.11","packages/protocol-autonat":"2.0.11","packages/protocol-dcutr":"2.0.11","packages/protocol-echo":"2.1.2","packages/protocol-fetch":"2.0.11","packages/protocol-identify":"3.0.11","packages/protocol-perf":"4.0.11","packages/protocol-ping":"2.0.11","packages/pubsub":"10.0.11","packages/pubsub-floodsub":"10.1.9","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.11","packages/transport-circuit-relay-v2":"3.1.1","packages/transport-memory":"1.0.0","packages/transport-tcp":"10.0.12","packages/transport-webrtc":"5.0.17","packages/transport-websockets":"9.0.12","packages/transport-webtransport":"5.0.17","packages/upnp-nat":"2.0.11","packages/utils":"6.2.0"} diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 3c602e5ac1..e40ccfd3f4 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -53,7 +53,7 @@ "@libp2p/kad-dht": "^14.0.0", "@libp2p/logger": "^5.0.0", "@libp2p/mdns": "^11.0.0", - "@libp2p/memory": "^0.0.0", + "@libp2p/memory": "^1.0.0", "@libp2p/mplex": "^11.0.0", "@libp2p/peer-id": "^5.0.0", "@libp2p/ping": "^2.0.0", diff --git a/packages/interface-compliance-tests/CHANGELOG.md b/packages/interface-compliance-tests/CHANGELOG.md index 9571bf14c6..8b250c2e03 100644 --- a/packages/interface-compliance-tests/CHANGELOG.md +++ b/packages/interface-compliance-tests/CHANGELOG.md @@ -75,6 +75,20 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [6.1.9](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.8...interface-compliance-tests-v6.1.9) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/echo bumped from ^2.1.1 to ^2.1.2 + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/memory bumped from ^0.0.0 to ^1.0.0 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * libp2p bumped from ^2.2.1 to ^2.3.0 + ## [6.1.8](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.7...interface-compliance-tests-v6.1.8) (2024-10-28) diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index 6dcbbfc550..b2b5ef2a47 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface-compliance-tests", - "version": "6.1.8", + "version": "6.1.9", "description": "Compliance tests for JS libp2p interfaces", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme", @@ -105,16 +105,16 @@ }, "dependencies": { "@libp2p/crypto": "^5.0.6", - "@libp2p/echo": "^2.1.1", + "@libp2p/echo": "^2.1.2", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/logger": "^5.1.3", - "@libp2p/memory": "^0.0.0", + "@libp2p/memory": "^1.0.0", "@libp2p/multistream-select": "^6.0.8", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", "@libp2p/plaintext": "^2.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.5.0", "abortable-iterator": "^5.0.1", @@ -131,7 +131,7 @@ "it-pushable": "^3.2.3", "it-stream-types": "^2.0.1", "it-to-buffer": "^4.0.7", - "libp2p": "^2.2.1", + "libp2p": "^2.3.0", "merge-options": "^3.0.4", "p-defer": "^4.0.1", "p-event": "^6.0.1", diff --git a/packages/interface-internal/CHANGELOG.md b/packages/interface-internal/CHANGELOG.md index 2f503bf9f1..199295116b 100644 --- a/packages/interface-internal/CHANGELOG.md +++ b/packages/interface-internal/CHANGELOG.md @@ -32,6 +32,20 @@ * dependencies * @libp2p/peer-collections bumped from ^5.1.3 to ^5.1.4 +## [2.1.0](https://github.com/libp2p/js-libp2p/compare/interface-internal-v2.0.10...interface-internal-v2.1.0) (2024-11-16) + + +### Features + +* add dns mappings to address manager ([#2818](https://github.com/libp2p/js-libp2p/issues/2818)) ([7dcabb8](https://github.com/libp2p/js-libp2p/commit/7dcabb884c37dfba69e3ce427544ab05209d137b)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/interface-internal-v2.0.9...interface-internal-v2.0.10) (2024-10-28) diff --git a/packages/interface-internal/package.json b/packages/interface-internal/package.json index 56d77beaa2..1db60289b8 100644 --- a/packages/interface-internal/package.json +++ b/packages/interface-internal/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface-internal", - "version": "2.0.10", + "version": "2.1.0", "description": "Interfaces implemented by internal libp2p components", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme", @@ -49,7 +49,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/peer-collections": "^6.0.11", "@multiformats/multiaddr": "^12.2.3", "progress-events": "^1.0.0", "uint8arraylist": "^2.4.8" diff --git a/packages/kad-dht/CHANGELOG.md b/packages/kad-dht/CHANGELOG.md index ac9d8ffbfd..0e96495e25 100644 --- a/packages/kad-dht/CHANGELOG.md +++ b/packages/kad-dht/CHANGELOG.md @@ -106,6 +106,25 @@ * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 * @libp2p/peer-store bumped from ^10.0.9 to ^10.0.10 +## [14.1.1](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.1.0...kad-dht-v14.1.1) (2024-11-16) + + +### Bug Fixes + +* increase providers validity to 48 hours ([#2801](https://github.com/libp2p/js-libp2p/issues/2801)) ([4329553](https://github.com/libp2p/js-libp2p/commit/43295539045639fe003e762dede1ec1a5aa60c77)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + * @libp2p/peer-store bumped from ^11.0.10 to ^11.0.11 + ## [14.1.0](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.0.2...kad-dht-v14.1.0) (2024-10-28) diff --git a/packages/kad-dht/package.json b/packages/kad-dht/package.json index 0f165987f6..1b294462aa 100644 --- a/packages/kad-dht/package.json +++ b/packages/kad-dht/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/kad-dht", - "version": "14.1.0", + "version": "14.1.1", "description": "JavaScript implementation of the Kad-DHT for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht#readme", @@ -59,11 +59,11 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/interface-internal": "^2.1.0", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", "@libp2p/record": "^4.0.4", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "any-signal": "^4.1.1", "interface-datastore": "^8.3.0", @@ -88,9 +88,9 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", - "@libp2p/peer-store": "^11.0.10", + "@libp2p/peer-store": "^11.0.11", "@types/lodash.random": "^3.2.9", "@types/lodash.range": "^3.2.9", "@types/sinon": "^17.0.3", diff --git a/packages/libp2p/CHANGELOG.md b/packages/libp2p/CHANGELOG.md index 3c3d81b682..c48d05fbb0 100644 --- a/packages/libp2p/CHANGELOG.md +++ b/packages/libp2p/CHANGELOG.md @@ -110,6 +110,23 @@ * @libp2p/tcp bumped from ^9.0.14 to ^9.0.15 * @libp2p/websockets bumped from ^8.0.14 to ^8.0.15 +## [2.3.0](https://github.com/libp2p/js-libp2p/compare/libp2p-v2.2.1...libp2p-v2.3.0) (2024-11-16) + + +### Features + +* add dns mappings to address manager ([#2818](https://github.com/libp2p/js-libp2p/issues/2818)) ([7dcabb8](https://github.com/libp2p/js-libp2p/commit/7dcabb884c37dfba69e3ce427544ab05209d137b)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + * @libp2p/peer-store bumped from ^11.0.10 to ^11.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [2.2.1](https://github.com/libp2p/js-libp2p/compare/libp2p-v2.2.0...libp2p-v2.2.1) (2024-10-28) diff --git a/packages/libp2p/package.json b/packages/libp2p/package.json index 46f818a813..6d59b75466 100644 --- a/packages/libp2p/package.json +++ b/packages/libp2p/package.json @@ -1,6 +1,6 @@ { "name": "libp2p", - "version": "2.2.1", + "version": "2.3.0", "description": "JavaScript implementation of libp2p, a modular peer to peer network stack", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme", @@ -87,13 +87,13 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/logger": "^5.1.3", "@libp2p/multistream-select": "^6.0.8", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-store": "^11.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/peer-store": "^11.0.11", + "@libp2p/utils": "^6.2.0", "@multiformats/dns": "^1.0.6", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", diff --git a/packages/metrics-devtools/CHANGELOG.md b/packages/metrics-devtools/CHANGELOG.md index 68b0234652..95f2ae6853 100644 --- a/packages/metrics-devtools/CHANGELOG.md +++ b/packages/metrics-devtools/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.1.9](https://github.com/libp2p/js-libp2p/compare/devtools-metrics-v1.1.8...devtools-metrics-v1.1.9) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + ## [1.1.8](https://github.com/libp2p/js-libp2p/compare/devtools-metrics-v1.1.7...devtools-metrics-v1.1.8) (2024-10-28) diff --git a/packages/metrics-devtools/package.json b/packages/metrics-devtools/package.json index 84cad8b587..2423e2812b 100644 --- a/packages/metrics-devtools/package.json +++ b/packages/metrics-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/devtools-metrics", - "version": "1.1.8", + "version": "1.1.9", "description": "Collect libp2p metrics and send them to browser DevTools", "author": "", "license": "Apache-2.0 OR MIT", @@ -69,7 +69,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/logger": "^5.1.3", "@libp2p/peer-id": "^5.0.7", "@libp2p/simple-metrics": "^1.2.6", diff --git a/packages/metrics-prometheus/CHANGELOG.md b/packages/metrics-prometheus/CHANGELOG.md index 195741af52..ea7a37a0cc 100644 --- a/packages/metrics-prometheus/CHANGELOG.md +++ b/packages/metrics-prometheus/CHANGELOG.md @@ -81,6 +81,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.2.5](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.4...prometheus-metrics-v4.2.5) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [4.2.4](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.3...prometheus-metrics-v4.2.4) (2024-10-28) diff --git a/packages/metrics-prometheus/package.json b/packages/metrics-prometheus/package.json index a2f55a8b15..88c4e4c383 100644 --- a/packages/metrics-prometheus/package.json +++ b/packages/metrics-prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/prometheus-metrics", - "version": "4.2.4", + "version": "4.2.5", "description": "Collect libp2p metrics for scraping by Prometheus or Graphana", "author": "", "license": "Apache-2.0 OR MIT", @@ -56,7 +56,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "@libp2p/peer-id": "^5.0.7", "@multiformats/multiaddr": "^12.2.3", diff --git a/packages/peer-collections/CHANGELOG.md b/packages/peer-collections/CHANGELOG.md index f738a14490..6e9c412993 100644 --- a/packages/peer-collections/CHANGELOG.md +++ b/packages/peer-collections/CHANGELOG.md @@ -35,6 +35,15 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [6.0.11](https://github.com/libp2p/js-libp2p/compare/peer-collections-v6.0.10...peer-collections-v6.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [6.0.10](https://github.com/libp2p/js-libp2p/compare/peer-collections-v6.0.9...peer-collections-v6.0.10) (2024-10-28) diff --git a/packages/peer-collections/package.json b/packages/peer-collections/package.json index 4e4abf9a19..92094257f7 100644 --- a/packages/peer-collections/package.json +++ b/packages/peer-collections/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-collections", - "version": "6.0.10", + "version": "6.0.11", "description": "Stores values against a peer id", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-collections#readme", @@ -56,7 +56,7 @@ "dependencies": { "@libp2p/interface": "^2.2.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "multiformats": "^13.2.2" }, "devDependencies": { diff --git a/packages/peer-discovery-bootstrap/CHANGELOG.md b/packages/peer-discovery-bootstrap/CHANGELOG.md index b59ed527c3..964cd81022 100644 --- a/packages/peer-discovery-bootstrap/CHANGELOG.md +++ b/packages/peer-discovery-bootstrap/CHANGELOG.md @@ -83,6 +83,17 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.11](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.10...bootstrap-v11.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [11.0.10](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.9...bootstrap-v11.0.10) (2024-10-28) diff --git a/packages/peer-discovery-bootstrap/package.json b/packages/peer-discovery-bootstrap/package.json index e4b31851cb..edc59b6782 100644 --- a/packages/peer-discovery-bootstrap/package.json +++ b/packages/peer-discovery-bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/bootstrap", - "version": "11.0.10", + "version": "11.0.11", "description": "Peer discovery via a list of bootstrap peers", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-bootstrap#readme", @@ -55,13 +55,13 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/peer-id": "^5.0.7", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "aegir": "^44.0.1", "sinon-ts": "^2.0.0" diff --git a/packages/peer-discovery-mdns/CHANGELOG.md b/packages/peer-discovery-mdns/CHANGELOG.md index a678a41eaa..3b730cb622 100644 --- a/packages/peer-discovery-mdns/CHANGELOG.md +++ b/packages/peer-discovery-mdns/CHANGELOG.md @@ -105,6 +105,18 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.11](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.10...mdns-v11.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [11.0.10](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.9...mdns-v11.0.10) (2024-10-28) diff --git a/packages/peer-discovery-mdns/package.json b/packages/peer-discovery-mdns/package.json index 771effef74..bcb86c755e 100644 --- a/packages/peer-discovery-mdns/package.json +++ b/packages/peer-discovery-mdns/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mdns", - "version": "11.0.10", + "version": "11.0.11", "description": "Node.js libp2p mDNS discovery implementation for peer discovery", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-mdns#readme", @@ -51,9 +51,9 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@types/multicast-dns": "^7.2.4", "dns-packet": "^5.6.1", @@ -61,7 +61,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "aegir": "^44.0.1", "p-wait-for": "^5.0.2", diff --git a/packages/peer-record/CHANGELOG.md b/packages/peer-record/CHANGELOG.md index 40aa1fca83..56e202ff75 100644 --- a/packages/peer-record/CHANGELOG.md +++ b/packages/peer-record/CHANGELOG.md @@ -60,6 +60,15 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [8.0.11](https://github.com/libp2p/js-libp2p/compare/peer-record-v8.0.10...peer-record-v8.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [8.0.10](https://github.com/libp2p/js-libp2p/compare/peer-record-v8.0.9...peer-record-v8.0.10) (2024-10-28) diff --git a/packages/peer-record/package.json b/packages/peer-record/package.json index 86dbcae396..7e8a43afed 100644 --- a/packages/peer-record/package.json +++ b/packages/peer-record/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-record", - "version": "8.0.10", + "version": "8.0.11", "description": "Used to transfer signed peer data across the network", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-record#readme", @@ -64,7 +64,7 @@ "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "multiformats": "^13.2.2", "protons-runtime": "^5.4.0", diff --git a/packages/peer-store/CHANGELOG.md b/packages/peer-store/CHANGELOG.md index 6c90667620..a7185c5e46 100644 --- a/packages/peer-store/CHANGELOG.md +++ b/packages/peer-store/CHANGELOG.md @@ -68,6 +68,15 @@ * dependencies * @libp2p/peer-record bumped from ^7.0.8 to ^7.0.9 +## [11.0.11](https://github.com/libp2p/js-libp2p/compare/peer-store-v11.0.10...peer-store-v11.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/peer-record bumped from ^8.0.10 to ^8.0.11 + ## [11.0.10](https://github.com/libp2p/js-libp2p/compare/peer-store-v11.0.9...peer-store-v11.0.10) (2024-10-28) diff --git a/packages/peer-store/package.json b/packages/peer-store/package.json index ec45f6dfe5..8e476a6b68 100644 --- a/packages/peer-store/package.json +++ b/packages/peer-store/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-store", - "version": "11.0.10", + "version": "11.0.11", "description": "Stores information about peers libp2p knows on the network", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-store#readme", @@ -62,7 +62,7 @@ "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.10", + "@libp2p/peer-record": "^8.0.11", "@multiformats/multiaddr": "^12.2.3", "interface-datastore": "^8.3.0", "it-all": "^3.0.6", diff --git a/packages/pnet/CHANGELOG.md b/packages/pnet/CHANGELOG.md index 4afd25e4a7..dd29146aa7 100644 --- a/packages/pnet/CHANGELOG.md +++ b/packages/pnet/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.10...pnet-v2.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.9...pnet-v2.0.10) (2024-10-28) diff --git a/packages/pnet/package.json b/packages/pnet/package.json index f2521c846b..c87f021efe 100644 --- a/packages/pnet/package.json +++ b/packages/pnet/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/pnet", - "version": "2.0.10", + "version": "2.0.11", "description": "Implementation of Connection protection management via a shared secret", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pnet#readme", @@ -62,7 +62,7 @@ "xsalsa20": "^1.2.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "@libp2p/peer-id": "^5.0.7", "@multiformats/multiaddr": "^12.2.3", diff --git a/packages/protocol-autonat/CHANGELOG.md b/packages/protocol-autonat/CHANGELOG.md index 53aedf335e..ffcc743e9c 100644 --- a/packages/protocol-autonat/CHANGELOG.md +++ b/packages/protocol-autonat/CHANGELOG.md @@ -55,6 +55,16 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/autonat-v2.0.10...autonat-v2.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/autonat-v2.0.9...autonat-v2.0.10) (2024-10-28) diff --git a/packages/protocol-autonat/package.json b/packages/protocol-autonat/package.json index 331bcdf022..5cc7989918 100644 --- a/packages/protocol-autonat/package.json +++ b/packages/protocol-autonat/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/autonat", - "version": "2.0.10", + "version": "2.0.11", "description": "Implementation of Autonat Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-autonat#readme", @@ -53,9 +53,9 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "it-first": "^3.0.6", "it-length-prefixed": "^9.0.4", diff --git a/packages/protocol-dcutr/CHANGELOG.md b/packages/protocol-dcutr/CHANGELOG.md index ce796b9eb3..308b41a4f2 100644 --- a/packages/protocol-dcutr/CHANGELOG.md +++ b/packages/protocol-dcutr/CHANGELOG.md @@ -44,6 +44,16 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/dcutr-v2.0.10...dcutr-v2.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/dcutr-v2.0.9...dcutr-v2.0.10) (2024-10-28) diff --git a/packages/protocol-dcutr/package.json b/packages/protocol-dcutr/package.json index 9bdfe5a21e..6095ba9e61 100644 --- a/packages/protocol-dcutr/package.json +++ b/packages/protocol-dcutr/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/dcutr", - "version": "2.0.10", + "version": "2.0.11", "description": "Implementation of the DCUtR Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-dcutr#readme", @@ -53,8 +53,8 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/interface-internal": "^2.1.0", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "delay": "^6.0.0", diff --git a/packages/protocol-echo/CHANGELOG.md b/packages/protocol-echo/CHANGELOG.md index 067fe2e8f3..6c6c4803dd 100644 --- a/packages/protocol-echo/CHANGELOG.md +++ b/packages/protocol-echo/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.1.2](https://github.com/libp2p/js-libp2p/compare/echo-v2.1.1...echo-v2.1.2) (2024-11-16) + + +### Bug Fixes + +* add abort options to echo ([#2808](https://github.com/libp2p/js-libp2p/issues/2808)) ([06c4381](https://github.com/libp2p/js-libp2p/commit/06c4381d2fd5b80deb42d72f65e6dcc6a9637109)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + ## [2.1.1](https://github.com/libp2p/js-libp2p/compare/echo-v2.1.0...echo-v2.1.1) (2024-10-28) diff --git a/packages/protocol-echo/package.json b/packages/protocol-echo/package.json index e920bdb7b6..0929630c3b 100644 --- a/packages/protocol-echo/package.json +++ b/packages/protocol-echo/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/echo", - "version": "2.1.1", + "version": "2.1.2", "description": "Implementation of an Echo protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-echo#readme", @@ -52,7 +52,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@multiformats/multiaddr": "^12.3.1", "it-byte-stream": "^1.1.0", "it-pipe": "^3.0.1" diff --git a/packages/protocol-fetch/CHANGELOG.md b/packages/protocol-fetch/CHANGELOG.md index 559a9a71df..cd1a7a72ec 100644 --- a/packages/protocol-fetch/CHANGELOG.md +++ b/packages/protocol-fetch/CHANGELOG.md @@ -48,6 +48,15 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/fetch-v2.0.10...fetch-v2.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/fetch-v2.0.9...fetch-v2.0.10) (2024-10-28) diff --git a/packages/protocol-fetch/package.json b/packages/protocol-fetch/package.json index b6d248fe96..f7e2a82065 100644 --- a/packages/protocol-fetch/package.json +++ b/packages/protocol-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/fetch", - "version": "2.0.10", + "version": "2.0.11", "description": "Implementation of the Fetch Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-fetch#readme", @@ -53,7 +53,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "it-protobuf-stream": "^1.1.3", "protons-runtime": "^5.4.0", "uint8arraylist": "^2.4.8", diff --git a/packages/protocol-identify/CHANGELOG.md b/packages/protocol-identify/CHANGELOG.md index b5a23fe2f1..c7e1a12313 100644 --- a/packages/protocol-identify/CHANGELOG.md +++ b/packages/protocol-identify/CHANGELOG.md @@ -76,6 +76,17 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [3.0.11](https://github.com/libp2p/js-libp2p/compare/identify-v3.0.10...identify-v3.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/peer-record bumped from ^8.0.10 to ^8.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [3.0.10](https://github.com/libp2p/js-libp2p/compare/identify-v3.0.9...identify-v3.0.10) (2024-10-28) diff --git a/packages/protocol-identify/package.json b/packages/protocol-identify/package.json index 7038e7c31b..f4b1a5382a 100644 --- a/packages/protocol-identify/package.json +++ b/packages/protocol-identify/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/identify", - "version": "3.0.10", + "version": "3.0.11", "description": "Implementation of the Identify Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-identify#readme", @@ -54,10 +54,10 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/peer-record": "^8.0.11", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "it-drain": "^3.0.7", diff --git a/packages/protocol-perf/CHANGELOG.md b/packages/protocol-perf/CHANGELOG.md index e86767cc65..65ea51800f 100644 --- a/packages/protocol-perf/CHANGELOG.md +++ b/packages/protocol-perf/CHANGELOG.md @@ -82,6 +82,17 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.0.11](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.10...perf-v4.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [4.0.10](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.9...perf-v4.0.10) (2024-10-28) diff --git a/packages/protocol-perf/package.json b/packages/protocol-perf/package.json index efa91ec785..5357647bb0 100644 --- a/packages/protocol-perf/package.json +++ b/packages/protocol-perf/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/perf", - "version": "4.0.10", + "version": "4.0.11", "description": "Implementation of Perf Protocol", "author": "@maschad / @marcopolo", "license": "Apache-2.0 OR MIT", @@ -53,12 +53,12 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@multiformats/multiaddr": "^12.2.3", "it-pushable": "^3.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "aegir": "^44.0.1", "it-last": "^3.0.6", diff --git a/packages/protocol-ping/CHANGELOG.md b/packages/protocol-ping/CHANGELOG.md index a488e59d60..9458513582 100644 --- a/packages/protocol-ping/CHANGELOG.md +++ b/packages/protocol-ping/CHANGELOG.md @@ -50,6 +50,20 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/ping-v2.0.10...ping-v2.0.11) (2024-11-16) + + +### Bug Fixes + +* gracefully handle remote stream closure during ping ([#2822](https://github.com/libp2p/js-libp2p/issues/2822)) ([4db0645](https://github.com/libp2p/js-libp2p/commit/4db0645c8ef5fb366a60f47db42c0e45f412e36e)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/ping-v2.0.9...ping-v2.0.10) (2024-10-28) diff --git a/packages/protocol-ping/package.json b/packages/protocol-ping/package.json index 1910ebe03c..0610e8cb7b 100644 --- a/packages/protocol-ping/package.json +++ b/packages/protocol-ping/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/ping", - "version": "2.0.10", + "version": "2.0.11", "description": "Implementation of Ping Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-ping#readme", @@ -52,7 +52,7 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@multiformats/multiaddr": "^12.2.3", "it-byte-stream": "^1.1.0", "uint8arrays": "^5.1.0" diff --git a/packages/pubsub-floodsub/CHANGELOG.md b/packages/pubsub-floodsub/CHANGELOG.md index d1235f45e3..71ec6ab2c6 100644 --- a/packages/pubsub-floodsub/CHANGELOG.md +++ b/packages/pubsub-floodsub/CHANGELOG.md @@ -98,6 +98,18 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [10.1.9](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.8...floodsub-v10.1.9) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/pubsub bumped from ^10.0.10 to ^10.0.11 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + ## [10.1.8](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.7...floodsub-v10.1.8) (2024-10-28) diff --git a/packages/pubsub-floodsub/package.json b/packages/pubsub-floodsub/package.json index 688b61f7fd..38f51cfb3c 100644 --- a/packages/pubsub-floodsub/package.json +++ b/packages/pubsub-floodsub/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/floodsub", - "version": "10.1.8", + "version": "10.1.9", "description": "libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pubsub-floodsub#readme", @@ -61,16 +61,16 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/pubsub": "^10.0.10", + "@libp2p/pubsub": "^10.0.11", "protons-runtime": "^5.4.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" }, "devDependencies": { "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", "@multiformats/multiaddr": "^12.2.3", "@types/sinon": "^17.0.3", diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index 2d6360930f..70e6faeeb7 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -75,6 +75,17 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [10.0.11](https://github.com/libp2p/js-libp2p/compare/pubsub-v10.0.10...pubsub-v10.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [10.0.10](https://github.com/libp2p/js-libp2p/compare/pubsub-v10.0.9...pubsub-v10.0.10) (2024-10-28) diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index ec75721ee4..a4ab78fe08 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/pubsub", - "version": "10.0.10", + "version": "10.0.11", "description": "libp2p pubsub base class", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pubsub#readme", @@ -86,10 +86,10 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/interface-internal": "^2.1.0", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "it-length-prefixed": "^9.0.4", "it-pipe": "^3.0.1", "it-pushable": "^3.2.3", diff --git a/packages/stream-multiplexer-mplex/CHANGELOG.md b/packages/stream-multiplexer-mplex/CHANGELOG.md index ea9861a64d..cdec28c39b 100644 --- a/packages/stream-multiplexer-mplex/CHANGELOG.md +++ b/packages/stream-multiplexer-mplex/CHANGELOG.md @@ -78,6 +78,17 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.11](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.10...mplex-v11.0.11) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [11.0.10](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.9...mplex-v11.0.10) (2024-10-28) diff --git a/packages/stream-multiplexer-mplex/package.json b/packages/stream-multiplexer-mplex/package.json index 264819af3f..8a32eda2d6 100644 --- a/packages/stream-multiplexer-mplex/package.json +++ b/packages/stream-multiplexer-mplex/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mplex", - "version": "11.0.10", + "version": "11.0.11", "description": "JavaScript implementation of https://github.com/libp2p/mplex", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex#readme", @@ -63,7 +63,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "it-pipe": "^3.0.1", "it-pushable": "^3.2.3", "it-stream-types": "^2.0.1", @@ -72,7 +72,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "aegir": "^44.0.1", "benchmark": "^2.1.4", diff --git a/packages/transport-circuit-relay-v2/CHANGELOG.md b/packages/transport-circuit-relay-v2/CHANGELOG.md index 284b3d1b41..83d450d973 100644 --- a/packages/transport-circuit-relay-v2/CHANGELOG.md +++ b/packages/transport-circuit-relay-v2/CHANGELOG.md @@ -101,6 +101,25 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [3.1.1](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.1.0...circuit-relay-v2-v3.1.1) (2024-11-16) + + +### Bug Fixes + +* log relay response messages ([ad5cfd6](https://github.com/libp2p/js-libp2p/commit/ad5cfd66a3fccf94ddcabce8675a3bf742669484)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/peer-collections bumped from ^6.0.10 to ^6.0.11 + * @libp2p/peer-record bumped from ^8.0.10 to ^8.0.11 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [3.1.0](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.0.0...circuit-relay-v2-v3.1.0) (2024-10-28) diff --git a/packages/transport-circuit-relay-v2/package.json b/packages/transport-circuit-relay-v2/package.json index c3c2cfc077..561e97b3fe 100644 --- a/packages/transport-circuit-relay-v2/package.json +++ b/packages/transport-circuit-relay-v2/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/circuit-relay-v2", - "version": "3.1.0", + "version": "3.1.1", "description": "Implementation of Circuit Relay v2", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-circuit-relay-v2#readme", @@ -54,11 +54,11 @@ "dependencies": { "@libp2p/crypto": "^5.0.6", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/peer-collections": "^6.0.10", + "@libp2p/interface-internal": "^2.1.0", + "@libp2p/peer-collections": "^6.0.11", "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/peer-record": "^8.0.11", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.3.0", "any-signal": "^4.1.1", @@ -73,7 +73,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "aegir": "^44.0.1", "delay": "^6.0.0", diff --git a/packages/transport-memory/CHANGELOG.md b/packages/transport-memory/CHANGELOG.md new file mode 100644 index 0000000000..27b5e2a9e6 --- /dev/null +++ b/packages/transport-memory/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## 1.0.0 (2024-11-16) + + +### Features + +* add latency option to memory transport ([#2810](https://github.com/libp2p/js-libp2p/issues/2810)) ([050b01f](https://github.com/libp2p/js-libp2p/commit/050b01f05265eccc0d4cd9e0bd5706852d8d142b)) +* add memory transport ([#2802](https://github.com/libp2p/js-libp2p/issues/2802)) ([adc7678](https://github.com/libp2p/js-libp2p/commit/adc767899d3fcf186a2bfb37a4d53decadc3a93f)) diff --git a/packages/transport-memory/package.json b/packages/transport-memory/package.json index cacc0c06d2..ed05d874e7 100644 --- a/packages/transport-memory/package.json +++ b/packages/transport-memory/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/memory", - "version": "0.0.0", + "version": "1.0.0", "description": "A memory transport for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", diff --git a/packages/transport-tcp/CHANGELOG.md b/packages/transport-tcp/CHANGELOG.md index 285058f1b7..e3da4310d7 100644 --- a/packages/transport-tcp/CHANGELOG.md +++ b/packages/transport-tcp/CHANGELOG.md @@ -89,6 +89,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [10.0.12](https://github.com/libp2p/js-libp2p/compare/tcp-v10.0.11...tcp-v10.0.12) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [10.0.11](https://github.com/libp2p/js-libp2p/compare/tcp-v10.0.10...tcp-v10.0.11) (2024-10-28) diff --git a/packages/transport-tcp/package.json b/packages/transport-tcp/package.json index 51101bc64e..c6bad9156e 100644 --- a/packages/transport-tcp/package.json +++ b/packages/transport-tcp/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/tcp", - "version": "10.0.11", + "version": "10.0.12", "description": "A TCP transport for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", @@ -61,7 +61,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.2.3", "@types/sinon": "^17.0.3", diff --git a/packages/transport-webrtc/CHANGELOG.md b/packages/transport-webrtc/CHANGELOG.md index 53434d5d96..4d16207316 100644 --- a/packages/transport-webrtc/CHANGELOG.md +++ b/packages/transport-webrtc/CHANGELOG.md @@ -111,6 +111,23 @@ * @libp2p/websockets bumped from ^8.0.14 to ^8.0.15 * libp2p bumped from ^1.2.2 to ^1.2.3 +## [5.0.17](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.16...webrtc-v5.0.17) (2024-11-16) + + +### Bug Fixes + +* do not require peer id for webrtc-direct ([#2820](https://github.com/libp2p/js-libp2p/issues/2820)) ([2feaedd](https://github.com/libp2p/js-libp2p/commit/2feaeddb40712a5d58aee158021a10b9b9bbf660)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.8 to ^6.1.9 + ## [5.0.16](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.15...webrtc-v5.0.16) (2024-10-28) diff --git a/packages/transport-webrtc/package.json b/packages/transport-webrtc/package.json index 87af8a01b1..40f7fa724e 100644 --- a/packages/transport-webrtc/package.json +++ b/packages/transport-webrtc/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/webrtc", - "version": "5.0.16", + "version": "5.0.17", "description": "A libp2p transport using WebRTC connections", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme", @@ -52,9 +52,9 @@ "dependencies": { "@chainsafe/libp2p-noise": "^16.0.0", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", + "@libp2p/interface-internal": "^2.1.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "detect-browser": "^5.3.0", @@ -77,7 +77,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.8", + "@libp2p/interface-compliance-tests": "^6.1.9", "@libp2p/logger": "^5.1.3", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", diff --git a/packages/transport-websockets/CHANGELOG.md b/packages/transport-websockets/CHANGELOG.md index f25b510275..a22e58df1e 100644 --- a/packages/transport-websockets/CHANGELOG.md +++ b/packages/transport-websockets/CHANGELOG.md @@ -70,6 +70,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [9.0.12](https://github.com/libp2p/js-libp2p/compare/websockets-v9.0.11...websockets-v9.0.12) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [9.0.11](https://github.com/libp2p/js-libp2p/compare/websockets-v9.0.10...websockets-v9.0.11) (2024-10-28) diff --git a/packages/transport-websockets/package.json b/packages/transport-websockets/package.json index a08fde6ea2..98e775946e 100644 --- a/packages/transport-websockets/package.json +++ b/packages/transport-websockets/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/websockets", - "version": "9.0.11", + "version": "9.0.12", "description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-websockets#readme", @@ -75,7 +75,7 @@ }, "dependencies": { "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.4.0", "@multiformats/multiaddr-to-uri": "^10.0.1", diff --git a/packages/transport-webtransport/CHANGELOG.md b/packages/transport-webtransport/CHANGELOG.md index 53498d6734..4804ec4806 100644 --- a/packages/transport-webtransport/CHANGELOG.md +++ b/packages/transport-webtransport/CHANGELOG.md @@ -96,6 +96,18 @@ * devDependencies * libp2p bumped from ^1.2.2 to ^1.2.3 +## [5.0.17](https://github.com/libp2p/js-libp2p/compare/webtransport-v5.0.16...webtransport-v5.0.17) (2024-11-16) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + * devDependencies + * @libp2p/ping bumped from ^2.0.10 to ^2.0.11 + * libp2p bumped from ^2.2.1 to ^2.3.0 + ## [5.0.16](https://github.com/libp2p/js-libp2p/compare/webtransport-v5.0.15...webtransport-v5.0.16) (2024-10-28) diff --git a/packages/transport-webtransport/package.json b/packages/transport-webtransport/package.json index aadcbbd9a7..87ad33b937 100644 --- a/packages/transport-webtransport/package.json +++ b/packages/transport-webtransport/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/webtransport", - "version": "5.0.16", + "version": "5.0.17", "description": "JavaScript implementation of the WebTransport module that libp2p uses and that implements the interface-transport spec", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webtransport#readme", @@ -53,7 +53,7 @@ "@chainsafe/libp2p-noise": "^16.0.0", "@libp2p/interface": "^2.2.0", "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.1.3", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "it-stream-types": "^2.0.1", @@ -67,14 +67,14 @@ "@libp2p/crypto": "^5.0.6", "@libp2p/daemon-client": "^9.0.1", "@libp2p/logger": "^5.1.3", - "@libp2p/ping": "^2.0.10", + "@libp2p/ping": "^2.0.11", "@noble/hashes": "^1.4.0", "aegir": "^44.0.1", "execa": "^9.1.0", "go-libp2p": "^1.2.0", "it-map": "^3.1.0", "it-to-buffer": "^4.0.7", - "libp2p": "^2.2.1", + "libp2p": "^2.3.0", "p-defer": "^4.0.1", "p-wait-for": "^5.0.2" }, diff --git a/packages/upnp-nat/CHANGELOG.md b/packages/upnp-nat/CHANGELOG.md index 46208604f8..08f3537ccc 100644 --- a/packages/upnp-nat/CHANGELOG.md +++ b/packages/upnp-nat/CHANGELOG.md @@ -64,6 +64,22 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/upnp-nat-v2.0.10...upnp-nat-v2.0.11) (2024-11-16) + + +### Bug Fixes + +* require autonat when not automatically confirming addresses ([#2824](https://github.com/libp2p/js-libp2p/issues/2824)) ([eee97c7](https://github.com/libp2p/js-libp2p/commit/eee97c7d4ced5763f6620e535f3c9a5619abf046)) +* run UPnP nat on address change, update nat port mapper ([#2797](https://github.com/libp2p/js-libp2p/issues/2797)) ([7626b22](https://github.com/libp2p/js-libp2p/commit/7626b224d23c474d1c885c8a7922977ab7e4bea6)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface-internal bumped from ^2.0.10 to ^2.1.0 + * @libp2p/utils bumped from ^6.1.3 to ^6.2.0 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/upnp-nat-v2.0.9...upnp-nat-v2.0.10) (2024-10-28) diff --git a/packages/upnp-nat/package.json b/packages/upnp-nat/package.json index 36e588bf3d..dc51b77ae9 100644 --- a/packages/upnp-nat/package.json +++ b/packages/upnp-nat/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/upnp-nat", - "version": "2.0.10", + "version": "2.0.11", "description": "UPnP NAT hole punching", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/upnp-nat#readme", @@ -53,8 +53,8 @@ "@achingbrain/nat-port-mapper": "^2.0.1", "@chainsafe/is-ip": "^2.0.2", "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.0.10", - "@libp2p/utils": "^6.1.3", + "@libp2p/interface-internal": "^2.1.0", + "@libp2p/utils": "^6.2.0", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.4.0", "p-defer": "^4.0.1", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 353d46ce73..6357eec69b 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -36,6 +36,18 @@ * @libp2p/logger bumped from ^4.0.2 to ^4.0.3 * @libp2p/peer-id-factory bumped from ^4.0.1 to ^4.0.2 +## [6.2.0](https://github.com/libp2p/js-libp2p/compare/utils-v6.1.3...utils-v6.2.0) (2024-11-16) + + +### Features + +* add debounce and repeating task to utils ([#2795](https://github.com/libp2p/js-libp2p/issues/2795)) ([0a3406a](https://github.com/libp2p/js-libp2p/commit/0a3406a0536f8e7390e67eec88ccc518bd90e9a6)) + + +### Bug Fixes + +* only close stream if it is open ([#2823](https://github.com/libp2p/js-libp2p/issues/2823)) ([3098232](https://github.com/libp2p/js-libp2p/commit/30982327b3924614d1fb552fd42b7b8f5a7419cd)) + ## [6.1.3](https://github.com/libp2p/js-libp2p/compare/utils-v6.1.2...utils-v6.1.3) (2024-10-28) diff --git a/packages/utils/package.json b/packages/utils/package.json index 97328c61f2..ce47127851 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/utils", - "version": "6.1.3", + "version": "6.2.0", "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/utils#readme", From 656db81cff6f5cb8d1d5523f1928323057308b5a Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 18 Nov 2024 10:00:03 +0000 Subject: [PATCH 02/10] fix: update transport listener options (#2826) Will cause a release that includes changes added as part of a previous `chore:` commit. --- packages/interface/src/transport/index.ts | 28 +++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/interface/src/transport/index.ts b/packages/interface/src/transport/index.ts index 33fe4f84e1..58d47a6033 100644 --- a/packages/interface/src/transport/index.ts +++ b/packages/interface/src/transport/index.ts @@ -6,8 +6,21 @@ import type { Multiaddr } from '@multiformats/multiaddr' import type { ProgressOptions, ProgressEvent } from 'progress-events' export interface ListenerEvents { + /** + * This event signals to the transport manager that the listening addresses + * have changed and may be emitted at any point and/or multiple times + */ 'listening': CustomEvent + + /** + * Emitted if listening on an address failed + */ 'error': CustomEvent + + /** + * Emitted when the listener has been shut down, has no open connections and + * will no longer accept new connections + */ 'close': CustomEvent } @@ -30,15 +43,21 @@ export interface Listener extends TypedEventTarget { export const transportSymbol = Symbol.for('@libp2p/transport') -export interface ConnectionHandler { (connection: Connection): void } - export interface MultiaddrFilter { (multiaddrs: Multiaddr[]): Multiaddr[] } export interface CreateListenerOptions { + /** + * The upgrader turns a MultiaddrConnection into a Connection and notifies + * other libp2p components about a new incoming connection. + */ upgrader: Upgrader } export interface DialTransportOptions extends AbortOptions, ProgressOptions { + /** + * The upgrader turns a MultiaddrConnection into a Connection which should be + * returned by the transport's dial method + */ upgrader: Upgrader } @@ -115,12 +134,13 @@ ProgressEvent<'upgrader:multiplex-outbound-connection'> export interface Upgrader { /** - * Upgrades an outbound connection on `transport.dial` + * Upgrades an outbound connection created by the `dial` method of a transport */ upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise /** - * Upgrades an inbound connection received by a transport listener + * Upgrades an inbound connection received by a transport listener and + * notifies other libp2p components about the new connection */ upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise } From 05d559f545d7408646f2b7dcd5adf5c6771a97e6 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 18 Nov 2024 10:59:31 +0000 Subject: [PATCH 03/10] fix: add autonat capability (#2827) Add the service capability to signal to other components that autonat can provide functionality --- packages/protocol-autonat/src/autonat.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/protocol-autonat/src/autonat.ts b/packages/protocol-autonat/src/autonat.ts index ee9f976b4b..ef456be702 100644 --- a/packages/protocol-autonat/src/autonat.ts +++ b/packages/protocol-autonat/src/autonat.ts @@ -1,4 +1,4 @@ -import { AbortError, setMaxListeners } from '@libp2p/interface' +import { AbortError, serviceCapabilities, setMaxListeners } from '@libp2p/interface' import { peerIdFromMultihash } from '@libp2p/peer-id' import { isPrivateIp } from '@libp2p/utils/private-ip' import { multiaddr, protocols } from '@multiformats/multiaddr' @@ -50,6 +50,10 @@ export class AutoNATService implements Startable { readonly [Symbol.toStringTag] = '@libp2p/autonat' + readonly [serviceCapabilities]: string[] = [ + '@libp2p/autonat' + ] + isStarted (): boolean { return this.started } From 4d59c801a6b45dcc0b2d7b457b4ae3b107b57cbb Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 18 Nov 2024 11:51:16 +0000 Subject: [PATCH 04/10] chore: release main (#2828) --- .release-please-manifest.json | 2 +- .../CHANGELOG.md | 14 ++++++++++ .../package.json | 12 ++++----- .../connection-encrypter-tls/CHANGELOG.md | 13 ++++++++++ .../connection-encrypter-tls/package.json | 10 +++---- packages/crypto/CHANGELOG.md | 9 +++++++ packages/crypto/package.json | 4 +-- .../interface-compliance-tests/CHANGELOG.md | 20 ++++++++++++++ .../interface-compliance-tests/package.json | 26 +++++++++---------- packages/interface-internal/CHANGELOG.md | 10 +++++++ packages/interface-internal/package.json | 6 ++--- packages/interface/CHANGELOG.md | 7 +++++ packages/interface/package.json | 2 +- packages/kad-dht/CHANGELOG.md | 18 +++++++++++++ packages/kad-dht/package.json | 20 +++++++------- packages/keychain/CHANGELOG.md | 12 +++++++++ packages/keychain/package.json | 8 +++--- packages/libp2p/CHANGELOG.md | 17 ++++++++++++ packages/libp2p/package.json | 20 +++++++------- packages/logger/CHANGELOG.md | 11 ++++++++ packages/logger/package.json | 6 ++--- packages/metrics-devtools/CHANGELOG.md | 15 +++++++++++ packages/metrics-devtools/package.json | 14 +++++----- packages/metrics-prometheus/CHANGELOG.md | 14 ++++++++++ packages/metrics-prometheus/package.json | 12 ++++----- packages/metrics-simple/CHANGELOG.md | 10 +++++++ packages/metrics-simple/package.json | 6 ++--- packages/multistream-select/CHANGELOG.md | 11 ++++++++ packages/multistream-select/package.json | 6 ++--- packages/peer-collections/CHANGELOG.md | 13 ++++++++++ packages/peer-collections/package.json | 10 +++---- .../peer-discovery-bootstrap/CHANGELOG.md | 14 ++++++++++ .../peer-discovery-bootstrap/package.json | 12 ++++----- packages/peer-discovery-mdns/CHANGELOG.md | 16 ++++++++++++ packages/peer-discovery-mdns/package.json | 16 ++++++------ packages/peer-id/CHANGELOG.md | 10 +++++++ packages/peer-id/package.json | 6 ++--- packages/peer-record/CHANGELOG.md | 12 +++++++++ packages/peer-record/package.json | 10 +++---- packages/peer-store/CHANGELOG.md | 14 ++++++++++ packages/peer-store/package.json | 12 ++++----- packages/pnet/CHANGELOG.md | 14 ++++++++++ packages/pnet/package.json | 12 ++++----- packages/protocol-autonat/CHANGELOG.md | 20 ++++++++++++++ packages/protocol-autonat/package.json | 14 +++++----- packages/protocol-dcutr/CHANGELOG.md | 11 ++++++++ packages/protocol-dcutr/package.json | 8 +++--- packages/protocol-echo/CHANGELOG.md | 12 +++++++++ packages/protocol-echo/package.json | 8 +++--- packages/protocol-fetch/CHANGELOG.md | 14 ++++++++++ packages/protocol-fetch/package.json | 12 ++++----- packages/protocol-identify/CHANGELOG.md | 16 ++++++++++++ packages/protocol-identify/package.json | 16 ++++++------ packages/protocol-perf/CHANGELOG.md | 13 ++++++++++ packages/protocol-perf/package.json | 10 +++---- packages/protocol-ping/CHANGELOG.md | 14 ++++++++++ packages/protocol-ping/package.json | 12 ++++----- packages/pubsub-floodsub/CHANGELOG.md | 16 ++++++++++++ packages/pubsub-floodsub/package.json | 16 ++++++------ packages/pubsub/CHANGELOG.md | 16 ++++++++++++ packages/pubsub/package.json | 16 ++++++------ .../stream-multiplexer-mplex/CHANGELOG.md | 13 ++++++++++ .../stream-multiplexer-mplex/package.json | 10 +++---- .../transport-circuit-relay-v2/CHANGELOG.md | 18 +++++++++++++ .../transport-circuit-relay-v2/package.json | 20 +++++++------- packages/transport-memory/CHANGELOG.md | 12 +++++++++ packages/transport-memory/package.json | 8 +++--- packages/transport-tcp/CHANGELOG.md | 12 +++++++++ packages/transport-tcp/package.json | 8 +++--- packages/transport-webrtc/CHANGELOG.md | 16 ++++++++++++ packages/transport-webrtc/package.json | 16 ++++++------ packages/transport-websockets/CHANGELOG.md | 12 +++++++++ packages/transport-websockets/package.json | 8 +++--- packages/transport-webtransport/CHANGELOG.md | 16 ++++++++++++ packages/transport-webtransport/package.json | 16 ++++++------ packages/upnp-nat/CHANGELOG.md | 15 +++++++++++ packages/upnp-nat/package.json | 14 +++++----- packages/utils/CHANGELOG.md | 13 ++++++++++ packages/utils/package.json | 10 +++---- 79 files changed, 760 insertions(+), 227 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 758847d692..14d22ebb14 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"packages/connection-encrypter-plaintext":"2.0.10","packages/connection-encrypter-tls":"2.0.10","packages/crypto":"5.0.6","packages/interface":"2.2.0","packages/interface-compliance-tests":"6.1.9","packages/interface-internal":"2.1.0","packages/kad-dht":"14.1.1","packages/keychain":"5.0.9","packages/libp2p":"2.3.0","packages/logger":"5.1.3","packages/metrics-devtools":"1.1.9","packages/metrics-prometheus":"4.2.5","packages/metrics-simple":"1.2.6","packages/multistream-select":"6.0.8","packages/peer-collections":"6.0.11","packages/peer-discovery-bootstrap":"11.0.11","packages/peer-discovery-mdns":"11.0.11","packages/peer-id":"5.0.7","packages/peer-record":"8.0.11","packages/peer-store":"11.0.11","packages/pnet":"2.0.11","packages/protocol-autonat":"2.0.11","packages/protocol-dcutr":"2.0.11","packages/protocol-echo":"2.1.2","packages/protocol-fetch":"2.0.11","packages/protocol-identify":"3.0.11","packages/protocol-perf":"4.0.11","packages/protocol-ping":"2.0.11","packages/pubsub":"10.0.11","packages/pubsub-floodsub":"10.1.9","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.11","packages/transport-circuit-relay-v2":"3.1.1","packages/transport-memory":"1.0.0","packages/transport-tcp":"10.0.12","packages/transport-webrtc":"5.0.17","packages/transport-websockets":"9.0.12","packages/transport-webtransport":"5.0.17","packages/upnp-nat":"2.0.11","packages/utils":"6.2.0"} +{"packages/connection-encrypter-plaintext":"2.0.11","packages/connection-encrypter-tls":"2.0.11","packages/crypto":"5.0.7","packages/interface":"2.2.1","packages/interface-compliance-tests":"6.1.10","packages/interface-internal":"2.1.1","packages/kad-dht":"14.1.2","packages/keychain":"5.0.10","packages/libp2p":"2.3.1","packages/logger":"5.1.4","packages/metrics-devtools":"1.1.10","packages/metrics-prometheus":"4.2.6","packages/metrics-simple":"1.2.7","packages/multistream-select":"6.0.9","packages/peer-collections":"6.0.12","packages/peer-discovery-bootstrap":"11.0.12","packages/peer-discovery-mdns":"11.0.12","packages/peer-id":"5.0.8","packages/peer-record":"8.0.12","packages/peer-store":"11.0.12","packages/pnet":"2.0.12","packages/protocol-autonat":"2.0.12","packages/protocol-dcutr":"2.0.12","packages/protocol-echo":"2.1.3","packages/protocol-fetch":"2.0.12","packages/protocol-identify":"3.0.12","packages/protocol-perf":"4.0.12","packages/protocol-ping":"2.0.12","packages/pubsub":"10.0.12","packages/pubsub-floodsub":"10.1.10","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.12","packages/transport-circuit-relay-v2":"3.1.2","packages/transport-memory":"1.0.1","packages/transport-tcp":"10.0.13","packages/transport-webrtc":"5.0.18","packages/transport-websockets":"9.0.13","packages/transport-webtransport":"5.0.18","packages/upnp-nat":"2.0.12","packages/utils":"6.2.1"} diff --git a/packages/connection-encrypter-plaintext/CHANGELOG.md b/packages/connection-encrypter-plaintext/CHANGELOG.md index a472e40fdf..2b96b22151 100644 --- a/packages/connection-encrypter-plaintext/CHANGELOG.md +++ b/packages/connection-encrypter-plaintext/CHANGELOG.md @@ -72,6 +72,20 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/plaintext-v2.0.10...plaintext-v2.0.11) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/plaintext-v2.0.9...plaintext-v2.0.10) (2024-10-28) diff --git a/packages/connection-encrypter-plaintext/package.json b/packages/connection-encrypter-plaintext/package.json index 394c599fff..f90814def7 100644 --- a/packages/connection-encrypter-plaintext/package.json +++ b/packages/connection-encrypter-plaintext/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/plaintext", - "version": "2.0.10", + "version": "2.0.11", "description": "An insecure connection encrypter", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/connection-encrypter-plaintext#readme", @@ -52,9 +52,9 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", "it-protobuf-stream": "^1.1.3", "it-stream-types": "^2.0.1", "protons-runtime": "^5.4.0", @@ -62,8 +62,8 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.7", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-pair": "^2.0.6", "protons": "^7.5.0", diff --git a/packages/connection-encrypter-tls/CHANGELOG.md b/packages/connection-encrypter-tls/CHANGELOG.md index fffb3e404c..f2a078899b 100644 --- a/packages/connection-encrypter-tls/CHANGELOG.md +++ b/packages/connection-encrypter-tls/CHANGELOG.md @@ -6,6 +6,19 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [2.0.11](https://github.com/libp2p/js-libp2p/compare/tls-v2.0.10...tls-v2.0.11) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [2.0.10](https://github.com/libp2p/js-libp2p/compare/tls-v2.0.9...tls-v2.0.10) (2024-10-28) diff --git a/packages/connection-encrypter-tls/package.json b/packages/connection-encrypter-tls/package.json index 40da424ec3..cc39dbac21 100644 --- a/packages/connection-encrypter-tls/package.json +++ b/packages/connection-encrypter-tls/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/tls", - "version": "2.0.10", + "version": "2.0.11", "description": "A connection encrypter that uses TLS 1.3", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/connection-encrypter-tls#readme", @@ -48,9 +48,9 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", "@peculiar/asn1-schema": "^2.3.8", "@peculiar/asn1-x509": "^2.3.8", "@peculiar/webcrypto": "^1.4.6", @@ -63,7 +63,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-pair": "^2.0.6", "protons": "^7.5.0", diff --git a/packages/crypto/CHANGELOG.md b/packages/crypto/CHANGELOG.md index ff1305e70c..f82942db81 100644 --- a/packages/crypto/CHANGELOG.md +++ b/packages/crypto/CHANGELOG.md @@ -17,6 +17,15 @@ * dependencies * @libp2p/interface bumped from ^1.0.2 to ^1.1.0 +## [5.0.7](https://github.com/libp2p/js-libp2p/compare/crypto-v5.0.6...crypto-v5.0.7) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + ## [5.0.6](https://github.com/libp2p/js-libp2p/compare/crypto-v5.0.5...crypto-v5.0.6) (2024-10-28) diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 1ada8af360..1031d1fb5f 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/crypto", - "version": "5.0.6", + "version": "5.0.7", "description": "Crypto primitives for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/crypto#readme", @@ -92,7 +92,7 @@ "generate": "protons ./src/keys/keys.proto" }, "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.2.1", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.4.0", "asn1js": "^3.0.5", diff --git a/packages/interface-compliance-tests/CHANGELOG.md b/packages/interface-compliance-tests/CHANGELOG.md index 8b250c2e03..41e7a17c0f 100644 --- a/packages/interface-compliance-tests/CHANGELOG.md +++ b/packages/interface-compliance-tests/CHANGELOG.md @@ -75,6 +75,26 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [6.1.10](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.9...interface-compliance-tests-v6.1.10) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/echo bumped from ^2.1.2 to ^2.1.3 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/memory bumped from ^1.0.0 to ^1.0.1 + * @libp2p/multistream-select bumped from ^6.0.8 to ^6.0.9 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/plaintext bumped from ^2.0.10 to ^2.0.11 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * libp2p bumped from ^2.3.0 to ^2.3.1 + ## [6.1.9](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.8...interface-compliance-tests-v6.1.9) (2024-11-16) diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index b2b5ef2a47..40beabc733 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface-compliance-tests", - "version": "6.1.9", + "version": "6.1.10", "description": "Compliance tests for JS libp2p interfaces", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme", @@ -104,17 +104,17 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/echo": "^2.1.2", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/logger": "^5.1.3", - "@libp2p/memory": "^1.0.0", - "@libp2p/multistream-select": "^6.0.8", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/plaintext": "^2.0.10", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/echo": "^2.1.3", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/logger": "^5.1.4", + "@libp2p/memory": "^1.0.1", + "@libp2p/multistream-select": "^6.0.9", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/plaintext": "^2.0.11", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.5.0", "abortable-iterator": "^5.0.1", @@ -131,7 +131,7 @@ "it-pushable": "^3.2.3", "it-stream-types": "^2.0.1", "it-to-buffer": "^4.0.7", - "libp2p": "^2.3.0", + "libp2p": "^2.3.1", "merge-options": "^3.0.4", "p-defer": "^4.0.1", "p-event": "^6.0.1", diff --git a/packages/interface-internal/CHANGELOG.md b/packages/interface-internal/CHANGELOG.md index 199295116b..b8ec8bb9d7 100644 --- a/packages/interface-internal/CHANGELOG.md +++ b/packages/interface-internal/CHANGELOG.md @@ -32,6 +32,16 @@ * dependencies * @libp2p/peer-collections bumped from ^5.1.3 to ^5.1.4 +## [2.1.1](https://github.com/libp2p/js-libp2p/compare/interface-internal-v2.1.0...interface-internal-v2.1.1) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + ## [2.1.0](https://github.com/libp2p/js-libp2p/compare/interface-internal-v2.0.10...interface-internal-v2.1.0) (2024-11-16) diff --git a/packages/interface-internal/package.json b/packages/interface-internal/package.json index 1db60289b8..c14f7a37ea 100644 --- a/packages/interface-internal/package.json +++ b/packages/interface-internal/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface-internal", - "version": "2.1.0", + "version": "2.1.1", "description": "Interfaces implemented by internal libp2p components", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme", @@ -48,8 +48,8 @@ "build": "aegir build" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-collections": "^6.0.11", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-collections": "^6.0.12", "@multiformats/multiaddr": "^12.2.3", "progress-events": "^1.0.0", "uint8arraylist": "^2.4.8" diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md index e59da5daf7..0b7f34399b 100644 --- a/packages/interface/CHANGELOG.md +++ b/packages/interface/CHANGELOG.md @@ -5,6 +5,13 @@ * add start/stop events to libp2p interface ([#407](https://github.com/libp2p/js-libp2p-interfaces/issues/407)) ([016c1e8](https://github.com/libp2p/js-libp2p-interfaces/commit/016c1e82b060c93c80546cd8c493ec6e6c97cbec)) +## [2.2.1](https://github.com/libp2p/js-libp2p/compare/interface-v2.2.0...interface-v2.2.1) (2024-11-18) + + +### Bug Fixes + +* update transport listener options ([#2826](https://github.com/libp2p/js-libp2p/issues/2826)) ([656db81](https://github.com/libp2p/js-libp2p/commit/656db81cff6f5cb8d1d5523f1928323057308b5a)) + ## [2.2.0](https://github.com/libp2p/js-libp2p/compare/interface-v2.1.3...interface-v2.2.0) (2024-10-28) diff --git a/packages/interface/package.json b/packages/interface/package.json index d1998455e2..6b0137010a 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface", - "version": "2.2.0", + "version": "2.2.1", "description": "The interface implemented by a libp2p node", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme", diff --git a/packages/kad-dht/CHANGELOG.md b/packages/kad-dht/CHANGELOG.md index 0e96495e25..ace76cffd6 100644 --- a/packages/kad-dht/CHANGELOG.md +++ b/packages/kad-dht/CHANGELOG.md @@ -106,6 +106,24 @@ * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 * @libp2p/peer-store bumped from ^10.0.9 to ^10.0.10 +## [14.1.2](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.1.1...kad-dht-v14.1.2) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-store bumped from ^11.0.11 to ^11.0.12 + ## [14.1.1](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.1.0...kad-dht-v14.1.1) (2024-11-16) diff --git a/packages/kad-dht/package.json b/packages/kad-dht/package.json index 1b294462aa..7fd15cbae4 100644 --- a/packages/kad-dht/package.json +++ b/packages/kad-dht/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/kad-dht", - "version": "14.1.1", + "version": "14.1.2", "description": "JavaScript implementation of the Kad-DHT for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht#readme", @@ -57,13 +57,13 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", "@libp2p/record": "^4.0.4", - "@libp2p/utils": "^6.2.0", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "any-signal": "^4.1.1", "interface-datastore": "^8.3.0", @@ -88,9 +88,9 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-store": "^11.0.11", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-store": "^11.0.12", "@types/lodash.random": "^3.2.9", "@types/lodash.range": "^3.2.9", "@types/sinon": "^17.0.3", diff --git a/packages/keychain/CHANGELOG.md b/packages/keychain/CHANGELOG.md index b5cbc0e2c9..c19d68bc15 100644 --- a/packages/keychain/CHANGELOG.md +++ b/packages/keychain/CHANGELOG.md @@ -47,6 +47,18 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [5.0.10](https://github.com/libp2p/js-libp2p/compare/keychain-v5.0.9...keychain-v5.0.10) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [5.0.9](https://github.com/libp2p/js-libp2p/compare/keychain-v5.0.8...keychain-v5.0.9) (2024-10-28) diff --git a/packages/keychain/package.json b/packages/keychain/package.json index affb415bf0..d2dda35984 100644 --- a/packages/keychain/package.json +++ b/packages/keychain/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/keychain", - "version": "5.0.9", + "version": "5.0.10", "description": "Key management and cryptographically protected messages", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/keychain#readme", @@ -59,8 +59,8 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", "@noble/hashes": "^1.5.0", "asn1js": "^3.0.5", "interface-datastore": "^8.3.0", @@ -70,7 +70,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "datastore-core": "^10.0.0" }, diff --git a/packages/libp2p/CHANGELOG.md b/packages/libp2p/CHANGELOG.md index c48d05fbb0..47d523739c 100644 --- a/packages/libp2p/CHANGELOG.md +++ b/packages/libp2p/CHANGELOG.md @@ -110,6 +110,23 @@ * @libp2p/tcp bumped from ^9.0.14 to ^9.0.15 * @libp2p/websockets bumped from ^8.0.14 to ^8.0.15 +## [2.3.1](https://github.com/libp2p/js-libp2p/compare/libp2p-v2.3.0...libp2p-v2.3.1) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/multistream-select bumped from ^6.0.8 to ^6.0.9 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/peer-store bumped from ^11.0.11 to ^11.0.12 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + ## [2.3.0](https://github.com/libp2p/js-libp2p/compare/libp2p-v2.2.1...libp2p-v2.3.0) (2024-11-16) diff --git a/packages/libp2p/package.json b/packages/libp2p/package.json index 6d59b75466..4df75bf246 100644 --- a/packages/libp2p/package.json +++ b/packages/libp2p/package.json @@ -1,6 +1,6 @@ { "name": "libp2p", - "version": "2.3.0", + "version": "2.3.1", "description": "JavaScript implementation of libp2p, a modular peer to peer network stack", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme", @@ -85,15 +85,15 @@ "test:webkit": "aegir test -t browser -- --browser webkit" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/logger": "^5.1.3", - "@libp2p/multistream-select": "^6.0.8", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-store": "^11.0.11", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/logger": "^5.1.4", + "@libp2p/multistream-select": "^6.0.9", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/peer-store": "^11.0.12", + "@libp2p/utils": "^6.2.1", "@multiformats/dns": "^1.0.6", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index 6663238c61..d40af4d54f 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -21,6 +21,17 @@ * devDependencies * @libp2p/peer-id bumped from ^4.0.2 to ^4.0.3 +## [5.1.4](https://github.com/libp2p/js-libp2p/compare/logger-v5.1.3...logger-v5.1.4) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [5.1.3](https://github.com/libp2p/js-libp2p/compare/logger-v5.1.2...logger-v5.1.3) (2024-10-28) diff --git a/packages/logger/package.json b/packages/logger/package.json index cb2dae4373..f91a6f366c 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/logger", - "version": "5.1.3", + "version": "5.1.4", "description": "A logging component for use in js-libp2p modules", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/logger#readme", @@ -54,14 +54,14 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.2.1", "@multiformats/multiaddr": "^12.2.3", "interface-datastore": "^8.3.0", "multiformats": "^13.1.0", "weald": "^1.0.2" }, "devDependencies": { - "@libp2p/peer-id": "^5.0.7", + "@libp2p/peer-id": "^5.0.8", "aegir": "^44.0.1", "sinon": "^18.0.0", "uint8arrays": "^5.1.0" diff --git a/packages/metrics-devtools/CHANGELOG.md b/packages/metrics-devtools/CHANGELOG.md index 95f2ae6853..319a60e391 100644 --- a/packages/metrics-devtools/CHANGELOG.md +++ b/packages/metrics-devtools/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [1.1.10](https://github.com/libp2p/js-libp2p/compare/devtools-metrics-v1.1.9...devtools-metrics-v1.1.10) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/simple-metrics bumped from ^1.2.6 to ^1.2.7 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + ## [1.1.9](https://github.com/libp2p/js-libp2p/compare/devtools-metrics-v1.1.8...devtools-metrics-v1.1.9) (2024-11-16) diff --git a/packages/metrics-devtools/package.json b/packages/metrics-devtools/package.json index 2423e2812b..332714b193 100644 --- a/packages/metrics-devtools/package.json +++ b/packages/metrics-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/devtools-metrics", - "version": "1.1.9", + "version": "1.1.10", "description": "Collect libp2p metrics and send them to browser DevTools", "author": "", "license": "Apache-2.0 OR MIT", @@ -68,11 +68,11 @@ "test:firefox": "aegir test -t browser --browser firefox" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/simple-metrics": "^1.2.6", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/simple-metrics": "^1.2.7", "@multiformats/multiaddr": "^12.3.0", "cborg": "^4.2.2", "it-pipe": "^3.0.1", @@ -82,7 +82,7 @@ "progress-events": "^1.0.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", + "@libp2p/crypto": "^5.0.7", "aegir": "^44.0.1", "sinon-ts": "^2.0.0" }, diff --git a/packages/metrics-prometheus/CHANGELOG.md b/packages/metrics-prometheus/CHANGELOG.md index ea7a37a0cc..30244b19d2 100644 --- a/packages/metrics-prometheus/CHANGELOG.md +++ b/packages/metrics-prometheus/CHANGELOG.md @@ -81,6 +81,20 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.2.6](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.5...prometheus-metrics-v4.2.6) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [4.2.5](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.4...prometheus-metrics-v4.2.5) (2024-11-16) diff --git a/packages/metrics-prometheus/package.json b/packages/metrics-prometheus/package.json index 88c4e4c383..a9da5aef18 100644 --- a/packages/metrics-prometheus/package.json +++ b/packages/metrics-prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/prometheus-metrics", - "version": "4.2.5", + "version": "4.2.6", "description": "Collect libp2p metrics for scraping by Prometheus or Graphana", "author": "", "license": "Apache-2.0 OR MIT", @@ -48,17 +48,17 @@ "test:electron-main": "aegir test -t electron-main --cov" }, "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.2.1", "it-foreach": "^2.1.0", "it-stream-types": "^2.0.1", "prom-client": "^15.1.2", "uint8arraylist": "^2.4.8" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "@multiformats/multiaddr": "^12.2.3", "aegir": "^44.0.1", "it-drain": "^3.0.7", diff --git a/packages/metrics-simple/CHANGELOG.md b/packages/metrics-simple/CHANGELOG.md index b73394931d..ae7618bbee 100644 --- a/packages/metrics-simple/CHANGELOG.md +++ b/packages/metrics-simple/CHANGELOG.md @@ -5,6 +5,16 @@ * track stream metrics ([#2](https://github.com/libp2p/js-libp2p-simple-metrics/issues/2)) ([caafb3d](https://github.com/libp2p/js-libp2p-simple-metrics/commit/caafb3d103fd7df0a2a4e6b3e800f4bc9c35c58f)) +## [1.2.7](https://github.com/libp2p/js-libp2p/compare/simple-metrics-v1.2.6...simple-metrics-v1.2.7) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [1.2.6](https://github.com/libp2p/js-libp2p/compare/simple-metrics-v1.2.5...simple-metrics-v1.2.6) (2024-10-28) diff --git a/packages/metrics-simple/package.json b/packages/metrics-simple/package.json index bb591d53e8..3d3970b00a 100644 --- a/packages/metrics-simple/package.json +++ b/packages/metrics-simple/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/simple-metrics", - "version": "1.2.6", + "version": "1.2.7", "description": "Simple in-memory metrics gathering for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/metrics-simple#readme", @@ -50,8 +50,8 @@ "dep-check": "aegir dep-check -i events" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/logger": "^5.1.3", + "@libp2p/interface": "^2.2.1", + "@libp2p/logger": "^5.1.4", "it-foreach": "^2.1.0", "it-stream-types": "^2.0.1", "tdigest": "^0.1.2" diff --git a/packages/multistream-select/CHANGELOG.md b/packages/multistream-select/CHANGELOG.md index 2a52e3243f..882977bd3a 100644 --- a/packages/multistream-select/CHANGELOG.md +++ b/packages/multistream-select/CHANGELOG.md @@ -19,6 +19,17 @@ * devDependencies * @libp2p/logger bumped from ^4.0.1 to ^4.0.2 +## [6.0.9](https://github.com/libp2p/js-libp2p/compare/multistream-select-v6.0.8...multistream-select-v6.0.9) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [6.0.8](https://github.com/libp2p/js-libp2p/compare/multistream-select-v6.0.7...multistream-select-v6.0.8) (2024-10-28) diff --git a/packages/multistream-select/package.json b/packages/multistream-select/package.json index 5521ba1e15..2d88fb0eb6 100644 --- a/packages/multistream-select/package.json +++ b/packages/multistream-select/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/multistream-select", - "version": "6.0.8", + "version": "6.0.9", "description": "JavaScript implementation of multistream-select", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/multistream-select#readme", @@ -58,7 +58,7 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.2.1", "it-length-prefixed": "^9.0.4", "it-length-prefixed-stream": "^1.1.7", "it-stream-types": "^2.0.1", @@ -69,7 +69,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "iso-random-stream": "^2.0.2", "it-all": "^3.0.6", diff --git a/packages/peer-collections/CHANGELOG.md b/packages/peer-collections/CHANGELOG.md index 6e9c412993..e95a5b7f24 100644 --- a/packages/peer-collections/CHANGELOG.md +++ b/packages/peer-collections/CHANGELOG.md @@ -35,6 +35,19 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [6.0.12](https://github.com/libp2p/js-libp2p/compare/peer-collections-v6.0.11...peer-collections-v6.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + ## [6.0.11](https://github.com/libp2p/js-libp2p/compare/peer-collections-v6.0.10...peer-collections-v6.0.11) (2024-11-16) diff --git a/packages/peer-collections/package.json b/packages/peer-collections/package.json index 92094257f7..906e5564d8 100644 --- a/packages/peer-collections/package.json +++ b/packages/peer-collections/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-collections", - "version": "6.0.11", + "version": "6.0.12", "description": "Stores values against a peer id", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-collections#readme", @@ -54,13 +54,13 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "multiformats": "^13.2.2" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", + "@libp2p/crypto": "^5.0.7", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", "sinon": "^18.0.0", diff --git a/packages/peer-discovery-bootstrap/CHANGELOG.md b/packages/peer-discovery-bootstrap/CHANGELOG.md index 964cd81022..0e0a0659f4 100644 --- a/packages/peer-discovery-bootstrap/CHANGELOG.md +++ b/packages/peer-discovery-bootstrap/CHANGELOG.md @@ -83,6 +83,20 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.12](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.11...bootstrap-v11.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [11.0.11](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.10...bootstrap-v11.0.11) (2024-11-16) diff --git a/packages/peer-discovery-bootstrap/package.json b/packages/peer-discovery-bootstrap/package.json index edc59b6782..f4b247ff65 100644 --- a/packages/peer-discovery-bootstrap/package.json +++ b/packages/peer-discovery-bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/bootstrap", - "version": "11.0.11", + "version": "11.0.12", "description": "Peer discovery via a list of bootstrap peers", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-bootstrap#readme", @@ -54,15 +54,15 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-id": "^5.0.8", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "sinon-ts": "^2.0.0" }, diff --git a/packages/peer-discovery-mdns/CHANGELOG.md b/packages/peer-discovery-mdns/CHANGELOG.md index 3b730cb622..9b7cb8eb60 100644 --- a/packages/peer-discovery-mdns/CHANGELOG.md +++ b/packages/peer-discovery-mdns/CHANGELOG.md @@ -105,6 +105,22 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.12](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.11...mdns-v11.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [11.0.11](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.10...mdns-v11.0.11) (2024-11-16) diff --git a/packages/peer-discovery-mdns/package.json b/packages/peer-discovery-mdns/package.json index bcb86c755e..2cc03bfe97 100644 --- a/packages/peer-discovery-mdns/package.json +++ b/packages/peer-discovery-mdns/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mdns", - "version": "11.0.11", + "version": "11.0.12", "description": "Node.js libp2p mDNS discovery implementation for peer discovery", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-mdns#readme", @@ -50,19 +50,19 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@types/multicast-dns": "^7.2.4", "dns-packet": "^5.6.1", "multicast-dns": "^7.2.5" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "p-wait-for": "^5.0.2", "sinon-ts": "^2.0.0" diff --git a/packages/peer-id/CHANGELOG.md b/packages/peer-id/CHANGELOG.md index b4bbd4d1b8..415c5411bc 100644 --- a/packages/peer-id/CHANGELOG.md +++ b/packages/peer-id/CHANGELOG.md @@ -11,6 +11,16 @@ * dependencies * @libp2p/interface bumped from ^1.0.1 to ^1.0.2 +## [5.0.8](https://github.com/libp2p/js-libp2p/compare/peer-id-v5.0.7...peer-id-v5.0.8) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + ## [5.0.7](https://github.com/libp2p/js-libp2p/compare/peer-id-v5.0.6...peer-id-v5.0.7) (2024-10-28) diff --git a/packages/peer-id/package.json b/packages/peer-id/package.json index 53dedf850b..e6262576f5 100644 --- a/packages/peer-id/package.json +++ b/packages/peer-id/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-id", - "version": "5.0.7", + "version": "5.0.8", "description": "Implementation of @libp2p/interface-peer-id", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-id#readme", @@ -54,8 +54,8 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", "multiformats": "^13.1.0", "uint8arrays": "^5.1.0" }, diff --git a/packages/peer-record/CHANGELOG.md b/packages/peer-record/CHANGELOG.md index 56e202ff75..7950e592df 100644 --- a/packages/peer-record/CHANGELOG.md +++ b/packages/peer-record/CHANGELOG.md @@ -60,6 +60,18 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [8.0.12](https://github.com/libp2p/js-libp2p/compare/peer-record-v8.0.11...peer-record-v8.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + ## [8.0.11](https://github.com/libp2p/js-libp2p/compare/peer-record-v8.0.10...peer-record-v8.0.11) (2024-11-16) diff --git a/packages/peer-record/package.json b/packages/peer-record/package.json index 7e8a43afed..70e97d35ed 100644 --- a/packages/peer-record/package.json +++ b/packages/peer-record/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-record", - "version": "8.0.11", + "version": "8.0.12", "description": "Used to transfer signed peer data across the network", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-record#readme", @@ -61,10 +61,10 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "multiformats": "^13.2.2", "protons-runtime": "^5.4.0", diff --git a/packages/peer-store/CHANGELOG.md b/packages/peer-store/CHANGELOG.md index a7185c5e46..1e39e6d8e9 100644 --- a/packages/peer-store/CHANGELOG.md +++ b/packages/peer-store/CHANGELOG.md @@ -68,6 +68,20 @@ * dependencies * @libp2p/peer-record bumped from ^7.0.8 to ^7.0.9 +## [11.0.12](https://github.com/libp2p/js-libp2p/compare/peer-store-v11.0.11...peer-store-v11.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/peer-record bumped from ^8.0.11 to ^8.0.12 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [11.0.11](https://github.com/libp2p/js-libp2p/compare/peer-store-v11.0.10...peer-store-v11.0.11) (2024-11-16) diff --git a/packages/peer-store/package.json b/packages/peer-store/package.json index 8e476a6b68..abf0cf3102 100644 --- a/packages/peer-store/package.json +++ b/packages/peer-store/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/peer-store", - "version": "11.0.11", + "version": "11.0.12", "description": "Stores information about peers libp2p knows on the network", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-store#readme", @@ -59,10 +59,10 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.11", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/peer-record": "^8.0.12", "@multiformats/multiaddr": "^12.2.3", "interface-datastore": "^8.3.0", "it-all": "^3.0.6", @@ -73,7 +73,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", "datastore-core": "^10.0.0", diff --git a/packages/pnet/CHANGELOG.md b/packages/pnet/CHANGELOG.md index dd29146aa7..ae32e8cfa6 100644 --- a/packages/pnet/CHANGELOG.md +++ b/packages/pnet/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.11...pnet-v2.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.10...pnet-v2.0.11) (2024-11-16) diff --git a/packages/pnet/package.json b/packages/pnet/package.json index c87f021efe..7861cddc85 100644 --- a/packages/pnet/package.json +++ b/packages/pnet/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/pnet", - "version": "2.0.11", + "version": "2.0.12", "description": "Implementation of Connection protection management via a shared secret", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pnet#readme", @@ -50,8 +50,8 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", "it-byte-stream": "^1.0.10", "it-map": "^3.1.0", "it-pair": "^2.0.6", @@ -62,9 +62,9 @@ "xsalsa20": "^1.2.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "@multiformats/multiaddr": "^12.2.3", "@types/xsalsa20": "^1.1.3", "aegir": "^44.0.1", diff --git a/packages/protocol-autonat/CHANGELOG.md b/packages/protocol-autonat/CHANGELOG.md index ffcc743e9c..643d435733 100644 --- a/packages/protocol-autonat/CHANGELOG.md +++ b/packages/protocol-autonat/CHANGELOG.md @@ -55,6 +55,26 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/autonat-v2.0.11...autonat-v2.0.12) (2024-11-18) + + +### Bug Fixes + +* add autonat capability ([#2827](https://github.com/libp2p/js-libp2p/issues/2827)) ([05d559f](https://github.com/libp2p/js-libp2p/commit/05d559f545d7408646f2b7dcd5adf5c6771a97e6)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/autonat-v2.0.10...autonat-v2.0.11) (2024-11-16) diff --git a/packages/protocol-autonat/package.json b/packages/protocol-autonat/package.json index 5cc7989918..a8f420739e 100644 --- a/packages/protocol-autonat/package.json +++ b/packages/protocol-autonat/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/autonat", - "version": "2.0.11", + "version": "2.0.12", "description": "Implementation of Autonat Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-autonat#readme", @@ -52,10 +52,10 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "it-first": "^3.0.6", "it-length-prefixed": "^9.0.4", @@ -67,8 +67,8 @@ "uint8arraylist": "^2.4.8" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.7", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-all": "^3.0.6", "it-pushable": "^3.2.3", diff --git a/packages/protocol-dcutr/CHANGELOG.md b/packages/protocol-dcutr/CHANGELOG.md index 308b41a4f2..badef97a55 100644 --- a/packages/protocol-dcutr/CHANGELOG.md +++ b/packages/protocol-dcutr/CHANGELOG.md @@ -44,6 +44,17 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/dcutr-v2.0.11...dcutr-v2.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/dcutr-v2.0.10...dcutr-v2.0.11) (2024-11-16) diff --git a/packages/protocol-dcutr/package.json b/packages/protocol-dcutr/package.json index 6095ba9e61..fd8ed62ea7 100644 --- a/packages/protocol-dcutr/package.json +++ b/packages/protocol-dcutr/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/dcutr", - "version": "2.0.11", + "version": "2.0.12", "description": "Implementation of the DCUtR Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-dcutr#readme", @@ -52,9 +52,9 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "delay": "^6.0.0", diff --git a/packages/protocol-echo/CHANGELOG.md b/packages/protocol-echo/CHANGELOG.md index 6c6c4803dd..cb03e5b674 100644 --- a/packages/protocol-echo/CHANGELOG.md +++ b/packages/protocol-echo/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.1.3](https://github.com/libp2p/js-libp2p/compare/echo-v2.1.2...echo-v2.1.3) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [2.1.2](https://github.com/libp2p/js-libp2p/compare/echo-v2.1.1...echo-v2.1.2) (2024-11-16) diff --git a/packages/protocol-echo/package.json b/packages/protocol-echo/package.json index 0929630c3b..8a8335714a 100644 --- a/packages/protocol-echo/package.json +++ b/packages/protocol-echo/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/echo", - "version": "2.1.2", + "version": "2.1.3", "description": "Implementation of an Echo protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-echo#readme", @@ -51,14 +51,14 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", "@multiformats/multiaddr": "^12.3.1", "it-byte-stream": "^1.1.0", "it-pipe": "^3.0.1" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-all": "^3.0.6", "it-pair": "^2.0.6", diff --git a/packages/protocol-fetch/CHANGELOG.md b/packages/protocol-fetch/CHANGELOG.md index cd1a7a72ec..0e439f3b86 100644 --- a/packages/protocol-fetch/CHANGELOG.md +++ b/packages/protocol-fetch/CHANGELOG.md @@ -48,6 +48,20 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/fetch-v2.0.11...fetch-v2.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/fetch-v2.0.10...fetch-v2.0.11) (2024-11-16) diff --git a/packages/protocol-fetch/package.json b/packages/protocol-fetch/package.json index f7e2a82065..ce4fa3311e 100644 --- a/packages/protocol-fetch/package.json +++ b/packages/protocol-fetch/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/fetch", - "version": "2.0.11", + "version": "2.0.12", "description": "Implementation of the Fetch Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-fetch#readme", @@ -52,17 +52,17 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", "it-protobuf-stream": "^1.1.3", "protons-runtime": "^5.4.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "aegir": "^44.0.1", "it-pair": "^2.0.6", "protons": "^7.5.0", diff --git a/packages/protocol-identify/CHANGELOG.md b/packages/protocol-identify/CHANGELOG.md index c7e1a12313..1021300d5c 100644 --- a/packages/protocol-identify/CHANGELOG.md +++ b/packages/protocol-identify/CHANGELOG.md @@ -76,6 +76,22 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [3.0.12](https://github.com/libp2p/js-libp2p/compare/identify-v3.0.11...identify-v3.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/peer-record bumped from ^8.0.11 to ^8.0.12 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [3.0.11](https://github.com/libp2p/js-libp2p/compare/identify-v3.0.10...identify-v3.0.11) (2024-11-16) diff --git a/packages/protocol-identify/package.json b/packages/protocol-identify/package.json index f4b1a5382a..84413a5685 100644 --- a/packages/protocol-identify/package.json +++ b/packages/protocol-identify/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/identify", - "version": "3.0.11", + "version": "3.0.12", "description": "Implementation of the Identify Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-identify#readme", @@ -52,12 +52,12 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.11", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/peer-record": "^8.0.12", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "it-drain": "^3.0.7", @@ -69,7 +69,7 @@ "wherearewe": "^2.0.1" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "delay": "^6.0.0", "it-length-prefixed": "^9.0.4", diff --git a/packages/protocol-perf/CHANGELOG.md b/packages/protocol-perf/CHANGELOG.md index 65ea51800f..eb7ababa2c 100644 --- a/packages/protocol-perf/CHANGELOG.md +++ b/packages/protocol-perf/CHANGELOG.md @@ -82,6 +82,19 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.0.12](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.11...perf-v4.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [4.0.11](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.10...perf-v4.0.11) (2024-11-16) diff --git a/packages/protocol-perf/package.json b/packages/protocol-perf/package.json index 5357647bb0..72366889b0 100644 --- a/packages/protocol-perf/package.json +++ b/packages/protocol-perf/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/perf", - "version": "4.0.11", + "version": "4.0.12", "description": "Implementation of Perf Protocol", "author": "@maschad / @marcopolo", "license": "Apache-2.0 OR MIT", @@ -52,14 +52,14 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", "@multiformats/multiaddr": "^12.2.3", "it-pushable": "^3.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-last": "^3.0.6", "it-pair": "^2.0.6", diff --git a/packages/protocol-ping/CHANGELOG.md b/packages/protocol-ping/CHANGELOG.md index 9458513582..e4949a74d9 100644 --- a/packages/protocol-ping/CHANGELOG.md +++ b/packages/protocol-ping/CHANGELOG.md @@ -50,6 +50,20 @@ * devDependencies * @libp2p/peer-id-factory bumped from ^4.0.3 to ^4.0.4 +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/ping-v2.0.11...ping-v2.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/ping-v2.0.10...ping-v2.0.11) (2024-11-16) diff --git a/packages/protocol-ping/package.json b/packages/protocol-ping/package.json index 0610e8cb7b..b4a980e4ff 100644 --- a/packages/protocol-ping/package.json +++ b/packages/protocol-ping/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/ping", - "version": "2.0.11", + "version": "2.0.12", "description": "Implementation of Ping Protocol", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-ping#readme", @@ -50,16 +50,16 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", "@multiformats/multiaddr": "^12.2.3", "it-byte-stream": "^1.1.0", "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "aegir": "^44.0.1", "it-pair": "^2.0.6", "p-defer": "^4.0.1", diff --git a/packages/pubsub-floodsub/CHANGELOG.md b/packages/pubsub-floodsub/CHANGELOG.md index 71ec6ab2c6..aef95e80f0 100644 --- a/packages/pubsub-floodsub/CHANGELOG.md +++ b/packages/pubsub-floodsub/CHANGELOG.md @@ -98,6 +98,22 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [10.1.10](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.9...floodsub-v10.1.10) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/pubsub bumped from ^10.0.11 to ^10.0.12 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [10.1.9](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.8...floodsub-v10.1.9) (2024-11-16) diff --git a/packages/pubsub-floodsub/package.json b/packages/pubsub-floodsub/package.json index 38f51cfb3c..c09cefabae 100644 --- a/packages/pubsub-floodsub/package.json +++ b/packages/pubsub-floodsub/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/floodsub", - "version": "10.1.9", + "version": "10.1.10", "description": "libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pubsub-floodsub#readme", @@ -60,18 +60,18 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/pubsub": "^10.0.11", + "@libp2p/interface": "^2.2.1", + "@libp2p/pubsub": "^10.0.12", "protons-runtime": "^5.4.0", "uint8arraylist": "^2.4.8", "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", "@multiformats/multiaddr": "^12.2.3", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index 70e6faeeb7..f7575eee80 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -75,6 +75,22 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [10.0.12](https://github.com/libp2p/js-libp2p/compare/pubsub-v10.0.11...pubsub-v10.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [10.0.11](https://github.com/libp2p/js-libp2p/compare/pubsub-v10.0.10...pubsub-v10.0.11) (2024-11-16) diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index a4ab78fe08..12fca826a6 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/pubsub", - "version": "10.0.11", + "version": "10.0.12", "description": "libp2p pubsub base class", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pubsub#readme", @@ -84,12 +84,12 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "it-length-prefixed": "^9.0.4", "it-pipe": "^3.0.1", "it-pushable": "^3.2.3", @@ -99,7 +99,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", "delay": "^6.0.0", diff --git a/packages/stream-multiplexer-mplex/CHANGELOG.md b/packages/stream-multiplexer-mplex/CHANGELOG.md index cdec28c39b..e3c72fe619 100644 --- a/packages/stream-multiplexer-mplex/CHANGELOG.md +++ b/packages/stream-multiplexer-mplex/CHANGELOG.md @@ -78,6 +78,19 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.12](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.11...mplex-v11.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [11.0.11](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.10...mplex-v11.0.11) (2024-11-16) diff --git a/packages/stream-multiplexer-mplex/package.json b/packages/stream-multiplexer-mplex/package.json index 8a32eda2d6..97f77f1745 100644 --- a/packages/stream-multiplexer-mplex/package.json +++ b/packages/stream-multiplexer-mplex/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mplex", - "version": "11.0.11", + "version": "11.0.12", "description": "JavaScript implementation of https://github.com/libp2p/mplex", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex#readme", @@ -62,8 +62,8 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/utils": "^6.2.1", "it-pipe": "^3.0.1", "it-pushable": "^3.2.3", "it-stream-types": "^2.0.1", @@ -72,8 +72,8 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "benchmark": "^2.1.4", "cborg": "^4.2.0", diff --git a/packages/transport-circuit-relay-v2/CHANGELOG.md b/packages/transport-circuit-relay-v2/CHANGELOG.md index 83d450d973..1b6231231c 100644 --- a/packages/transport-circuit-relay-v2/CHANGELOG.md +++ b/packages/transport-circuit-relay-v2/CHANGELOG.md @@ -101,6 +101,24 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [3.1.2](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.1.1...circuit-relay-v2-v3.1.2) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-collections bumped from ^6.0.11 to ^6.0.12 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/peer-record bumped from ^8.0.11 to ^8.0.12 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [3.1.1](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.1.0...circuit-relay-v2-v3.1.1) (2024-11-16) diff --git a/packages/transport-circuit-relay-v2/package.json b/packages/transport-circuit-relay-v2/package.json index 561e97b3fe..860e74af45 100644 --- a/packages/transport-circuit-relay-v2/package.json +++ b/packages/transport-circuit-relay-v2/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/circuit-relay-v2", - "version": "3.1.1", + "version": "3.1.2", "description": "Implementation of Circuit Relay v2", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-circuit-relay-v2#readme", @@ -52,13 +52,13 @@ "doc-check": "aegir doc-check" }, "dependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-collections": "^6.0.11", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/peer-record": "^8.0.11", - "@libp2p/utils": "^6.2.0", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-collections": "^6.0.12", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/peer-record": "^8.0.12", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.3.0", "any-signal": "^4.1.1", @@ -73,8 +73,8 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "delay": "^6.0.0", "it-drain": "^3.0.7", diff --git a/packages/transport-memory/CHANGELOG.md b/packages/transport-memory/CHANGELOG.md index 27b5e2a9e6..4a06aa1991 100644 --- a/packages/transport-memory/CHANGELOG.md +++ b/packages/transport-memory/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.0.1](https://github.com/libp2p/js-libp2p/compare/memory-v1.0.0...memory-v1.0.1) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## 1.0.0 (2024-11-16) diff --git a/packages/transport-memory/package.json b/packages/transport-memory/package.json index ed05d874e7..2e8ebf2165 100644 --- a/packages/transport-memory/package.json +++ b/packages/transport-memory/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/memory", - "version": "1.0.0", + "version": "1.0.1", "description": "A memory transport for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", @@ -51,7 +51,7 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", + "@libp2p/interface": "^2.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.5.0", "@types/sinon": "^17.0.3", @@ -62,8 +62,8 @@ "uint8arraylist": "^2.4.8" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "aegir": "^44.0.1", "sinon": "^19.0.2", "sinon-ts": "^2.0.0" diff --git a/packages/transport-tcp/CHANGELOG.md b/packages/transport-tcp/CHANGELOG.md index e3da4310d7..4351e50acc 100644 --- a/packages/transport-tcp/CHANGELOG.md +++ b/packages/transport-tcp/CHANGELOG.md @@ -89,6 +89,18 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [10.0.13](https://github.com/libp2p/js-libp2p/compare/tcp-v10.0.12...tcp-v10.0.13) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [10.0.12](https://github.com/libp2p/js-libp2p/compare/tcp-v10.0.11...tcp-v10.0.12) (2024-11-16) diff --git a/packages/transport-tcp/package.json b/packages/transport-tcp/package.json index c6bad9156e..9fd2c095c0 100644 --- a/packages/transport-tcp/package.json +++ b/packages/transport-tcp/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/tcp", - "version": "10.0.12", + "version": "10.0.13", "description": "A TCP transport for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-tcp#readme", @@ -60,8 +60,8 @@ "test:electron-main": "aegir test -t electron-main" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/utils": "^6.2.1", "@multiformats/mafmt": "^12.1.6", "@multiformats/multiaddr": "^12.2.3", "@types/sinon": "^17.0.3", @@ -72,7 +72,7 @@ "stream-to-it": "^1.0.1" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "p-wait-for": "^5.0.2", "sinon": "^18.0.0", diff --git a/packages/transport-webrtc/CHANGELOG.md b/packages/transport-webrtc/CHANGELOG.md index 4d16207316..4caca789ea 100644 --- a/packages/transport-webrtc/CHANGELOG.md +++ b/packages/transport-webrtc/CHANGELOG.md @@ -111,6 +111,22 @@ * @libp2p/websockets bumped from ^8.0.14 to ^8.0.15 * libp2p bumped from ^1.2.2 to ^1.2.3 +## [5.0.18](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.17...webrtc-v5.0.18) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface-compliance-tests bumped from ^6.1.9 to ^6.1.10 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [5.0.17](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.16...webrtc-v5.0.17) (2024-11-16) diff --git a/packages/transport-webrtc/package.json b/packages/transport-webrtc/package.json index 40f7fa724e..6076ea0b0e 100644 --- a/packages/transport-webrtc/package.json +++ b/packages/transport-webrtc/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/webrtc", - "version": "5.0.17", + "version": "5.0.18", "description": "A libp2p transport using WebRTC connections", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme", @@ -51,10 +51,10 @@ }, "dependencies": { "@chainsafe/libp2p-noise": "^16.0.0", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "detect-browser": "^5.3.0", @@ -76,9 +76,9 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface-compliance-tests": "^6.1.9", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/logger": "^5.1.4", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", "delay": "^6.0.0", diff --git a/packages/transport-websockets/CHANGELOG.md b/packages/transport-websockets/CHANGELOG.md index a22e58df1e..d042916413 100644 --- a/packages/transport-websockets/CHANGELOG.md +++ b/packages/transport-websockets/CHANGELOG.md @@ -70,6 +70,18 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [9.0.13](https://github.com/libp2p/js-libp2p/compare/websockets-v9.0.12...websockets-v9.0.13) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + ## [9.0.12](https://github.com/libp2p/js-libp2p/compare/websockets-v9.0.11...websockets-v9.0.12) (2024-11-16) diff --git a/packages/transport-websockets/package.json b/packages/transport-websockets/package.json index 98e775946e..bc08520026 100644 --- a/packages/transport-websockets/package.json +++ b/packages/transport-websockets/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/websockets", - "version": "9.0.12", + "version": "9.0.13", "description": "JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-websockets#readme", @@ -74,8 +74,8 @@ "test:electron-main": "aegir test -t electron-main -f ./dist/test/node.js --cov" }, "dependencies": { - "@libp2p/interface": "^2.2.0", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.4.0", "@multiformats/multiaddr-to-uri": "^10.0.1", @@ -88,7 +88,7 @@ "ws": "^8.17.0" }, "devDependencies": { - "@libp2p/logger": "^5.1.3", + "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "is-loopback-addr": "^2.0.2", "p-wait-for": "^5.0.2", diff --git a/packages/transport-webtransport/CHANGELOG.md b/packages/transport-webtransport/CHANGELOG.md index 4804ec4806..e5f2f4d5a8 100644 --- a/packages/transport-webtransport/CHANGELOG.md +++ b/packages/transport-webtransport/CHANGELOG.md @@ -96,6 +96,22 @@ * devDependencies * libp2p bumped from ^1.2.2 to ^1.2.3 +## [5.0.18](https://github.com/libp2p/js-libp2p/compare/webtransport-v5.0.17...webtransport-v5.0.18) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/ping bumped from ^2.0.11 to ^2.0.12 + * libp2p bumped from ^2.3.0 to ^2.3.1 + ## [5.0.17](https://github.com/libp2p/js-libp2p/compare/webtransport-v5.0.16...webtransport-v5.0.17) (2024-11-16) diff --git a/packages/transport-webtransport/package.json b/packages/transport-webtransport/package.json index 87ad33b937..72a7943ea6 100644 --- a/packages/transport-webtransport/package.json +++ b/packages/transport-webtransport/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/webtransport", - "version": "5.0.17", + "version": "5.0.18", "description": "JavaScript implementation of the WebTransport module that libp2p uses and that implements the interface-transport spec", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webtransport#readme", @@ -51,9 +51,9 @@ }, "dependencies": { "@chainsafe/libp2p-noise": "^16.0.0", - "@libp2p/interface": "^2.2.0", - "@libp2p/peer-id": "^5.0.7", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/peer-id": "^5.0.8", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.2.1", "it-stream-types": "^2.0.1", @@ -64,17 +64,17 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", + "@libp2p/crypto": "^5.0.7", "@libp2p/daemon-client": "^9.0.1", - "@libp2p/logger": "^5.1.3", - "@libp2p/ping": "^2.0.11", + "@libp2p/logger": "^5.1.4", + "@libp2p/ping": "^2.0.12", "@noble/hashes": "^1.4.0", "aegir": "^44.0.1", "execa": "^9.1.0", "go-libp2p": "^1.2.0", "it-map": "^3.1.0", "it-to-buffer": "^4.0.7", - "libp2p": "^2.3.0", + "libp2p": "^2.3.1", "p-defer": "^4.0.1", "p-wait-for": "^5.0.2" }, diff --git a/packages/upnp-nat/CHANGELOG.md b/packages/upnp-nat/CHANGELOG.md index 08f3537ccc..6d6d6f6621 100644 --- a/packages/upnp-nat/CHANGELOG.md +++ b/packages/upnp-nat/CHANGELOG.md @@ -64,6 +64,21 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [2.0.12](https://github.com/libp2p/js-libp2p/compare/upnp-nat-v2.0.11...upnp-nat-v2.0.12) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/interface-internal bumped from ^2.1.0 to ^2.1.1 + * @libp2p/utils bumped from ^6.2.0 to ^6.2.1 + * devDependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [2.0.11](https://github.com/libp2p/js-libp2p/compare/upnp-nat-v2.0.10...upnp-nat-v2.0.11) (2024-11-16) diff --git a/packages/upnp-nat/package.json b/packages/upnp-nat/package.json index dc51b77ae9..e82af1e05d 100644 --- a/packages/upnp-nat/package.json +++ b/packages/upnp-nat/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/upnp-nat", - "version": "2.0.11", + "version": "2.0.12", "description": "UPnP NAT hole punching", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/upnp-nat#readme", @@ -52,18 +52,18 @@ "dependencies": { "@achingbrain/nat-port-mapper": "^2.0.1", "@chainsafe/is-ip": "^2.0.2", - "@libp2p/interface": "^2.2.0", - "@libp2p/interface-internal": "^2.1.0", - "@libp2p/utils": "^6.2.0", + "@libp2p/interface": "^2.2.1", + "@libp2p/interface-internal": "^2.1.1", + "@libp2p/utils": "^6.2.1", "@multiformats/multiaddr": "^12.2.3", "@multiformats/multiaddr-matcher": "^1.4.0", "p-defer": "^4.0.1", "race-signal": "^1.1.0" }, "devDependencies": { - "@libp2p/crypto": "^5.0.6", - "@libp2p/logger": "^5.1.3", - "@libp2p/peer-id": "^5.0.7", + "@libp2p/crypto": "^5.0.7", + "@libp2p/logger": "^5.1.4", + "@libp2p/peer-id": "^5.0.8", "aegir": "^44.0.1", "sinon-ts": "^2.0.0" }, diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 6357eec69b..a15f98dfff 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -36,6 +36,19 @@ * @libp2p/logger bumped from ^4.0.2 to ^4.0.3 * @libp2p/peer-id-factory bumped from ^4.0.1 to ^4.0.2 +## [6.2.1](https://github.com/libp2p/js-libp2p/compare/utils-v6.2.0...utils-v6.2.1) (2024-11-18) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @libp2p/crypto bumped from ^5.0.6 to ^5.0.7 + * @libp2p/interface bumped from ^2.2.0 to ^2.2.1 + * @libp2p/logger bumped from ^5.1.3 to ^5.1.4 + * devDependencies + * @libp2p/peer-id bumped from ^5.0.7 to ^5.0.8 + ## [6.2.0](https://github.com/libp2p/js-libp2p/compare/utils-v6.1.3...utils-v6.2.0) (2024-11-16) diff --git a/packages/utils/package.json b/packages/utils/package.json index ce47127851..3862694b86 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/utils", - "version": "6.2.0", + "version": "6.2.1", "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/utils#readme", @@ -156,9 +156,9 @@ }, "dependencies": { "@chainsafe/is-ip": "^2.0.2", - "@libp2p/crypto": "^5.0.6", - "@libp2p/interface": "^2.2.0", - "@libp2p/logger": "^5.1.3", + "@libp2p/crypto": "^5.0.7", + "@libp2p/interface": "^2.2.1", + "@libp2p/logger": "^5.1.4", "@multiformats/multiaddr": "^12.2.3", "@sindresorhus/fnv1a": "^3.1.0", "@types/murmurhash3js-revisited": "^3.0.3", @@ -179,7 +179,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/peer-id": "^5.0.7", + "@libp2p/peer-id": "^5.0.8", "@types/netmask": "^2.0.5", "aegir": "^44.0.1", "benchmark": "^2.1.4", From 3c72aa6b1ac76b4281a1e9db4ba6ac66f009c462 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 19 Nov 2024 13:59:50 +0000 Subject: [PATCH 05/10] chore: update error message check (#2830) The latest version of chrome changes the error message thrown from `signal.throwIfAborted` --- packages/transport-webrtc/test/peer.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transport-webrtc/test/peer.spec.ts b/packages/transport-webrtc/test/peer.spec.ts index aa951d34d1..c7ad17ed0a 100644 --- a/packages/transport-webrtc/test/peer.spec.ts +++ b/packages/transport-webrtc/test/peer.spec.ts @@ -155,7 +155,7 @@ describe('webrtc basic', () => { }), handleIncomingStream(recipient) ])) - .to.eventually.be.rejected.with.property('message', 'Oh noes!') + .to.eventually.be.rejected.with.property('message').that.matches(/Oh noes!/) }) }) From f53f65d1805f9cd41f1b55558cef06d03f7a796c Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 19 Nov 2024 14:00:02 +0000 Subject: [PATCH 06/10] fix: remove slow network test (#2829) There's no reliable way to test this in a transport agnostic way. The idea is if async work is done after `.dial` is invoked but before `upgrader.upgradeInbound` is called, and the abort signal aborts, then `.dial` should respect the abort and throw, but there's no cross-transport way to inject the latency that would cause the test to fail so remove the test. --- .../src/transport/index.ts | 15 +-------- .../src/transport/utils.ts | 33 ------------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/packages/interface-compliance-tests/src/transport/index.ts b/packages/interface-compliance-tests/src/transport/index.ts index 9b12d7bfa9..82fb68631a 100644 --- a/packages/interface-compliance-tests/src/transport/index.ts +++ b/packages/interface-compliance-tests/src/transport/index.ts @@ -9,7 +9,7 @@ import pRetry from 'p-retry' import pWaitFor from 'p-wait-for' import { raceSignal } from 'race-signal' import { isValidTick } from '../is-valid-tick.js' -import { createPeer, getTransportManager, getUpgrader, slowNetwork } from './utils.js' +import { createPeer, getTransportManager, getUpgrader } from './utils.js' import type { TestSetup } from '../index.js' import type { Echo } from '@libp2p/echo' import type { Connection, Libp2p, Stream, StreamHandler } from '@libp2p/interface' @@ -130,19 +130,6 @@ export default (common: TestSetup): void => { .with.property('name', 'AbortError') }) - it('abort while dialing throws AbortError', async () => { - ({ dialer, listener, dialAddrs } = await getSetup(common)) - slowNetwork(dialer, 100) - - const controller = new AbortController() - setTimeout(() => { controller.abort() }, 50) - - await expect(dialer.dial(dialAddrs[0], { - signal: controller.signal - })).to.eventually.be.rejected() - .with.property('name', 'AbortError') - }) - it('should close all streams when the connection closes', async () => { ({ dialer, listener, dialAddrs } = await getSetup(common)) diff --git a/packages/interface-compliance-tests/src/transport/utils.ts b/packages/interface-compliance-tests/src/transport/utils.ts index f5e21c743d..d7a576c236 100644 --- a/packages/interface-compliance-tests/src/transport/utils.ts +++ b/packages/interface-compliance-tests/src/transport/utils.ts @@ -3,8 +3,6 @@ import { echo } from '@libp2p/echo' import { memory } from '@libp2p/memory' import { plaintext } from '@libp2p/plaintext' -import delay from 'delay' -import map from 'it-map' import { createLibp2p } from 'libp2p' import { mockMuxer } from '../mocks/muxer.js' import type { Echo } from '@libp2p/echo' @@ -36,37 +34,6 @@ export async function createPeer (config: Partial = {}): Promise< }) } -/** - * Monkey patch the upgrader in the passed libp2p to add latency to any - * multiaddr connections upgraded to connections - this is to work with - * transports that have their own muxers/encrypters and do not support - * connection protection - */ -export function slowNetwork (libp2p: any, latency: number): void { - const upgrader: Upgrader = getUpgrader(libp2p) - - const originalUpgradeInbound = upgrader.upgradeInbound.bind(upgrader) - const originalUpgradeOutbound = upgrader.upgradeOutbound.bind(upgrader) - - upgrader.upgradeInbound = async (maConn, opts) => { - maConn.source = map(maConn.source, async (buf) => { - await delay(latency) - return buf - }) - - return originalUpgradeInbound(maConn, opts) - } - - upgrader.upgradeOutbound = async (maConn, opts) => { - maConn.source = map(maConn.source, async (buf) => { - await delay(latency) - return buf - }) - - return originalUpgradeOutbound(maConn, opts) - } -} - export function getUpgrader (libp2p: any): Upgrader { return libp2p.components.upgrader } From 635283461e87399c5cde6e729c4b993188e10168 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 19 Nov 2024 15:14:03 +0000 Subject: [PATCH 07/10] chore: release main (#2831) --- .release-please-manifest.json | 2 +- packages/interface-compliance-tests/CHANGELOG.md | 7 +++++++ packages/interface-compliance-tests/package.json | 2 +- packages/kad-dht/CHANGELOG.md | 9 +++++++++ packages/kad-dht/package.json | 4 ++-- packages/metrics-prometheus/CHANGELOG.md | 9 +++++++++ packages/metrics-prometheus/package.json | 4 ++-- packages/peer-discovery-bootstrap/CHANGELOG.md | 9 +++++++++ packages/peer-discovery-bootstrap/package.json | 4 ++-- packages/peer-discovery-mdns/CHANGELOG.md | 9 +++++++++ packages/peer-discovery-mdns/package.json | 4 ++-- packages/pnet/CHANGELOG.md | 9 +++++++++ packages/pnet/package.json | 4 ++-- packages/protocol-perf/CHANGELOG.md | 9 +++++++++ packages/protocol-perf/package.json | 4 ++-- packages/pubsub-floodsub/CHANGELOG.md | 9 +++++++++ packages/pubsub-floodsub/package.json | 4 ++-- packages/stream-multiplexer-mplex/CHANGELOG.md | 9 +++++++++ packages/stream-multiplexer-mplex/package.json | 4 ++-- packages/transport-circuit-relay-v2/CHANGELOG.md | 9 +++++++++ packages/transport-circuit-relay-v2/package.json | 4 ++-- packages/transport-webrtc/CHANGELOG.md | 9 +++++++++ packages/transport-webrtc/package.json | 4 ++-- 23 files changed, 119 insertions(+), 22 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 14d22ebb14..eec4d658e2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"packages/connection-encrypter-plaintext":"2.0.11","packages/connection-encrypter-tls":"2.0.11","packages/crypto":"5.0.7","packages/interface":"2.2.1","packages/interface-compliance-tests":"6.1.10","packages/interface-internal":"2.1.1","packages/kad-dht":"14.1.2","packages/keychain":"5.0.10","packages/libp2p":"2.3.1","packages/logger":"5.1.4","packages/metrics-devtools":"1.1.10","packages/metrics-prometheus":"4.2.6","packages/metrics-simple":"1.2.7","packages/multistream-select":"6.0.9","packages/peer-collections":"6.0.12","packages/peer-discovery-bootstrap":"11.0.12","packages/peer-discovery-mdns":"11.0.12","packages/peer-id":"5.0.8","packages/peer-record":"8.0.12","packages/peer-store":"11.0.12","packages/pnet":"2.0.12","packages/protocol-autonat":"2.0.12","packages/protocol-dcutr":"2.0.12","packages/protocol-echo":"2.1.3","packages/protocol-fetch":"2.0.12","packages/protocol-identify":"3.0.12","packages/protocol-perf":"4.0.12","packages/protocol-ping":"2.0.12","packages/pubsub":"10.0.12","packages/pubsub-floodsub":"10.1.10","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.12","packages/transport-circuit-relay-v2":"3.1.2","packages/transport-memory":"1.0.1","packages/transport-tcp":"10.0.13","packages/transport-webrtc":"5.0.18","packages/transport-websockets":"9.0.13","packages/transport-webtransport":"5.0.18","packages/upnp-nat":"2.0.12","packages/utils":"6.2.1"} +{"packages/connection-encrypter-plaintext":"2.0.11","packages/connection-encrypter-tls":"2.0.11","packages/crypto":"5.0.7","packages/interface":"2.2.1","packages/interface-compliance-tests":"6.1.11","packages/interface-internal":"2.1.1","packages/kad-dht":"14.1.3","packages/keychain":"5.0.10","packages/libp2p":"2.3.1","packages/logger":"5.1.4","packages/metrics-devtools":"1.1.10","packages/metrics-prometheus":"4.2.7","packages/metrics-simple":"1.2.7","packages/multistream-select":"6.0.9","packages/peer-collections":"6.0.12","packages/peer-discovery-bootstrap":"11.0.13","packages/peer-discovery-mdns":"11.0.13","packages/peer-id":"5.0.8","packages/peer-record":"8.0.12","packages/peer-store":"11.0.12","packages/pnet":"2.0.13","packages/protocol-autonat":"2.0.12","packages/protocol-dcutr":"2.0.12","packages/protocol-echo":"2.1.3","packages/protocol-fetch":"2.0.12","packages/protocol-identify":"3.0.12","packages/protocol-perf":"4.0.13","packages/protocol-ping":"2.0.12","packages/pubsub":"10.0.12","packages/pubsub-floodsub":"10.1.11","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.13","packages/transport-circuit-relay-v2":"3.1.3","packages/transport-memory":"1.0.1","packages/transport-tcp":"10.0.13","packages/transport-webrtc":"5.0.19","packages/transport-websockets":"9.0.13","packages/transport-webtransport":"5.0.18","packages/upnp-nat":"2.0.12","packages/utils":"6.2.1"} diff --git a/packages/interface-compliance-tests/CHANGELOG.md b/packages/interface-compliance-tests/CHANGELOG.md index 41e7a17c0f..84c496085c 100644 --- a/packages/interface-compliance-tests/CHANGELOG.md +++ b/packages/interface-compliance-tests/CHANGELOG.md @@ -75,6 +75,13 @@ * dependencies * @libp2p/utils bumped from ^5.2.4 to ^5.2.5 +## [6.1.11](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.10...interface-compliance-tests-v6.1.11) (2024-11-19) + + +### Bug Fixes + +* remove slow network test ([#2829](https://github.com/libp2p/js-libp2p/issues/2829)) ([f53f65d](https://github.com/libp2p/js-libp2p/commit/f53f65d1805f9cd41f1b55558cef06d03f7a796c)) + ## [6.1.10](https://github.com/libp2p/js-libp2p/compare/interface-compliance-tests-v6.1.9...interface-compliance-tests-v6.1.10) (2024-11-18) diff --git a/packages/interface-compliance-tests/package.json b/packages/interface-compliance-tests/package.json index 40beabc733..9d1541b953 100644 --- a/packages/interface-compliance-tests/package.json +++ b/packages/interface-compliance-tests/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/interface-compliance-tests", - "version": "6.1.10", + "version": "6.1.11", "description": "Compliance tests for JS libp2p interfaces", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-compliance-tests#readme", diff --git a/packages/kad-dht/CHANGELOG.md b/packages/kad-dht/CHANGELOG.md index ace76cffd6..6956230d8d 100644 --- a/packages/kad-dht/CHANGELOG.md +++ b/packages/kad-dht/CHANGELOG.md @@ -106,6 +106,15 @@ * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 * @libp2p/peer-store bumped from ^10.0.9 to ^10.0.10 +## [14.1.3](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.1.2...kad-dht-v14.1.3) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [14.1.2](https://github.com/libp2p/js-libp2p/compare/kad-dht-v14.1.1...kad-dht-v14.1.2) (2024-11-18) diff --git a/packages/kad-dht/package.json b/packages/kad-dht/package.json index 7fd15cbae4..fb7053b9ab 100644 --- a/packages/kad-dht/package.json +++ b/packages/kad-dht/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/kad-dht", - "version": "14.1.2", + "version": "14.1.3", "description": "JavaScript implementation of the Kad-DHT for libp2p", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/kad-dht#readme", @@ -88,7 +88,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "@libp2p/peer-store": "^11.0.12", "@types/lodash.random": "^3.2.9", diff --git a/packages/metrics-prometheus/CHANGELOG.md b/packages/metrics-prometheus/CHANGELOG.md index 30244b19d2..19efdf7705 100644 --- a/packages/metrics-prometheus/CHANGELOG.md +++ b/packages/metrics-prometheus/CHANGELOG.md @@ -81,6 +81,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.2.7](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.6...prometheus-metrics-v4.2.7) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [4.2.6](https://github.com/libp2p/js-libp2p/compare/prometheus-metrics-v4.2.5...prometheus-metrics-v4.2.6) (2024-11-18) diff --git a/packages/metrics-prometheus/package.json b/packages/metrics-prometheus/package.json index a9da5aef18..f5b70fc2af 100644 --- a/packages/metrics-prometheus/package.json +++ b/packages/metrics-prometheus/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/prometheus-metrics", - "version": "4.2.6", + "version": "4.2.7", "description": "Collect libp2p metrics for scraping by Prometheus or Graphana", "author": "", "license": "Apache-2.0 OR MIT", @@ -56,7 +56,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.7", - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "@libp2p/peer-id": "^5.0.8", "@multiformats/multiaddr": "^12.2.3", diff --git a/packages/peer-discovery-bootstrap/CHANGELOG.md b/packages/peer-discovery-bootstrap/CHANGELOG.md index 0e0a0659f4..e0a69befa6 100644 --- a/packages/peer-discovery-bootstrap/CHANGELOG.md +++ b/packages/peer-discovery-bootstrap/CHANGELOG.md @@ -83,6 +83,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.13](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.12...bootstrap-v11.0.13) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [11.0.12](https://github.com/libp2p/js-libp2p/compare/bootstrap-v11.0.11...bootstrap-v11.0.12) (2024-11-18) diff --git a/packages/peer-discovery-bootstrap/package.json b/packages/peer-discovery-bootstrap/package.json index f4b247ff65..48e3ebd2e5 100644 --- a/packages/peer-discovery-bootstrap/package.json +++ b/packages/peer-discovery-bootstrap/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/bootstrap", - "version": "11.0.12", + "version": "11.0.13", "description": "Peer discovery via a list of bootstrap peers", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-bootstrap#readme", @@ -61,7 +61,7 @@ "@multiformats/multiaddr": "^12.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "sinon-ts": "^2.0.0" diff --git a/packages/peer-discovery-mdns/CHANGELOG.md b/packages/peer-discovery-mdns/CHANGELOG.md index 9b7cb8eb60..56920d9315 100644 --- a/packages/peer-discovery-mdns/CHANGELOG.md +++ b/packages/peer-discovery-mdns/CHANGELOG.md @@ -105,6 +105,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.13](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.12...mdns-v11.0.13) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [11.0.12](https://github.com/libp2p/js-libp2p/compare/mdns-v11.0.11...mdns-v11.0.12) (2024-11-18) diff --git a/packages/peer-discovery-mdns/package.json b/packages/peer-discovery-mdns/package.json index 2cc03bfe97..20c0dbfd68 100644 --- a/packages/peer-discovery-mdns/package.json +++ b/packages/peer-discovery-mdns/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mdns", - "version": "11.0.12", + "version": "11.0.13", "description": "Node.js libp2p mDNS discovery implementation for peer discovery", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/peer-discovery-mdns#readme", @@ -61,7 +61,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.7", - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "p-wait-for": "^5.0.2", diff --git a/packages/pnet/CHANGELOG.md b/packages/pnet/CHANGELOG.md index ae32e8cfa6..0d05744999 100644 --- a/packages/pnet/CHANGELOG.md +++ b/packages/pnet/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.0.13](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.12...pnet-v2.0.13) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [2.0.12](https://github.com/libp2p/js-libp2p/compare/pnet-v2.0.11...pnet-v2.0.12) (2024-11-18) diff --git a/packages/pnet/package.json b/packages/pnet/package.json index 7861cddc85..a0be69a4ee 100644 --- a/packages/pnet/package.json +++ b/packages/pnet/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/pnet", - "version": "2.0.12", + "version": "2.0.13", "description": "Implementation of Connection protection management via a shared secret", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pnet#readme", @@ -62,7 +62,7 @@ "xsalsa20": "^1.2.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "@libp2p/peer-id": "^5.0.8", "@multiformats/multiaddr": "^12.2.3", diff --git a/packages/protocol-perf/CHANGELOG.md b/packages/protocol-perf/CHANGELOG.md index eb7ababa2c..baebc5255a 100644 --- a/packages/protocol-perf/CHANGELOG.md +++ b/packages/protocol-perf/CHANGELOG.md @@ -82,6 +82,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [4.0.13](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.12...perf-v4.0.13) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [4.0.12](https://github.com/libp2p/js-libp2p/compare/perf-v4.0.11...perf-v4.0.12) (2024-11-18) diff --git a/packages/protocol-perf/package.json b/packages/protocol-perf/package.json index 72366889b0..d47c65c2f0 100644 --- a/packages/protocol-perf/package.json +++ b/packages/protocol-perf/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/perf", - "version": "4.0.12", + "version": "4.0.13", "description": "Implementation of Perf Protocol", "author": "@maschad / @marcopolo", "license": "Apache-2.0 OR MIT", @@ -58,7 +58,7 @@ "it-pushable": "^3.2.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "it-last": "^3.0.6", diff --git a/packages/pubsub-floodsub/CHANGELOG.md b/packages/pubsub-floodsub/CHANGELOG.md index aef95e80f0..a76334b24e 100644 --- a/packages/pubsub-floodsub/CHANGELOG.md +++ b/packages/pubsub-floodsub/CHANGELOG.md @@ -98,6 +98,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [10.1.11](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.10...floodsub-v10.1.11) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [10.1.10](https://github.com/libp2p/js-libp2p/compare/floodsub-v10.1.9...floodsub-v10.1.10) (2024-11-18) diff --git a/packages/pubsub-floodsub/package.json b/packages/pubsub-floodsub/package.json index c09cefabae..ae302c3f09 100644 --- a/packages/pubsub-floodsub/package.json +++ b/packages/pubsub-floodsub/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/floodsub", - "version": "10.1.10", + "version": "10.1.11", "description": "libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/pubsub-floodsub#readme", @@ -68,7 +68,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.7", - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "@libp2p/peer-collections": "^6.0.12", "@libp2p/peer-id": "^5.0.8", diff --git a/packages/stream-multiplexer-mplex/CHANGELOG.md b/packages/stream-multiplexer-mplex/CHANGELOG.md index e3c72fe619..5812d4721a 100644 --- a/packages/stream-multiplexer-mplex/CHANGELOG.md +++ b/packages/stream-multiplexer-mplex/CHANGELOG.md @@ -78,6 +78,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [11.0.13](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.12...mplex-v11.0.13) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [11.0.12](https://github.com/libp2p/js-libp2p/compare/mplex-v11.0.11...mplex-v11.0.12) (2024-11-18) diff --git a/packages/stream-multiplexer-mplex/package.json b/packages/stream-multiplexer-mplex/package.json index 97f77f1745..21b1075df9 100644 --- a/packages/stream-multiplexer-mplex/package.json +++ b/packages/stream-multiplexer-mplex/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/mplex", - "version": "11.0.12", + "version": "11.0.13", "description": "JavaScript implementation of https://github.com/libp2p/mplex", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex#readme", @@ -72,7 +72,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "benchmark": "^2.1.4", diff --git a/packages/transport-circuit-relay-v2/CHANGELOG.md b/packages/transport-circuit-relay-v2/CHANGELOG.md index 1b6231231c..7a9ec6b7f0 100644 --- a/packages/transport-circuit-relay-v2/CHANGELOG.md +++ b/packages/transport-circuit-relay-v2/CHANGELOG.md @@ -101,6 +101,15 @@ * devDependencies * @libp2p/interface-compliance-tests bumped from ^5.3.0 to ^5.3.1 +## [3.1.3](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.1.2...circuit-relay-v2-v3.1.3) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [3.1.2](https://github.com/libp2p/js-libp2p/compare/circuit-relay-v2-v3.1.1...circuit-relay-v2-v3.1.2) (2024-11-18) diff --git a/packages/transport-circuit-relay-v2/package.json b/packages/transport-circuit-relay-v2/package.json index 860e74af45..949d5b7cd8 100644 --- a/packages/transport-circuit-relay-v2/package.json +++ b/packages/transport-circuit-relay-v2/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/circuit-relay-v2", - "version": "3.1.2", + "version": "3.1.3", "description": "Implementation of Circuit Relay v2", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-circuit-relay-v2#readme", @@ -73,7 +73,7 @@ "uint8arrays": "^5.1.0" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "aegir": "^44.0.1", "delay": "^6.0.0", diff --git a/packages/transport-webrtc/CHANGELOG.md b/packages/transport-webrtc/CHANGELOG.md index 4caca789ea..3f9ff4c3f8 100644 --- a/packages/transport-webrtc/CHANGELOG.md +++ b/packages/transport-webrtc/CHANGELOG.md @@ -111,6 +111,15 @@ * @libp2p/websockets bumped from ^8.0.14 to ^8.0.15 * libp2p bumped from ^1.2.2 to ^1.2.3 +## [5.0.19](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.18...webrtc-v5.0.19) (2024-11-19) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @libp2p/interface-compliance-tests bumped from ^6.1.10 to ^6.1.11 + ## [5.0.18](https://github.com/libp2p/js-libp2p/compare/webrtc-v5.0.17...webrtc-v5.0.18) (2024-11-18) diff --git a/packages/transport-webrtc/package.json b/packages/transport-webrtc/package.json index 6076ea0b0e..e7debd79d8 100644 --- a/packages/transport-webrtc/package.json +++ b/packages/transport-webrtc/package.json @@ -1,6 +1,6 @@ { "name": "@libp2p/webrtc", - "version": "5.0.18", + "version": "5.0.19", "description": "A libp2p transport using WebRTC connections", "license": "Apache-2.0 OR MIT", "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme", @@ -77,7 +77,7 @@ }, "devDependencies": { "@libp2p/crypto": "^5.0.7", - "@libp2p/interface-compliance-tests": "^6.1.10", + "@libp2p/interface-compliance-tests": "^6.1.11", "@libp2p/logger": "^5.1.4", "@types/sinon": "^17.0.3", "aegir": "^44.0.1", From d866eb5bb8269485364c233119331ca073ff1343 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Tue, 19 Nov 2024 16:52:49 +0000 Subject: [PATCH 08/10] feat: add auto-tls service (#2798) Adds an optional service that requests a Let's Encrypt-style TLS certificate when publicly dialable addresses are detected. This will allow transports such as WebSockets to upgrade themselves to be the secure version. --- .release-please-manifest.json | 2 +- .release-please.json | 1 + packages/auto-tls/LICENSE | 4 + packages/auto-tls/LICENSE-APACHE | 5 + packages/auto-tls/LICENSE-MIT | 19 ++ packages/auto-tls/README.md | 109 +++++++ packages/auto-tls/package.json | 78 +++++ packages/auto-tls/src/auto-tls.browser.ts | 10 + packages/auto-tls/src/auto-tls.ts | 317 +++++++++++++++++++ packages/auto-tls/src/constants.ts | 11 + packages/auto-tls/src/domain-mapper.ts | 145 +++++++++ packages/auto-tls/src/errors.ts | 4 + packages/auto-tls/src/index.ts | 171 ++++++++++ packages/auto-tls/src/utils.ts | 150 +++++++++ packages/auto-tls/test/domain-mapper.spec.ts | 138 ++++++++ packages/auto-tls/test/fixtures/ca.ts | 80 +++++ packages/auto-tls/test/fixtures/cert.ts | 155 +++++++++ packages/auto-tls/test/index.spec.ts | 291 +++++++++++++++++ packages/auto-tls/test/utils.spec.ts | 92 ++++++ packages/auto-tls/tsconfig.json | 21 ++ packages/auto-tls/typedoc.json | 5 + packages/interface/src/index.ts | 23 ++ 22 files changed, 1830 insertions(+), 1 deletion(-) create mode 100644 packages/auto-tls/LICENSE create mode 100644 packages/auto-tls/LICENSE-APACHE create mode 100644 packages/auto-tls/LICENSE-MIT create mode 100644 packages/auto-tls/README.md create mode 100644 packages/auto-tls/package.json create mode 100644 packages/auto-tls/src/auto-tls.browser.ts create mode 100644 packages/auto-tls/src/auto-tls.ts create mode 100644 packages/auto-tls/src/constants.ts create mode 100644 packages/auto-tls/src/domain-mapper.ts create mode 100644 packages/auto-tls/src/errors.ts create mode 100644 packages/auto-tls/src/index.ts create mode 100644 packages/auto-tls/src/utils.ts create mode 100644 packages/auto-tls/test/domain-mapper.spec.ts create mode 100644 packages/auto-tls/test/fixtures/ca.ts create mode 100644 packages/auto-tls/test/fixtures/cert.ts create mode 100644 packages/auto-tls/test/index.spec.ts create mode 100644 packages/auto-tls/test/utils.spec.ts create mode 100644 packages/auto-tls/tsconfig.json create mode 100644 packages/auto-tls/typedoc.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eec4d658e2..44b92c7181 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"packages/connection-encrypter-plaintext":"2.0.11","packages/connection-encrypter-tls":"2.0.11","packages/crypto":"5.0.7","packages/interface":"2.2.1","packages/interface-compliance-tests":"6.1.11","packages/interface-internal":"2.1.1","packages/kad-dht":"14.1.3","packages/keychain":"5.0.10","packages/libp2p":"2.3.1","packages/logger":"5.1.4","packages/metrics-devtools":"1.1.10","packages/metrics-prometheus":"4.2.7","packages/metrics-simple":"1.2.7","packages/multistream-select":"6.0.9","packages/peer-collections":"6.0.12","packages/peer-discovery-bootstrap":"11.0.13","packages/peer-discovery-mdns":"11.0.13","packages/peer-id":"5.0.8","packages/peer-record":"8.0.12","packages/peer-store":"11.0.12","packages/pnet":"2.0.13","packages/protocol-autonat":"2.0.12","packages/protocol-dcutr":"2.0.12","packages/protocol-echo":"2.1.3","packages/protocol-fetch":"2.0.12","packages/protocol-identify":"3.0.12","packages/protocol-perf":"4.0.13","packages/protocol-ping":"2.0.12","packages/pubsub":"10.0.12","packages/pubsub-floodsub":"10.1.11","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.13","packages/transport-circuit-relay-v2":"3.1.3","packages/transport-memory":"1.0.1","packages/transport-tcp":"10.0.13","packages/transport-webrtc":"5.0.19","packages/transport-websockets":"9.0.13","packages/transport-webtransport":"5.0.18","packages/upnp-nat":"2.0.12","packages/utils":"6.2.1"} +{"packages/auto-tls":"0.0.0","packages/connection-encrypter-plaintext":"2.0.11","packages/connection-encrypter-tls":"2.0.11","packages/crypto":"5.0.7","packages/interface":"2.2.1","packages/interface-compliance-tests":"6.1.11","packages/interface-internal":"2.1.1","packages/kad-dht":"14.1.3","packages/keychain":"5.0.10","packages/libp2p":"2.3.1","packages/logger":"5.1.4","packages/metrics-devtools":"1.1.10","packages/metrics-prometheus":"4.2.7","packages/metrics-simple":"1.2.7","packages/multistream-select":"6.0.9","packages/peer-collections":"6.0.12","packages/peer-discovery-bootstrap":"11.0.13","packages/peer-discovery-mdns":"11.0.13","packages/peer-id":"5.0.8","packages/peer-record":"8.0.12","packages/peer-store":"11.0.12","packages/pnet":"2.0.13","packages/protocol-autonat":"2.0.12","packages/protocol-dcutr":"2.0.12","packages/protocol-echo":"2.1.3","packages/protocol-fetch":"2.0.12","packages/protocol-identify":"3.0.12","packages/protocol-perf":"4.0.13","packages/protocol-ping":"2.0.12","packages/pubsub":"10.0.12","packages/pubsub-floodsub":"10.1.11","packages/record":"4.0.4","packages/stream-multiplexer-mplex":"11.0.13","packages/transport-circuit-relay-v2":"3.1.3","packages/transport-memory":"1.0.1","packages/transport-tcp":"10.0.13","packages/transport-webrtc":"5.0.19","packages/transport-websockets":"9.0.13","packages/transport-webtransport":"5.0.18","packages/upnp-nat":"2.0.12","packages/utils":"6.2.1"} diff --git a/.release-please.json b/.release-please.json index 6fb8596cd7..636942d46b 100644 --- a/.release-please.json +++ b/.release-please.json @@ -9,6 +9,7 @@ { "type": "refactor", "section": "Refactors", "hidden": false } ], "packages": { + "packages/auto-tls": {}, "packages/connection-encrypter-plaintext": {}, "packages/connection-encrypter-tls": {}, "packages/crypto": {}, diff --git a/packages/auto-tls/LICENSE b/packages/auto-tls/LICENSE new file mode 100644 index 0000000000..20ce483c86 --- /dev/null +++ b/packages/auto-tls/LICENSE @@ -0,0 +1,4 @@ +This project is dual licensed under MIT and Apache-2.0. + +MIT: https://www.opensource.org/licenses/mit +Apache-2.0: https://www.apache.org/licenses/license-2.0 diff --git a/packages/auto-tls/LICENSE-APACHE b/packages/auto-tls/LICENSE-APACHE new file mode 100644 index 0000000000..14478a3b60 --- /dev/null +++ b/packages/auto-tls/LICENSE-APACHE @@ -0,0 +1,5 @@ +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/packages/auto-tls/LICENSE-MIT b/packages/auto-tls/LICENSE-MIT new file mode 100644 index 0000000000..72dc60d84b --- /dev/null +++ b/packages/auto-tls/LICENSE-MIT @@ -0,0 +1,19 @@ +The MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/packages/auto-tls/README.md b/packages/auto-tls/README.md new file mode 100644 index 0000000000..f6bd613536 --- /dev/null +++ b/packages/auto-tls/README.md @@ -0,0 +1,109 @@ +# @libp2p/auto-tls + +[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) +[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) +[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p) +[![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) + +> Automatically acquire a .libp2p.direct TLS certificate + +# About + + + +When a publicly dialable address is detected, use the p2p-forge service at + to acquire a valid Let's Encrypted-backed +TLS certificate, which the node can then use with the relevant transports. + +The node must be configured with a listener for at least one of the following +transports: + +- TCP or WS or WSS, (along with the Yamux multiplexer and TLS or Noise encryption) +- QUIC-v1 +- WebTransport + +It also requires the Identify protocol. + +## Example - Use UPnP to hole punch and auto-upgrade to Secure WebSockets + +```TypeScript +import { noise } from '@chainsafe/libp2p-noise' +import { yamux } from '@chainsafe/libp2p-yamux' +import { autoTLS } from '@libp2p/auto-tls' +import { identify } from '@libp2p/identify' +import { keychain } from '@libp2p/keychain' +import { webSockets } from '@libp2p/websockets' +import { uPnPNAT } from '@libp2p/upnp-nat' +import { createLibp2p } from 'libp2p' + +const node = await createLibp2p({ + addresses: { + listen: [ + '/ip4/0.0.0.0/tcp/0/ws' + ] + }, + transports: [ + webSockets() + ], + connectionEncrypters: [ + noise() + ], + streamMuxers: [ + yamux() + ], + services: { + autoTLS: autoTLS(), + identify: identify(), + keychain: keychain(), + upnp: uPnPNAT() + } +}) + +// ...time passes + +console.info(node.getMultiaddrs()) +// includes public WSS address: +// [ '/ip4/123.123.123.123/tcp/12345/wss ] +``` + +# Install + +```console +$ npm i @libp2p/plaintext +``` + +## Browser ` +``` + +# API Docs + +- + +# License + +Licensed under either of + +- Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p/blob/main/packages/connection-encrypter-plaintext/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p/blob/main/packages/connection-encrypter-plaintext/LICENSE-MIT) / ) + +# Contribution + +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. diff --git a/packages/auto-tls/package.json b/packages/auto-tls/package.json new file mode 100644 index 0000000000..e746b33187 --- /dev/null +++ b/packages/auto-tls/package.json @@ -0,0 +1,78 @@ +{ + "name": "@libp2p/auto-tls", + "version": "0.0.0", + "description": "Automatically acquire a .libp2p.direct TLS certificate", + "license": "Apache-2.0 OR MIT", + "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/auto-tls#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/libp2p/js-libp2p.git" + }, + "bugs": { + "url": "https://github.com/libp2p/js-libp2p/issues" + }, + "publishConfig": { + "access": "public", + "provenance": true + }, + "type": "module", + "types": "./dist/src/index.d.ts", + "files": [ + "src", + "dist", + "!dist/test", + "!**/*.tsbuildinfo" + ], + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "import": "./dist/src/index.js" + } + }, + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "project": true, + "sourceType": "module" + } + }, + "scripts": { + "build": "aegir build --bundle false", + "test": "aegir test -t node", + "clean": "aegir clean", + "lint": "aegir lint", + "test:node": "aegir test -t node --cov", + "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check" + }, + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/crypto": "^5.0.6", + "@libp2p/http-fetch": "^2.0.2", + "@libp2p/interface": "^2.2.0", + "@libp2p/interface-internal": "^2.0.10", + "@libp2p/keychain": "^5.0.9", + "@libp2p/utils": "^6.1.3", + "@multiformats/multiaddr": "^12.3.1", + "@multiformats/multiaddr-matcher": "^1.4.0", + "@peculiar/x509": "^1.12.3", + "acme-client": "^5.4.0", + "interface-datastore": "^8.3.1", + "multiformats": "^13.3.1", + "uint8arrays": "^5.1.0" + }, + "devDependencies": { + "@libp2p/logger": "^5.1.3", + "@libp2p/peer-id": "^5.0.7", + "aegir": "^44.0.1", + "datastore-core": "^10.0.2", + "delay": "^6.0.0", + "p-event": "^6.0.1", + "sinon": "^19.0.2", + "sinon-ts": "^2.0.0" + }, + "browser": { + "./dist/src/auto-tls.js": "./dist/src/auto-tls.browser.js" + }, + "sideEffects": false +} diff --git a/packages/auto-tls/src/auto-tls.browser.ts b/packages/auto-tls/src/auto-tls.browser.ts new file mode 100644 index 0000000000..e5e7df36f9 --- /dev/null +++ b/packages/auto-tls/src/auto-tls.browser.ts @@ -0,0 +1,10 @@ +import type { AutoTLS as AutoTLSInterface } from './index.js' +import type { TLSCertificate } from '@libp2p/interface' + +export class AutoTLS implements AutoTLSInterface { + public certificate?: TLSCertificate + + constructor () { + throw new Error('Auto-TLS does not work in browsers') + } +} diff --git a/packages/auto-tls/src/auto-tls.ts b/packages/auto-tls/src/auto-tls.ts new file mode 100644 index 0000000000..f2e9201364 --- /dev/null +++ b/packages/auto-tls/src/auto-tls.ts @@ -0,0 +1,317 @@ +import { ClientAuth } from '@libp2p/http-fetch/auth' +import { serviceCapabilities, serviceDependencies, start, stop } from '@libp2p/interface' +import { debounce } from '@libp2p/utils/debounce' +import { X509Certificate } from '@peculiar/x509' +import * as acme from 'acme-client' +import { Key } from 'interface-datastore' +import { base36 } from 'multiformats/bases/base36' +import { equals as uint8ArrayEquals } from 'uint8arrays/equals' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { DEFAULT_ACCOUNT_PRIVATE_KEY_BITS, DEFAULT_ACCOUNT_PRIVATE_KEY_NAME, DEFAULT_ACME_DIRECTORY, DEFAULT_CERTIFICATE_DATASTORE_KEY, DEFAULT_CERTIFICATE_PRIVATE_KEY_BITS, DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME, DEFAULT_FORGE_DOMAIN, DEFAULT_FORGE_ENDPOINT, DEFAULT_PROVISION_DELAY, DEFAULT_PROVISION_TIMEOUT, DEFAULT_RENEWAL_THRESHOLD } from './constants.js' +import { DomainMapper } from './domain-mapper.js' +import { createCsr, importFromPem, loadOrCreateKey, supportedAddressesFilter } from './utils.js' +import type { AutoTLSComponents, AutoTLSInit, AutoTLS as AutoTLSInterface } from './index.js' +import type { PeerId, PrivateKey, Logger, TypedEventTarget, Libp2pEvents, AbortOptions } from '@libp2p/interface' +import type { AddressManager } from '@libp2p/interface-internal' +import type { Keychain } from '@libp2p/keychain' +import type { DebouncedFunction } from '@libp2p/utils/debounce' +import type { Multiaddr } from '@multiformats/multiaddr' +import type { Datastore } from 'interface-datastore' + +type CertificateEvent = 'certificate:provision' | 'certificate:renew' + +interface Certificate { + key: string + cert: string + notAfter: Date +} + +export class AutoTLS implements AutoTLSInterface { + private readonly log: Logger + private readonly addressManager: AddressManager + private readonly keychain: Keychain + private readonly datastore: Datastore + private readonly privateKey: PrivateKey + private readonly peerId: PeerId + private readonly events: TypedEventTarget + private readonly forgeEndpoint: URL + private readonly forgeDomain: string + private readonly acmeDirectory: URL + private readonly clientAuth: ClientAuth + private readonly provisionTimeout: number + private readonly renewThreshold: number + private started: boolean + private shutdownController?: AbortController + public certificate?: Certificate + private fetching: boolean + private readonly onSelfPeerUpdate: DebouncedFunction + private renewTimeout?: ReturnType + private readonly accountPrivateKeyName: string + private readonly accountPrivateKeyBits: number + private readonly certificatePrivateKeyName: string + private readonly certificatePrivateKeyBits: number + private readonly certificateDatastoreKey: string + private readonly email + private readonly domain + private readonly domainMapper: DomainMapper + + constructor (components: AutoTLSComponents, init: AutoTLSInit = {}) { + this.log = components.logger.forComponent('libp2p:certificate-manager') + this.addressManager = components.addressManager + this.privateKey = components.privateKey + this.peerId = components.peerId + this.events = components.events + this.keychain = components.keychain + this.datastore = components.datastore + this.forgeEndpoint = new URL(init.forgeEndpoint ?? DEFAULT_FORGE_ENDPOINT) + this.forgeDomain = init.forgeDomain ?? DEFAULT_FORGE_DOMAIN + this.acmeDirectory = new URL(init.acmeDirectory ?? DEFAULT_ACME_DIRECTORY) + this.provisionTimeout = init.provisionTimeout ?? DEFAULT_PROVISION_TIMEOUT + this.renewThreshold = init.renewThreshold ?? DEFAULT_RENEWAL_THRESHOLD + this.accountPrivateKeyName = init.accountPrivateKeyName ?? DEFAULT_ACCOUNT_PRIVATE_KEY_NAME + this.accountPrivateKeyBits = init.accountPrivateKeyBits ?? DEFAULT_ACCOUNT_PRIVATE_KEY_BITS + this.certificatePrivateKeyName = init.certificatePrivateKeyName ?? DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME + this.certificatePrivateKeyBits = init.certificatePrivateKeyBits ?? DEFAULT_CERTIFICATE_PRIVATE_KEY_BITS + this.certificateDatastoreKey = init.certificateDatastoreKey ?? DEFAULT_CERTIFICATE_DATASTORE_KEY + this.clientAuth = new ClientAuth(this.privateKey) + this.started = false + this.fetching = false + this.onSelfPeerUpdate = debounce(this._onSelfPeerUpdate.bind(this), init.provisionDelay ?? DEFAULT_PROVISION_DELAY) + + const base36EncodedPeer = base36.encode(this.peerId.toCID().bytes) + this.domain = `${base36EncodedPeer}.${this.forgeDomain}` + this.email = `${base36EncodedPeer}@${this.forgeDomain}` + + this.domainMapper = new DomainMapper(components, { + ...init, + domain: this.domain + }) + } + + readonly [serviceCapabilities]: string[] = [ + '@libp2p/auto-tls' + ] + + get [serviceDependencies] (): string[] { + return [ + '@libp2p/identify', + '@libp2p/keychain' + ] + } + + async start (): Promise { + if (this.started) { + return + } + + await start(this.domainMapper) + this.events.addEventListener('self:peer:update', this.onSelfPeerUpdate) + this.shutdownController = new AbortController() + this.started = true + } + + async stop (): Promise { + this.events.removeEventListener('self:peer:update', this.onSelfPeerUpdate) + this.shutdownController?.abort() + clearTimeout(this.renewTimeout) + await stop(this.onSelfPeerUpdate, this.domainMapper) + this.started = false + } + + private _onSelfPeerUpdate (): void { + const addresses = this.addressManager.getAddresses().filter(supportedAddressesFilter) + + if (addresses.length === 0) { + this.log('not fetching certificate as we have no public addresses') + return + } + + if (!this.needsRenewal(this.certificate?.notAfter)) { + this.log('certificate does not need renewal') + return + } + + if (this.fetching) { + this.log('already fetching') + return + } + + this.fetching = true + + this.fetchCertificate(addresses, { + signal: AbortSignal.timeout(this.provisionTimeout) + }) + .catch(err => { + this.log.error('error fetching certificates - %e', err) + }) + .finally(() => { + this.fetching = false + }) + } + + private async fetchCertificate (multiaddrs: Multiaddr[], options?: AbortOptions): Promise { + this.log('fetching certificate') + + // TODO: handle rate limit errors like "too many new registrations (10) from this IP address in the last 3h0m0s, retry after 2024-11-01 09:22:38 UTC: see https://letsencrypt.org/docs/rate-limits/#new-registrations-per-ip-address" + + const certificatePrivateKey = await loadOrCreateKey(this.keychain, this.certificatePrivateKeyName, this.certificatePrivateKeyBits) + const { pem, cert } = await this.loadOrCreateCertificate(certificatePrivateKey, multiaddrs, options) + + let event: CertificateEvent = 'certificate:provision' + + if (this.certificate != null) { + event = 'certificate:renew' + } + + this.certificate = { + key: certificatePrivateKey, + cert: pem, + notAfter: cert.notAfter + } + + const renewAt = new Date(cert.notAfter.getTime() - this.renewThreshold) + + this.log('certificate expiry %s - renewing at %s', cert.notAfter, renewAt) + + // schedule renewing the certificate + clearTimeout(this.renewTimeout) + this.renewTimeout = setTimeout(() => { + Promise.resolve() + .then(async () => { + this.certificate = undefined + this.onSelfPeerUpdate() + }) + .catch(err => { + this.log.error('error renewing certificate - %e', err) + }) + }, Math.min(renewAt.getTime() - Date.now(), Math.pow(2, 31) - 1)) + + // emit a certificate event + this.log('dispatching %s', event) + this.events.safeDispatchEvent(event, { + detail: this.certificate + }) + } + + private async loadOrCreateCertificate (certificatePrivateKey: string, multiaddrs: Multiaddr[], options?: AbortOptions): Promise<{ pem: string, cert: X509Certificate }> { + const existingCertificate = await this.loadCertificateIfExists(certificatePrivateKey) + + if (existingCertificate != null) { + return existingCertificate + } + + this.log('creating new csr') + + // create CSR + const csr = await createCsr(`*.${this.domain}`, certificatePrivateKey) + + this.log('fetching new certificate') + + // create cert + const pem = await this.fetchAcmeCertificate(csr, multiaddrs, options) + const cert = new X509Certificate(pem) + + // cache cert + await this.datastore.put(new Key(this.certificateDatastoreKey), uint8ArrayFromString(pem)) + + return { + pem, + cert + } + } + + private async loadCertificateIfExists (certificatePrivateKey: string): Promise<{ pem: string, cert: X509Certificate } | undefined> { + const key = new Key(this.certificateDatastoreKey) + + try { + this.log.trace('try to load existing certificate') + const buf = await this.datastore.get(key) + const pem = uint8ArrayToString(buf) + const cert = new X509Certificate(pem) + + this.log.trace('loaded existing certificate') + + if (this.needsRenewal(cert.notAfter)) { + this.log('existing certificate requires renewal') + return + } + + try { + const key = importFromPem(certificatePrivateKey) + const certPublicKeyThumbprint = await cert.publicKey.getThumbprint() + const keyPublicKeyThumbprint = await crypto.subtle.digest('SHA-1', key.publicKey.raw) + + if (!uint8ArrayEquals( + new Uint8Array(certPublicKeyThumbprint, 0, certPublicKeyThumbprint.byteLength), + new Uint8Array(keyPublicKeyThumbprint, 0, keyPublicKeyThumbprint.byteLength) + )) { + this.log('certificate public key did not match the expected public key') + return + } + } catch (err: any) { + this.log.trace('failed to verify existing certificate with stored private key - %e', err) + return + } + + return { pem, cert } + } catch (err: any) { + this.log.trace('no existing valid certificate found - %e', err) + } + } + + async fetchAcmeCertificate (csr: string, multiaddrs: Multiaddr[], options?: AbortOptions): Promise { + const client = new acme.Client({ + directoryUrl: this.acmeDirectory.toString(), + accountKey: await loadOrCreateKey(this.keychain, this.accountPrivateKeyName, this.accountPrivateKeyBits) + }) + + return client.auto({ + csr, + email: this.email, + termsOfServiceAgreed: true, + challengeCreateFn: async (authz, challenge, keyAuthorization) => { + await this.configureAcmeChallengeResponse(multiaddrs, keyAuthorization, options) + }, + challengeRemoveFn: async (authz, challenge, keyAuthorization) => { + // no-op + }, + challengePriority: ['dns-01'], + skipChallengeVerification: true + }) + } + + async configureAcmeChallengeResponse (multiaddrs: Multiaddr[], keyAuthorization: string, options?: AbortOptions): Promise { + const addresses = multiaddrs.map(ma => ma.toString()) + + const endpoint = `${this.forgeEndpoint}v1/_acme-challenge` + this.log('asking %sv1/_acme-challenge to respond to the acme DNS challenge on our behalf', endpoint) + this.log('dialback public addresses: %s', addresses.join(', ')) + const response = await this.clientAuth.authenticatedFetch(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + value: keyAuthorization, + addresses + }), + ...options + }) + + if (!response.ok) { + this.log.error('invalid response from forge %o', response) + throw new Error('Invalid response status') + } + + this.log('%s will respond to the acme DNS challenge on our behalf', endpoint) + } + + private needsRenewal (notAfter?: Date): boolean { + if (notAfter == null) { + return true + } + + return notAfter.getTime() - this.renewThreshold < Date.now() + } +} diff --git a/packages/auto-tls/src/constants.ts b/packages/auto-tls/src/constants.ts new file mode 100644 index 0000000000..b8f26e82fb --- /dev/null +++ b/packages/auto-tls/src/constants.ts @@ -0,0 +1,11 @@ +export const DEFAULT_FORGE_ENDPOINT = 'https://registration.libp2p.direct' +export const DEFAULT_FORGE_DOMAIN = 'libp2p.direct' +export const DEFAULT_ACME_DIRECTORY = 'https://acme-v02.api.letsencrypt.org/directory' +export const DEFAULT_PROVISION_TIMEOUT = 10_000 +export const DEFAULT_PROVISION_DELAY = 5_000 +export const DEFAULT_RENEWAL_THRESHOLD = 86_400_000 +export const DEFAULT_ACCOUNT_PRIVATE_KEY_NAME = 'auto-tls-acme-account-private-key' +export const DEFAULT_ACCOUNT_PRIVATE_KEY_BITS = 2048 +export const DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME = 'auto-tls-certificate-private-key' +export const DEFAULT_CERTIFICATE_PRIVATE_KEY_BITS = 2048 +export const DEFAULT_CERTIFICATE_DATASTORE_KEY = '/libp2p/auto-tls/certificate' diff --git a/packages/auto-tls/src/domain-mapper.ts b/packages/auto-tls/src/domain-mapper.ts new file mode 100644 index 0000000000..1c87747528 --- /dev/null +++ b/packages/auto-tls/src/domain-mapper.ts @@ -0,0 +1,145 @@ +import { isIPv4, isIPv6 } from '@chainsafe/is-ip' +import { getPublicIps } from './utils.js' +import type { ComponentLogger, Libp2pEvents, Logger, TypedEventTarget } from '@libp2p/interface' +import type { AddressManager } from '@libp2p/interface-internal' + +export interface DomainMapperComponents { + logger: ComponentLogger + events: TypedEventTarget + addressManager: AddressManager +} + +export interface DomainMapperInit { + domain: string +} + +export class DomainMapper { + private readonly log: Logger + private readonly addressManager: AddressManager + private readonly events: TypedEventTarget + private readonly mappedAddresses: Set + private readonly domain: string + private hasCertificate: boolean + + constructor (components: DomainMapperComponents, init: DomainMapperInit) { + this.log = components.logger.forComponent('libp2p:certificate-manager:domain-mapper') + this.addressManager = components.addressManager + this.events = components.events + this.domain = init.domain + + this.mappedAddresses = new Set() + this.hasCertificate = false + + this.onCertificate = this.onCertificate.bind(this) + this.onSelfUpdate = this.onSelfUpdate.bind(this) + } + + start (): void { + this.events.addEventListener('self:peer:update', this.onSelfUpdate) + this.events.addEventListener('certificate:provision', this.onCertificate) + this.events.addEventListener('certificate:renew', this.onCertificate) + } + + stop (): void { + this.events.removeEventListener('self:peer:update', this.onSelfUpdate) + this.events.removeEventListener('certificate:provision', this.onCertificate) + this.events.removeEventListener('certificate:renew', this.onCertificate) + } + + onSelfUpdate (): void { + if (this.hasCertificate) { + this.updateMappings() + } + } + + onCertificate (): void { + this.hasCertificate = true + this.updateMappings() + } + + updateMappings (): void { + const publicIps = getPublicIps(this.addressManager.getAddresses()) + + // did our public IPs change? + const addedIp4 = [] + const addedIp6 = [] + const removedIp4 = [] + const removedIp6 = [] + + for (const ip of publicIps) { + if (this.mappedAddresses.has(ip)) { + continue + } + + if (isIPv4(ip)) { + addedIp4.push(ip) + } + + if (isIPv6(ip)) { + addedIp6.push(ip) + } + } + + for (const ip of this.mappedAddresses) { + if (publicIps.has(ip)) { + continue + } + + if (isIPv4(ip)) { + removedIp4.push(ip) + } + + if (isIPv6(ip)) { + removedIp6.push(ip) + } + } + + removedIp4.forEach(ip => { + const domain = this.toDomain(ip, 4) + this.log.trace('removing mapping of IP %s to domain %s', ip, domain) + this.addressManager.removeDNSMapping(domain) + this.mappedAddresses.delete(ip) + }) + + removedIp6.forEach(ip => { + const domain = this.toDomain(ip, 6) + this.log.trace('removing mapping of IP %s to domain %s', ip, domain) + this.addressManager.removeDNSMapping(domain) + this.mappedAddresses.delete(ip) + }) + + addedIp4.forEach(ip => { + const domain = this.toDomain(ip, 4) + this.log.trace('mapping IP %s to domain %s', ip, domain) + this.addressManager.addDNSMapping(domain, [ip]) + this.mappedAddresses.add(ip) + }) + + addedIp6.forEach(ip => { + const domain = this.toDomain(ip, 6) + this.log.trace('mapping IP %s to domain %s', ip, domain) + this.addressManager.addDNSMapping(domain, [ip]) + this.mappedAddresses.add(ip) + }) + } + + private toDomain (ip: string, family: 4 | 6): string { + if (family === 4) { + // https://github.com/ipshipyard/p2p-forge#ipv4-subdomain-handling + return `${ip.replaceAll('.', '-')}.${this.domain}` + } + + // https://github.com/ipshipyard/p2p-forge#ipv6-subdomain-handling + let ipSubdomain = ip.replaceAll(':', '-') + + if (ipSubdomain.startsWith('-')) { + ipSubdomain = `0${ipSubdomain}` + } + + if (ipSubdomain.endsWith('-')) { + ipSubdomain = `${ipSubdomain}0` + } + + return `${ipSubdomain}.${this.domain}` + } +} diff --git a/packages/auto-tls/src/errors.ts b/packages/auto-tls/src/errors.ts new file mode 100644 index 0000000000..561d4330cc --- /dev/null +++ b/packages/auto-tls/src/errors.ts @@ -0,0 +1,4 @@ +export class IncorrectKeyType extends Error { + static name = 'IncorrectKeyType' + name = 'IncorrectKeyType' +} diff --git a/packages/auto-tls/src/index.ts b/packages/auto-tls/src/index.ts new file mode 100644 index 0000000000..5e06311eef --- /dev/null +++ b/packages/auto-tls/src/index.ts @@ -0,0 +1,171 @@ +/** + * @packageDocumentation + * + * When a publicly dialable address is detected, use the p2p-forge service at + * https://registration.libp2p.direct to acquire a valid Let's Encrypted-backed + * TLS certificate, which the node can then use with the relevant transports. + * + * The node must be configured with a listener for at least one of the following + * transports: + * + * * TCP or WS or WSS, (along with the Yamux multiplexer and TLS or Noise encryption) + * * QUIC-v1 + * * WebTransport + * + * It also requires the Identify protocol. + * + * @example Use UPnP to hole punch and auto-upgrade to Secure WebSockets + * + * ```TypeScript + * import { noise } from '@chainsafe/libp2p-noise' + * import { yamux } from '@chainsafe/libp2p-yamux' + * import { autoTLS } from '@libp2p/auto-tls' + * import { identify } from '@libp2p/identify' + * import { keychain } from '@libp2p/keychain' + * import { webSockets } from '@libp2p/websockets' + * import { uPnPNAT } from '@libp2p/upnp-nat' + * import { createLibp2p } from 'libp2p' + * + * const node = await createLibp2p({ + * addresses: { + * listen: [ + * '/ip4/0.0.0.0/tcp/0/ws' + * ] + * }, + * transports: [ + * webSockets() + * ], + * connectionEncrypters: [ + * noise() + * ], + * streamMuxers: [ + * yamux() + * ], + * services: { + * autoTLS: autoTLS(), + * identify: identify(), + * keychain: keychain(), + * upnp: uPnPNAT() + * } + * }) + * + * // ...time passes + * + * console.info(node.getMultiaddrs()) + * // includes public WSS address: + * // [ '/ip4/123.123.123.123/tcp/12345/wss ] + * ``` + */ + +import { AutoTLS as AutoTLSClass } from './auto-tls.js' +import type { PeerId, PrivateKey, ComponentLogger, Libp2pEvents, TypedEventTarget, TLSCertificate } from '@libp2p/interface' +import type { AddressManager } from '@libp2p/interface-internal' +import type { Keychain } from '@libp2p/keychain' +import type { Datastore } from 'interface-datastore' + +export interface AutoTLSComponents { + privateKey: PrivateKey + peerId: PeerId + logger: ComponentLogger + addressManager: AddressManager + events: TypedEventTarget + keychain: Keychain + datastore: Datastore +} + +export interface AutoTLSInit { + /** + * Where to send requests to answer an ACME DNS challenge on our behalf - note + * that `/v1/_acme-challenge` will be added to the end of the URL + * + * @default 'https://registration.libp2p.direct' + */ + forgeEndpoint?: string + + /** + * The top level domain under which we will request certificate for + * + * @default 'libp2p.direct' + */ + forgeDomain?: string + + /** + * Which ACME service to use - examples are: + * + * - https://api.buypass.com/acme/directory + * - https://dv.acme-v02.api.pki.goog/directory + * - https://acme-v02.api.letsencrypt.org/directory + * - https://acme.zerossl.com/v2/DV90 + * + * @default 'https://acme-v02.api.letsencrypt.org/directory' + */ + acmeDirectory?: string + + /** + * How long to attempt to acquire a certificate before timing out in ms + * + * @default 10000 + */ + provisionTimeout?: number + + /** + * Certificates are acquired when the `self:peer:update` event fires, which + * happens when the node's addresses change. To avoid starting to map ports + * while multiple addresses are being added, the mapping function is debounced + * by this number of ms + * + * @default 5000 + */ + provisionDelay?: number + + /** + * How long before the expiry of the certificate to renew it in ms, defaults + * to one day + * + * @default 86_400_000 + */ + renewThreshold?: number + + /** + * The key the certificate is stored in the datastore under + * + * @default '/libp2p/auto-tls/certificate' + */ + certificateDatastoreKey?: string + + /** + * The name the ACME account RSA private key is stored in the keychain with + * + * @default 'auto-tls-acme-account-private-key' + */ + accountPrivateKeyName?: string + + /** + * How many bits the RSA private key for the account should be + * + * @default 2048 + */ + accountPrivateKeyBits?: number + + /** + * The name the certificate RSA private key is stored in the keychain with + * + * @default 'auto-tls-certificate-private-key' + */ + certificatePrivateKeyName?: string + + /** + * How many bits the RSA private key for the certificate should be + * + * @default 2048 + */ + certificatePrivateKeyBits?: number +} + +export interface AutoTLS { + certificate?: TLSCertificate +} + +export function autoTLS (init: AutoTLSInit = {}): (components: AutoTLSComponents) => AutoTLS { + return (components: AutoTLSComponents) => new AutoTLSClass(components, init) +} diff --git a/packages/auto-tls/src/utils.ts b/packages/auto-tls/src/utils.ts new file mode 100644 index 0000000000..0bb984941c --- /dev/null +++ b/packages/auto-tls/src/utils.ts @@ -0,0 +1,150 @@ +import { Buffer } from 'node:buffer' +import { createPrivateKey, createPublicKey } from 'node:crypto' +import { isIPv4, isIPv6 } from '@chainsafe/is-ip' +import { generateKeyPair, privateKeyFromRaw } from '@libp2p/crypto/keys' +import { isLoopback } from '@libp2p/utils/multiaddr/is-loopback' +import { isPrivate } from '@libp2p/utils/multiaddr/is-private' +import { IP, QUICV1, TCP, WebSockets, WebSocketsSecure, WebTransport } from '@multiformats/multiaddr-matcher' +import { KeyUsageFlags, KeyUsagesExtension, PemConverter, Pkcs10CertificateRequestGenerator, SubjectAlternativeNameExtension, cryptoProvider } from '@peculiar/x509' +import { IncorrectKeyType } from './errors.js' +import type { RSAPrivateKey } from '@libp2p/interface' +import type { Keychain } from '@libp2p/keychain' +import type { Multiaddr } from '@multiformats/multiaddr' + +/** + * Loads a key and returns it in PCKS#1 DER in PEM format + */ +export async function loadOrCreateKey (keychain: Keychain, name: string, size: number): Promise { + let key: RSAPrivateKey + + try { + const storedKey = await keychain.exportKey(name) + + if (storedKey.type !== 'RSA') { + throw new IncorrectKeyType(`Key type must be RSA, got "${storedKey.type}"`) + } + + key = storedKey + } catch (err: any) { + if (err.name !== 'NotFoundError') { + throw err + } + + key = await generateKeyPair('RSA', size) + await keychain.importKey(name, key) + } + + return formatAsPem(key) +} + +export function toBuffer (uint8Array: Uint8Array): Buffer { + return Buffer.from(uint8Array.buffer, uint8Array.byteOffset, uint8Array.byteLength) +} + +export function formatAsPem (key: RSAPrivateKey): string { + const obj = createPrivateKey({ + format: 'der', + key: toBuffer(key.raw), + type: 'pkcs1' + }) + + return obj.export({ format: 'pem', type: 'pkcs8' }).toString() +} + +export function importFromPem (pem: string): RSAPrivateKey { + const obj = createPrivateKey({ + format: 'pem', + key: pem + }) + const der = obj.export({ + format: 'der', + type: 'pkcs1' + }) + + const key = privateKeyFromRaw(der) + + if (key.type !== 'RSA') { + throw new IncorrectKeyType(`Got incorrect key type - ${key.type}`) + } + + return key +} + +export function supportedAddressesFilter (ma: Multiaddr): boolean { + // only routable addresses + if (isPrivate(ma) || isLoopback(ma)) { + return false + } + + // only these transports over IPvX + return IP.matches(ma) && ( + TCP.exactMatch(ma) || + WebSockets.exactMatch(ma) || + WebSocketsSecure.exactMatch(ma) || + QUICV1.exactMatch(ma) || + WebTransport.exactMatch(ma) + ) +} + +export function getPublicIps (addrs: Multiaddr[]): Set { + const output = new Set() + + addrs.filter(supportedAddressesFilter) + .forEach(ma => { + const options = ma.toOptions() + + if (isIPv4(options.host) || isIPv6(options.host)) { + output.add(options.host) + } + }) + + return output +} + +export async function createCsr (domain: string, keyPem: string): Promise { + const signingAlgorithm = { + name: 'RSASSA-PKCS1-v1_5', + hash: { name: 'SHA-256' } + } + + // have to use the same crypto provider as Pkcs10CertificateRequestGenerator + const crypto = cryptoProvider.get() + + const jwk = createPublicKey({ + format: 'pem', + key: keyPem + }).export({ + format: 'jwk' + }) + + /* Decode PEM and import into CryptoKeyPair */ + const privateKeyDec = PemConverter.decodeFirst(keyPem.toString()) + const privateKey = await crypto.subtle.importKey('pkcs8', privateKeyDec, signingAlgorithm, true, ['sign']) + const publicKey = await crypto.subtle.importKey('jwk', jwk, signingAlgorithm, true, ['verify']) + + const extensions = [ + /* https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.3 */ + new KeyUsagesExtension(KeyUsageFlags.digitalSignature | KeyUsageFlags.keyEncipherment), // eslint-disable-line no-bitwise + + /* https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.6 */ + new SubjectAlternativeNameExtension([{ type: 'dns', value: domain }]) + ] + + /* Create CSR */ + const csr = await Pkcs10CertificateRequestGenerator.create({ + keys: { + privateKey, + publicKey + }, + extensions, + signingAlgorithm, + name: [{ + // @ts-expect-error herp + CN: [{ + utf8String: domain + }] + }] + }, crypto) + + return csr.toString('pem') +} diff --git a/packages/auto-tls/test/domain-mapper.spec.ts b/packages/auto-tls/test/domain-mapper.spec.ts new file mode 100644 index 0000000000..0e8c246046 --- /dev/null +++ b/packages/auto-tls/test/domain-mapper.spec.ts @@ -0,0 +1,138 @@ +import { TypedEventEmitter, start, stop } from '@libp2p/interface' +import { defaultLogger } from '@libp2p/logger' +import { multiaddr } from '@multiformats/multiaddr' +import { expect } from 'aegir/chai' +import { stubInterface } from 'sinon-ts' +import { DomainMapper } from '../src/domain-mapper.js' +import { importFromPem } from '../src/utils.js' +import { CERT, PRIVATE_KEY_PEM } from './fixtures/cert.js' +import type { ComponentLogger, Libp2pEvents, TypedEventTarget, Peer } from '@libp2p/interface' +import type { AddressManager } from '@libp2p/interface-internal' +import type { StubbedInstance } from 'sinon-ts' + +export interface StubbedDomainMapperComponents { + logger: ComponentLogger + events: TypedEventTarget + addressManager: StubbedInstance +} + +describe('domain-mapper', () => { + let components: StubbedDomainMapperComponents + let mapper: DomainMapper + + beforeEach(async () => { + components = { + logger: defaultLogger(), + events: new TypedEventEmitter(), + addressManager: stubInterface() + } + + mapper = new DomainMapper(components, { + domain: 'example.com' + }) + + await start(mapper) + }) + + afterEach(async () => { + await stop(mapper) + }) + + it('should map domains on self peer update', () => { + const ip4 = '81.12.12.9' + const ip6 = '2001:4860:4860::8889' + + components.addressManager.getAddresses.returns([ + multiaddr('/ip4/127.0.0.1/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/ip4/192.168.1.234/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/dns4/example.com/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr(`/ip4/${ip4}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`), + multiaddr(`/ip6/${ip6}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`) + ]) + + components.events.safeDispatchEvent('certificate:provision', { + detail: { + key: importFromPem(PRIVATE_KEY_PEM), + cert: CERT + } + }) + + expect(components.addressManager.addDNSMapping.calledWith('81-12-12-9.example.com', [ + ip4 + ])).to.be.true() + expect(components.addressManager.addDNSMapping.calledWith('2001-4860-4860--8889.example.com', [ + ip6 + ])).to.be.true() + }) + + it('should update domain mapping on self peer update', () => { + const ip4v1 = '81.12.12.9' + const ip6v1 = '2001:4860:4860::8889' + + components.addressManager.getAddresses.returns([ + multiaddr('/ip4/127.0.0.1/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/ip4/192.168.1.234/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/dns4/example.com/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr(`/ip4/${ip4v1}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`), + multiaddr(`/ip6/${ip6v1}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`) + ]) + + components.events.safeDispatchEvent('certificate:provision', { + detail: { + key: importFromPem(PRIVATE_KEY_PEM), + cert: CERT + } + }) + + expect(components.addressManager.addDNSMapping.calledWith('81-12-12-9.example.com', [ + ip4v1 + ])).to.be.true() + expect(components.addressManager.addDNSMapping.calledWith('2001-4860-4860--8889.example.com', [ + ip6v1 + ])).to.be.true() + + const ip4v2 = '81.12.12.10' + const ip6v2 = '2001:4860:4860::8890' + + components.addressManager.getAddresses.returns([ + multiaddr('/ip4/127.0.0.1/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/ip4/192.168.1.234/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/dns4/example.com/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr(`/ip4/${ip4v2}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`), + multiaddr(`/ip6/${ip6v2}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`) + ]) + + components.events.safeDispatchEvent('self:peer:update', { + detail: stubInterface() + }) + + expect(components.addressManager.removeDNSMapping.calledWith('81-12-12-9.example.com')).to.be.true() + expect(components.addressManager.removeDNSMapping.calledWith('2001-4860-4860--8889.example.com')).to.be.true() + + expect(components.addressManager.addDNSMapping.calledWith('81-12-12-10.example.com', [ + ip4v2 + ])).to.be.true() + expect(components.addressManager.addDNSMapping.calledWith('2001-4860-4860--8890.example.com', [ + ip6v2 + ])).to.be.true() + }) + + it('should not map domains when no certificate is available', () => { + const ip4 = '81.12.12.9' + const ip6 = '2001:4860:4860::8889' + + components.addressManager.getAddresses.returns([ + multiaddr('/ip4/127.0.0.1/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/ip4/192.168.1.234/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/dns4/example.com/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr(`/ip4/${ip4}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`), + multiaddr(`/ip6/${ip6}/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN`) + ]) + + components.events.safeDispatchEvent('self:peer:update', { + detail: stubInterface() + }) + + expect(components.addressManager.addDNSMapping.called).to.be.false() + }) +}) diff --git a/packages/auto-tls/test/fixtures/ca.ts b/packages/auto-tls/test/fixtures/ca.ts new file mode 100644 index 0000000000..e377a687ce --- /dev/null +++ b/packages/auto-tls/test/fixtures/ca.ts @@ -0,0 +1,80 @@ +/** + * A CA private key - generated with: + * + * ``` + * openssl req -new -newkey rsa:2048 -nodes -out ca_csr.csr -keyout ca_private.key -sha256 + * ``` + */ +export const CA_PRIVATE_KEY = `-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQJ6XkhBlL7tky +cfuOqZVdvoSXBCw88/qzklufwj4nd3mn2DAFmYoM7ZJcwLzhf+clqspznn4bFMju +eCwQKoc7zq84RoE2Ln0kOHhB6RiLQjp+YsuxSoqLjogVfbg4YKZUsGMdBU9qLQ7r +RlkHhVBH6KVAmoBDFUrPBF6OFlGaai1A9utScd4W+GYEZth1y5hbmLWvmc3XPvFa +RnY7Vj5jUQBt42ilQ22LusoGYcVZbEviiOeSwapnaRPr0lrn/CSkvxb2Ws2W6aLk +HRMk8ymBWZGKiX34eaZ+ktNqDTQkNuoZ5anc0+Z6Q6v7X+0w6NWQ7xCWAtNuXElB +js1JE/uzAgMBAAECggEAShvjl1FkxEEceTZVrrw33rFm+XFV4rmmp2pTTrTUdi62 +VIjGyCebG/E1a+p/FPX5sNJ20+U41qF2zFhir7rEfQmgHrQTatvwWAX24th/kY0Z +0EeSZ+O3Ieq0Dpq9DO10KrDGCN4MISw7pI5eQiw3ofJ1a2PWiIu7H6tZktLlaMkB +qABOHpJBrrB0OnSDoHXMJD5OEQcOpcJ79Y1ESljDCTcWhimPQzgB2Tq9c8Sj5ysB +JfOWYE5U0Ad5ig/VWF9VFbYbj2CIK89QVg4JDlwYTxYXvcpOyHHdAauv86c8q6V2 +QAHz7Rq9YlWKyUnb5qmrjST6IL3Xc+FhpKw0rzjPKQKBgQD7t6QC6WR+Z7wn3kGp +oveaT4M5is/rfPMsqoGtyr8pM+BDtXjmNP92Kn6j7P8zbNE4WsCj/m4JOz7biDf1 +WT3XirWRxiKDnpdw20OS6xPDVJprbm9DvDbo/ZfV95KyW1ggUTQYfdnb1Gom9Fhz +8w9/nQj6IfU0QP+mDa97S4cKTwKBgQDTskUuWwbEHna4453K6qSLbTXhcNIBuPUV +u7mo1byUVdQe5DEXLsi7lQOuezqG/6dIwQjwGQf9e8WHHYM1k5t46/cjz2qke1ly +MT4vl2/J7/tMB2M3FArx3Ydz0N1x9wPqzaO7wOx5sMGZqrfZySu9sOwkGuYAUpnr +Rj2NIjCzXQKBgAovmDd18lcbI4YJfGa87YAVD55Ye6lv2PdJvw2lUq78JmsXANlv +85Z4ib9ga8NM9/pr0bfRJ+q/tv9zN7B5+AKs3kQT3HmvBTnP5aAgWyBgYA9Q3LfE ++gPbnzVNW2ZUQ/Cq2IzVKue2ZMVGxf2LLGlhlWdp0F5Y8v9pNlyq5cAJAoGAUm5V +L+Kz9MPj+MRw2eWaIsxosZsLuy35CPhrJ8nqP1xYV5sFXoCSGzDAGT3UoWKFEfhQ +caVdjh+W37DnOYJ7hI9lUWVfoiKBxsxT6ZYvKlOu54Ds6jJ8vIdFShynTcwgk1p1 +ihNqQUxJZnuqUTxbMubkXH641qFTW+Ci8QTCL+UCgYEA5qMM+0Q5sFd/GFGOkc3g +SRC/AIx1GWWJXT8e54KpwUV/cUUPsSrMgJTRNYXKogdZEHgMs3o6GSFd7xOo2bGN +y/+APOMDRrX+lab+eZhTMQBmLvrPR6l9NRR3Q9z73PjcUMidSf6Us+XC7pJKU7SP +h3CFtzqbiSslFpqTZTgLbF8= +-----END PRIVATE KEY-----` + +/** + * A CA CSR for ca.example.com. See `CA_PRIVATE_KEY` for generation instructions + */ +export const CA_CSR = `-----BEGIN CERTIFICATE REQUEST----- +MIICXjCCAUYCAQAwGTEXMBUGA1UEAwwOY2EuZXhhbXBsZS5jb20wggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQJ6XkhBlL7tkycfuOqZVdvoSXBCw88/qz +klufwj4nd3mn2DAFmYoM7ZJcwLzhf+clqspznn4bFMjueCwQKoc7zq84RoE2Ln0k +OHhB6RiLQjp+YsuxSoqLjogVfbg4YKZUsGMdBU9qLQ7rRlkHhVBH6KVAmoBDFUrP +BF6OFlGaai1A9utScd4W+GYEZth1y5hbmLWvmc3XPvFaRnY7Vj5jUQBt42ilQ22L +usoGYcVZbEviiOeSwapnaRPr0lrn/CSkvxb2Ws2W6aLkHRMk8ymBWZGKiX34eaZ+ +ktNqDTQkNuoZ5anc0+Z6Q6v7X+0w6NWQ7xCWAtNuXElBjs1JE/uzAgMBAAGgADAN +BgkqhkiG9w0BAQsFAAOCAQEAweN+f75FolYtglWCPoFxYdhcBt8r3Pp8uJ5GGp6i +1ml7q9Eri921tnUuNyElaHrC/OBtyTYlxNlQA2LSa9AEXpznpBhESizgxyiEDBfY +jeKdsCU9jmwfj13NefydaDbPou/mNIvV1Keb4C0ivrrmv0LeVsI3BmGNt/bVTm/u +wdtAMsj9lCwTWVOoNX0FkpCr7QQvDs1Q1kKZgFud20YtQuN05j/13CbqK7aT/iuJ +Zmxxyl9n5Lr4Yhr6P+RkfLpgLVxGUB3Ydw7m7pgNVnzo4a8Ob8EpWNLXILaaZ69d +o6+0NNM8QX1ptyp90AnSEkvRgx/B3Ov+yW7wARg4d2z7fQ== +-----END CERTIFICATE REQUEST-----` + +/** + * CA certificate used to sign other CSRs - expires in 2124. Generated with: + * + * ``` + * openssl x509 -signkey ca_private.key -days 36525 -req -in ca_csr.csr -out ca.cert -sha256 + * ``` + */ +export const CA_CERT = `-----BEGIN CERTIFICATE----- +MIIC4zCCAcugAwIBAgIUUeSW3UVzLNxMqBN+fjifrmLAOUEwDQYJKoZIhvcNAQEL +BQAwGTEXMBUGA1UEAwwOY2EuZXhhbXBsZS5jb20wIBcNMjQxMTEzMTIyNTQ1WhgP +MjEyNDExMTQxMjI1NDVaMBkxFzAVBgNVBAMMDmNhLmV4YW1wbGUuY29tMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Cel5IQZS+7ZMnH7jqmVXb6ElwQs +PPP6s5Jbn8I+J3d5p9gwBZmKDO2SXMC84X/nJarKc55+GxTI7ngsECqHO86vOEaB +Ni59JDh4QekYi0I6fmLLsUqKi46IFX24OGCmVLBjHQVPai0O60ZZB4VQR+ilQJqA +QxVKzwRejhZRmmotQPbrUnHeFvhmBGbYdcuYW5i1r5nN1z7xWkZ2O1Y+Y1EAbeNo +pUNti7rKBmHFWWxL4ojnksGqZ2kT69Ja5/wkpL8W9lrNlumi5B0TJPMpgVmRiol9 ++HmmfpLTag00JDbqGeWp3NPmekOr+1/tMOjVkO8QlgLTblxJQY7NSRP7swIDAQAB +oyEwHzAdBgNVHQ4EFgQUfxYUCjJS1VhR+vk07OgYvbpCwOUwDQYJKoZIhvcNAQEL +BQADggEBAI6h1eUfFH4+Bhz6nLLuAHJ2HD0MJXULPYIkfrra32op5f7ZW8kl0/qZ +G2cexnY4qjHR9qRqIzV1K292Go2N0n9uOiUlWEpyAZeST7KdHSwyYsAF94XI02Zo +lM4pkmDFF/zoRPYYZPZpT20RnNYKDuc8i6KWWbZUHvqr8zXsZCnb9QK4Am8OwubV +J9wSNLoK47HZv0ycqkdh+wcX3xWfInFywg8dOpA97MEq7aULEezciXCr5+v/Kwb+ +ocuR7yhdZTa5ak8oEPRY+2Vl5mY5yp1qopZqY7wMd6eZn0JCLa4a5Z8Fj5Mjh6Kd +Qwsr4ULX6LlyP2R/2IaU9Iq9SSoiMF0= +-----END CERTIFICATE-----` diff --git a/packages/auto-tls/test/fixtures/cert.ts b/packages/auto-tls/test/fixtures/cert.ts new file mode 100644 index 0000000000..69d8e80e4c --- /dev/null +++ b/packages/auto-tls/test/fixtures/cert.ts @@ -0,0 +1,155 @@ +/** + * A 2048 bit RSA private key - generated with: + * + * ``` + * openssl genrsa -out user_private.key 2048 + * ``` + */ +export const PRIVATE_KEY_PEM = `-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC8AafaHa4q5LcG +JAnCTKwAN5ag9nL+9dQTZSrdZHxDxYMsSa3ZCJ14bbst2A9N0JbfjuNURT1Ev4dP +be9P/N6SF8TeIyOuJCqj9HR4w3bU4O3jN5mrCSev05mkRRxiUFIrotmg8U/r1zw9 +JdwTAopdykp6Nfx+ILVywAseIXr6sibD0zrDzn8zPW+/vlDDYPyxFRTNR7yeNz40 +VFUNyMDhzt0brjSrlctk7/12cNXJ2B4Na5dam8nPoVFK/MB8F5ZI4hDQf50cARs6 +gwC9wAmJJ98dqLvXtzsPhe51fQLO/F/sPRpCa9Tgtu0+5QERo4gwR7js7lqpH9dq +RL+7EGr9AgMBAAECggEAIQn1cmo22kjZNRYONPv+WgdqzByjNtUCkOn9b2yiPdKu +65CDIZnW+nvmIfdPMTCP4vecUYnda4BxCe9a1+arQmc07IimU4r9h1SFR1eqQVzJ +0V1K/vib5dU8sdaHV2ugFRUIQ7VEg0CO0HwfwaN3p2XOUs278npTCLhg+8mMcBOj +Winb9mR7/Ksf5Uoe44gRCjVStIHkxgSCdDsADD9Ggv75sYWeZ+eN/rmMckLOT27M +wFbW2AxbWFDk3hj1+2sD02b/M0PV/CPpknNgwkrETL3/FnSmBZ/O9K7CIHfYGH5b +jlnRISzCQGXCMlAbDRQI7oUprAxJigQVnYv+4qHBjQKBgQDrV9zhmXB2k9CjB9tB +mMpVqDVj5qeVyIdn0SBzax1qm4mxCCwgW6JJwllDPYEZrrlXYQjaZ7mWtjJVwjuu +bKeA4dbvFTketWSImw9Y/ovvzopZLw7DxKaUDDO6AiiOZDFvSwYqNDDTUUSX0ijS +BSLmVpPyMfmoxbjRn6lQY0tRnwKBgQDMgiQinMPUXH51Wl+Tm8v2+5LItfo2nlrk +zArGjmPhGsgJDlgi/k7/xdpAmE+uL5b7Jo9YewxEu8Jmc3xcq9s9SuJw7JOHzcYq +8X8ZGEgdYqFZpM9wY31hAYyaI3zO7A+OhZOvPSgDjrDNrTvriczDUD38XJ7+KweK +DmlHaEsV4wKBgCPZU3UuCVqWs55R8Q0x+AhKQi/Aj+CaFj4zNe0+8NEvdi74Xrhj +HPp9V1mNwd+mpObxigay7CtP/6TenHa6aF2SiUoMApJx8Sl57UGSLMDPxnVFXMtn +ZjSBE1QPRhxCmOEqHXtKTfGynG8//SXY0HMj1w96m1whGkEcQA9VwMBjAoGAVfRI +7cdHw4TQndBLJYYw1vDrw7JApR4vg8SCrut/7UfNVYkS4DpUx8nHrqiVrNdRtOOD +EiQ9htIHpfnaBjUxI3TK8b1tUIHbTYdM7SY4gSlIOZ48lbcrJk95YfuSZIHxE+zu +opOosr4Rb5DlA11ak6ixNNVU+ezp8UuXUizyihMCgYBOU6fmRBszYDetKpEUenpg +4KySxO6rcstADlLKHAMHRuPKHPYgMozZR3KlRwCCrK/HRgAzSrOonUWfJdp0nrDM +hAH/0gxzn58p3tormv94llkBJ6Voj5QvSdOeESKzYdz5gyK29dy08503w8CEI2eO +a/xhT7PUGisjcZwNIZuLhA== +-----END PRIVATE KEY-----` + +/** + * A CSR created by `PRIVATE_KEY_PEM` with the common name "example.com" + * + * Generated with: + * + * ``` + * openssl req -new -key user_private.key -out user.csr + * ``` + */ +export const CSR = `-----BEGIN CERTIFICATE REQUEST----- +MIICWzCCAUMCAQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC8AafaHa4q5LcGJAnCTKwAN5ag9nL+9dQTZSrd +ZHxDxYMsSa3ZCJ14bbst2A9N0JbfjuNURT1Ev4dPbe9P/N6SF8TeIyOuJCqj9HR4 +w3bU4O3jN5mrCSev05mkRRxiUFIrotmg8U/r1zw9JdwTAopdykp6Nfx+ILVywAse +IXr6sibD0zrDzn8zPW+/vlDDYPyxFRTNR7yeNz40VFUNyMDhzt0brjSrlctk7/12 +cNXJ2B4Na5dam8nPoVFK/MB8F5ZI4hDQf50cARs6gwC9wAmJJ98dqLvXtzsPhe51 +fQLO/F/sPRpCa9Tgtu0+5QERo4gwR7js7lqpH9dqRL+7EGr9AgMBAAGgADANBgkq +hkiG9w0BAQsFAAOCAQEAe3OgoSpAQ2gxC7Y9OZ0hOgTrqWSBbOWWBiY3aLfOkq3a +E/tLp6ORv7Uod5P1O6BKPkWsdbJPhSkHJT3Q/GnVxMMPXBBDQmfZ+Y1lDnQusLQy +rjYc2xAsMrhsUajwmcUJOgFu5S+2hWNBuIIf/esa+/8SpK/EGnr7xsfF4f3tM1Sv +A0jW/iVUAJPlacbQbohqtAOMDonL9UhNQmjODNGkaELPcXKIRbhXabHuB843WkKp +m0bRszzyrF14clG4zTmWEYFQA5OaA8uvuI3HfLZQr5D0k7rtLMMEOZ2M5TbkPHaj +QwevAKYJB94ZYbpOFDMoi4fbZY3BB3Zrv1uE6fe9mA== +-----END CERTIFICATE REQUEST-----` + +/** + * A certificate generated from `CSR` and signed using the CA in `ca.ts`. + * Expires in 2124 + * + * Generated with: + * + * ``` + * openssl x509 -req -days 36524 -in user.csr -CA ca.cert -CAkey ca_private.key -out user.cert -set_serial 01 -sha256 + * ``` + */ +export const CERT = `-----BEGIN CERTIFICATE----- +MIIC7jCCAdagAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5jYS5l +eGFtcGxlLmNvbTAgFw0yNDExMTMxMjI3MzBaGA8yMTI0MTExMzEyMjczMFowFjEU +MBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQC8AafaHa4q5LcGJAnCTKwAN5ag9nL+9dQTZSrdZHxDxYMsSa3ZCJ14bbst +2A9N0JbfjuNURT1Ev4dPbe9P/N6SF8TeIyOuJCqj9HR4w3bU4O3jN5mrCSev05mk +RRxiUFIrotmg8U/r1zw9JdwTAopdykp6Nfx+ILVywAseIXr6sibD0zrDzn8zPW+/ +vlDDYPyxFRTNR7yeNz40VFUNyMDhzt0brjSrlctk7/12cNXJ2B4Na5dam8nPoVFK +/MB8F5ZI4hDQf50cARs6gwC9wAmJJ98dqLvXtzsPhe51fQLO/F/sPRpCa9Tgtu0+ +5QERo4gwR7js7lqpH9dqRL+7EGr9AgMBAAGjQjBAMB0GA1UdDgQWBBSCbM4qVww9 +as2QQGB3xQywcmt5pDAfBgNVHSMEGDAWgBR/FhQKMlLVWFH6+TTs6Bi9ukLA5TAN +BgkqhkiG9w0BAQsFAAOCAQEAYgVxsBf76IiFe0/zvsOaLUpvodrJynfv6WdFnItP +3AZDb6hfDt+KXz5DYJ+FgELYTlz3hN5U2vYLrIk0BJ7o2PnMc7JEmOBstLoXkRtr +w2F2PlGwTAum8tZyDYKSe3MesbjXCIIia4xqnwCR0z0JXTb0yhq3YkLbZ/amrSdE +QnflMOUwfKIYPOc7sfZJoT48MbS3BPAsFEjzb6cbNdz6zrj6GVUT85lKL/Y2MtKA +MuZ/t6e+U15YkxryhmjStpclKop5gYo7/xK8s61CxjZnNA4m/VJBDlDByjFpH6OC +ZNCQUjc/WZv9Ncx9gJ4ZtSJZTZd9vei7Er4oeip7I1a0Vg== +-----END CERTIFICATE-----` + +/** + * Similar to CERT but this certificate has expired + */ +export const EXPIRED_CERT = `-----BEGIN CERTIFICATE----- +MIIC4zCCAcugAwIBAgIUUeSW3UVzLNxMqBN+fjifrmLAOUEwDQYJKoZIhvcNAQEL +BQAwGTEXMBUGA1UEAwwOY2EuZXhhbXBsZS5jb20wIBcNMjQxMTEzMTIyNTQ1WhgP +MjEyNDExMTQxMjI1NDVaMBkxFzAVBgNVBAMMDmNhLmV4YW1wbGUuY29tMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Cel5IQZS+7ZMnH7jqmVXb6ElwQs +PPP6s5Jbn8I+J3d5p9gwBZmKDO2SXMC84X/nJarKc55+GxTI7ngsECqHO86vOEaB +Ni59JDh4QekYi0I6fmLLsUqKi46IFX24OGCmVLBjHQVPai0O60ZZB4VQR+ilQJqA +QxVKzwRejhZRmmotQPbrUnHeFvhmBGbYdcuYW5i1r5nN1z7xWkZ2O1Y+Y1EAbeNo +pUNti7rKBmHFWWxL4ojnksGqZ2kT69Ja5/wkpL8W9lrNlumi5B0TJPMpgVmRiol9 ++HmmfpLTag00JDbqGeWp3NPmekOr+1/tMOjVkO8QlgLTblxJQY7NSRP7swIDAQAB +oyEwHzAdBgNVHQ4EFgQUfxYUCjJS1VhR+vk07OgYvbpCwOUwDQYJKoZIhvcNAQEL +BQADggEBAI6h1eUfFH4+Bhz6nLLuAHJ2HD0MJXULPYIkfrra32op5f7ZW8kl0/qZ +G2cexnY4qjHR9qRqIzV1K292Go2N0n9uOiUlWEpyAZeST7KdHSwyYsAF94XI02Zo +lM4pkmDFF/zoRPYYZPZpT20RnNYKDuc8i6KWWbZUHvqr8zXsZCnb9QK4Am8OwubV +J9wSNLoK47HZv0ycqkdh+wcX3xWfInFywg8dOpA97MEq7aULEezciXCr5+v/Kwb+ +ocuR7yhdZTa5ak8oEPRY+2Vl5mY5yp1qopZqY7wMd6eZn0JCLa4a5Z8Fj5Mjh6Kd +Qwsr4ULX6LlyP2R/2IaU9Iq9SSoiMF0= +-----END CERTIFICATE-----` + +/** + * Similar to CERT but this certificate has garbage data + */ +export const INVALID_CERT = `-----BEGIN CERTIFICATE----- +MIIC7jCCAdagAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5jYS5A +eGFtcGxlLmNvbTAgFw0yNDExMTMxMjI3MzBaGA8yMTI0MTExMzEyMjczMFowFjEA +MBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEA +AoIBAQC8AafaHa4q5LcGJAnCTKwAN5ag9nL+9dQTZSrdZHxDxYMsSa3ZCJ14bbsA +2A9N0JbfjuNURT1Ev4dPbe9P/N6SF8TeIyOuJCqj9HR4w3bU4O3jN5mrCSev05mA +RRxiUFIrotmg8U/r1zw9JdwTAopdykp6Nfx+ILVywAseIXr6sibD0zrDzn8zPW+A +vlDDYPyxFRTNR7yeNz40VFiaminvalidrjSrlctk7/12cNXJ2B4Na5dam8nPoVFA +/MB8F5ZI4hDQf50cARs6gwC9wAmJJ98dqLvXtzsPhe51fQLO/F/sPRpCa9Tgtu0A +5QERo4gwR7js7lqpH9dqRL+7EGr9AgMBAAGjQjBAMB0GA1UdDgQWBBSCbM4qVwwA +as2QQGB3xQywcmt5pDAfBgNVHSMEGDAWgBR/FhQKMlLVWFH6+TTs6Bi9ukLA5TAA +BgkqhkiG9w0BAQsFAAOCAQEAYgVxsBf76IiFe0/zvsOaLUpvodrJynfv6WdFnItA +3AZDb6hfDt+KXz5DYJ+FgELYTlz3hN5U2vYLrIk0BJ7o2PnMc7JEmOBstLoXkRtA +w2F2PlGwTAum8tZyDYKSe3MesbjXCIIia4xqnwCR0z0JXTb0yhq3YkLbZ/amrSdA +QnflMOUwfKIYPOc7sfZJoT48MbS3BPAsFEjzb6cbNdz6zrj6GVUT85lKL/Y2MtKA +MuZ/t6e+U15YkxryhmjStpclKop5gYo7/xK8s61CxjZnNA4m/VJBDlDByjFpH6OA +ZNCQUjc/WZv9Ncx9gJ4ZtSJZTZd9vei7Er4oeip7I1a0Vg== +-----END CERTIFICATE-----` + +/** + * Similar to CERT but this certificate was requested by a different private key + */ +export const CERT_FOR_OTHER_KEY = `-----BEGIN CERTIFICATE----- +MIIC7jCCAdagAwIBAgIBATANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDDA5jYS5l +eGFtcGxlLmNvbTAgFw0yNDExMTMxMjU4NDRaGA8yMTI0MTExMzEyNTg0NFowFjEU +MBIGA1UEAwwLZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCXERLHKjn5qGFdltfQSgM7K6+sgTSKjlzIH+EuiD0IbxWj0xMEJhNpXHsh +MgnmMUNcd8b4WyWCukqXRdRj2D7bMlr5D6YqLU71e5/OIS220Wzin4gkb+hXaKYZ +AyOsGVOdlaLeWKDhL1WH9Uy9DWjyC7+OdxBUoRTc5tX658bUGOkKrz3fO/5UBcvS +v+SGoORVC4EyT1BhrKHGEc61qZSYAEKjyROYqKcCdhy4YEl61duri8Qf4Fw4FIQr +Au6IZ+4urPDF34lYkQMOoALUaP1/WFM7GL1oEl0rZMcCdymHpnZ+InmNylZbbbI4 +RObEctQglW3+0TzyNKOYi91x5h+lAgMBAAGjQjBAMB0GA1UdDgQWBBRTAMsY4/2y +3ep23M7TU3y2/It6cjAfBgNVHSMEGDAWgBR/FhQKMlLVWFH6+TTs6Bi9ukLA5TAN +BgkqhkiG9w0BAQsFAAOCAQEAyfdqlnrQ1DXzz0Dis38DNcjulVMINSzM62+8y93y +wQA+XuLyXsDv8GLKD1JsJb1L7jKFJPtgk0drGlTSuCdHJiPZNBAGspHRVxEffMZO +k/vlCOHDIwInSaDY9gKLXuib91N3MHSF4AYnNpYPZRGu4GZZ2B2WJ6JBVA0BWLjb +h0A3zxz55VhXkB75I3KIKgqTOSXQ57A5HTIt9vsX2kLsvkEFeoGfzic9AQcGOZwm +2kxJrfw5gVKG8hS2xndadU+KDqtKIbkMrJ+ooNz7xOgZUaG5at6YzikhXAVdPf5s +U6wMXeEAJ71wTeTUvwKoI3EEiJBUAfsd5BFqzVxOpMWlig== +-----END CERTIFICATE-----` diff --git a/packages/auto-tls/test/index.spec.ts b/packages/auto-tls/test/index.spec.ts new file mode 100644 index 0000000000..4c3eb57b22 --- /dev/null +++ b/packages/auto-tls/test/index.spec.ts @@ -0,0 +1,291 @@ +import { generateKeyPair } from '@libp2p/crypto/keys' +import { TypedEventEmitter, start, stop } from '@libp2p/interface' +import { defaultLogger } from '@libp2p/logger' +import { peerIdFromPrivateKey } from '@libp2p/peer-id' +import { multiaddr } from '@multiformats/multiaddr' +import { expect } from 'aegir/chai' +import { MemoryDatastore } from 'datastore-core' +import delay from 'delay' +import { Key, type Datastore } from 'interface-datastore' +import { pEvent } from 'p-event' +import Sinon from 'sinon' +import { stubInterface } from 'sinon-ts' +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { AutoTLS } from '../src/auto-tls.js' +import { DEFAULT_CERTIFICATE_DATASTORE_KEY, DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME } from '../src/constants.js' +import { importFromPem } from '../src/utils.js' +import { CERT, CERT_FOR_OTHER_KEY, EXPIRED_CERT, INVALID_CERT, PRIVATE_KEY_PEM } from './fixtures/cert.js' +import type { ComponentLogger, Libp2pEvents, Peer, PeerId, PrivateKey, RSAPrivateKey, TypedEventTarget } from '@libp2p/interface' +import type { AddressManager } from '@libp2p/interface-internal' +import type { Keychain } from '@libp2p/keychain' +import type { StubbedInstance } from 'sinon-ts' + +interface StubbedAutoTLSComponents { + privateKey: PrivateKey + peerId: PeerId + logger: ComponentLogger + addressManager: StubbedInstance + events: TypedEventTarget + keychain: StubbedInstance + datastore: Datastore +} + +describe('auto-tls', () => { + let autoTLS: AutoTLS + let components: StubbedAutoTLSComponents + let certificateKey: RSAPrivateKey + + beforeEach(async () => { + const privateKey = await generateKeyPair('Ed25519') + certificateKey = importFromPem(PRIVATE_KEY_PEM) + + components = { + privateKey, + peerId: peerIdFromPrivateKey(privateKey), + logger: defaultLogger(), + addressManager: stubInterface(), + events: new TypedEventEmitter(), + keychain: stubInterface(), + datastore: new MemoryDatastore() + } + + // mixture of LAN and public addresses + components.addressManager.getAddresses.returns([ + multiaddr(`/ip4/127.0.0.1/tcp/1235/p2p/${components.peerId}`), + multiaddr(`/ip4/192.168.0.100/tcp/1235/p2p/${components.peerId}`), + multiaddr(`/ip4/82.32.57.46/tcp/2345/p2p/${components.peerId}`) + ]) + }) + + afterEach(async () => { + await stop(autoTLS) + }) + + it('should error with an invalid forge endpoint', () => { + expect(() => { + return new AutoTLS(components, { + forgeEndpoint: 'not a valid url' + }) + }).to.throw('Invalid URL') + }) + + it('should error with an invalid acme directory', () => { + expect(() => { + return new AutoTLS(components, { + acmeDirectory: 'not a valid url' + }) + }).to.throw('Invalid URL') + }) + + it('should provision a TLS certificate', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().resolves(CERT) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', true) + }) + + it('should reuse an existing TLS certificate', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().rejects(new Error('Should not have provisioned new certificate')) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + await components.datastore.put(new Key(DEFAULT_CERTIFICATE_DATASTORE_KEY), uint8ArrayFromString(CERT)) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', false) + }) + + it('should provision a new TLS certificate when the existing one is corrupted', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().resolves(CERT) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + await components.datastore.put(new Key(DEFAULT_CERTIFICATE_DATASTORE_KEY), uint8ArrayFromString(INVALID_CERT)) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', true) + }) + + it('should provision a new TLS certificate when the existing one has expired', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().resolves(CERT) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + await components.datastore.put(new Key(DEFAULT_CERTIFICATE_DATASTORE_KEY), uint8ArrayFromString(EXPIRED_CERT)) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', true) + }) + + it('should provision a new TLS certificate when validation fails', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().resolves(CERT) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + await components.datastore.put(new Key(DEFAULT_CERTIFICATE_DATASTORE_KEY), uint8ArrayFromString(CERT_FOR_OTHER_KEY)) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', true) + }) + + it('should not provision when there are no public addresses', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + // mixture of LAN and public addresses + components.addressManager.getAddresses.returns([ + multiaddr(`/ip4/127.0.0.1/tcp/1235/p2p/${components.peerId}`), + multiaddr(`/ip4/192.168.0.100/tcp/1235/p2p/${components.peerId}`) + ]) + + let dispatched = 0 + + components.events.addEventListener('certificate:provision', () => { + dispatched++ + }) + components.events.addEventListener('certificate:renew', () => { + dispatched++ + }) + + await delay(1000) + + expect(dispatched).to.equal(0) + }) + + it('should not provision when there are no supported addresses', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + // mixture of LAN and public addresses + components.addressManager.getAddresses.returns([ + multiaddr(`/ip4/82.32.57.46/tcp/2345/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN/p2p-circuit/p2p/${components.peerId}`) + ]) + + let dispatched = 0 + + components.events.addEventListener('certificate:provision', () => { + dispatched++ + }) + components.events.addEventListener('certificate:renew', () => { + dispatched++ + }) + + await delay(1000) + + expect(dispatched).to.equal(0) + }) + + it('should remap domain names when the external IP address changes', async () => { + autoTLS = new AutoTLS(components, { + provisionDelay: 10 + }) + await start(autoTLS) + + const eventPromise = pEvent(components.events, 'certificate:provision') + + autoTLS.fetchAcmeCertificate = Sinon.stub().resolves(CERT) + + components.keychain.exportKey.withArgs(DEFAULT_CERTIFICATE_PRIVATE_KEY_NAME).resolves(certificateKey) + + await components.datastore.put(new Key(DEFAULT_CERTIFICATE_DATASTORE_KEY), uint8ArrayFromString(CERT_FOR_OTHER_KEY)) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + + const event = await eventPromise + expect(event).to.have.nested.property('detail.cert', CERT) + expect(autoTLS.fetchAcmeCertificate).to.have.property('called', true) + + // a different external address is reported + components.addressManager.getAddresses.returns([ + multiaddr(`/ip4/127.0.0.1/tcp/1235/p2p/${components.peerId}`), + multiaddr(`/ip4/192.168.0.100/tcp/1235/p2p/${components.peerId}`), + multiaddr(`/ip4/64.23.65.25/tcp/2345/p2p/${components.peerId}`) + ]) + + components.events.safeDispatchEvent('self:peer:update', { + detail: { + peer: stubInterface() + } + }) + }) +}) diff --git a/packages/auto-tls/test/utils.spec.ts b/packages/auto-tls/test/utils.spec.ts new file mode 100644 index 0000000000..17a818885f --- /dev/null +++ b/packages/auto-tls/test/utils.spec.ts @@ -0,0 +1,92 @@ +import { createPrivateKey } from 'node:crypto' +import { generateKeyPair } from '@libp2p/crypto/keys' +import { multiaddr } from '@multiformats/multiaddr' +import { expect } from 'aegir/chai' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { formatAsPem, getPublicIps, importFromPem } from '../src/utils.js' +import { PRIVATE_KEY_PEM } from './fixtures/cert.js' + +describe('utils', () => { + describe('formatAsPem', () => { + it('should transform a key to pem', async () => { + const bits = 1024 + const key = await generateKeyPair('RSA', bits) + const pem = formatAsPem(key) + + const keyObject = createPrivateKey({ + format: 'pem', + key: pem + }) + + expect(keyObject.type).to.equal('private') + expect(keyObject.asymmetricKeyType).to.equal('rsa') + expect(keyObject.asymmetricKeyDetails?.modulusLength).to.equal(bits) + + expect(key.raw).to.equalBytes(keyObject.export({ + format: 'der', + type: 'pkcs1' + })) + }) + }) + + describe('importFromPem', () => { + it('should read a key from pem', async () => { + const key = importFromPem(PRIVATE_KEY_PEM) + const digest = await crypto.subtle.digest('SHA-1', key.publicKey.raw) + const thumbprint = uint8ArrayToString(new Uint8Array(digest, 0, digest.byteLength), 'base16') + + expect(key.type).to.equal('RSA') + expect(thumbprint).to.equal('5f3a7c26f15600df20648213777783661ccdcfcf') + }) + }) + + describe('getPublicIps', () => { + it('should return supported public IPs', () => { + const addresses = [ + // tcp + '/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // insecure ws + '/tcp/1234/ws/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // secure wss + '/tcp/1234/wss/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // secure tls/ws + '/tcp/1234/tls/ws/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // secure tls/ws with sni + '/tcp/1234/tls/sni/example.com/ws/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // quic-v1 + '/udp/1234/quic-v1/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN', + + // webtransport + '/udp/1234/quic-v1/webtransport/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN' + ] + + const expected: string[] = [] + + const output = getPublicIps([ + multiaddr('/ip4/127.0.0.1/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/ip4/192.168.1.234/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + multiaddr('/dns4/example.com/tcp/1234/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN'), + + ...addresses.map((fragment, index) => { + const ip = `81.12.12.${index}` + expected.push(ip) + + return multiaddr(`/ip4/${ip}${fragment}`) + }), + ...addresses.map((fragment, index) => { + const ip = `2001:4860:4860::888${index}` + expected.push(ip) + + return multiaddr(`/ip6/${ip}${fragment}`) + }) + ]) + + expect([...output]).to.deep.equal(expected) + }) + }) +}) diff --git a/packages/auto-tls/tsconfig.json b/packages/auto-tls/tsconfig.json new file mode 100644 index 0000000000..8adc863e38 --- /dev/null +++ b/packages/auto-tls/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "aegir/src/config/tsconfig.aegir.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": [ + "src", + "test" + ], + "references": [ + { + "path": "../interface" + }, + { + "path": "../interface-internal" + }, + { + "path": "../utils" + } + ] +} diff --git a/packages/auto-tls/typedoc.json b/packages/auto-tls/typedoc.json new file mode 100644 index 0000000000..f599dc728d --- /dev/null +++ b/packages/auto-tls/typedoc.json @@ -0,0 +1,5 @@ +{ + "entryPoints": [ + "./src/index.ts" + ] +} diff --git a/packages/interface/src/index.ts b/packages/interface/src/index.ts index eb29f1d7f1..4961c77ada 100644 --- a/packages/interface/src/index.ts +++ b/packages/interface/src/index.ts @@ -53,6 +53,18 @@ export interface SignedPeerRecord { seq: bigint } +export interface TLSCertificate { + /** + * The private key that corresponds to the certificate in PEM format + */ + key: string + + /** + * The certificate chain in PEM format + */ + cert: string +} + /** * Data returned from a successful identify response */ @@ -267,6 +279,17 @@ export interface Libp2pEvents { */ 'connection:close': CustomEvent + /** + * This event notifies listeners that a TLS certificate is available for use + */ + 'certificate:provision': CustomEvent + + /** + * This event notifies listeners that a new TLS certificate is available for + * use. Any previous certificate may no longer be valid. + */ + 'certificate:renew': CustomEvent + /** * This event notifies listeners that the node has started * From b248eefc01e6034c211b0d458d0ce7a74e99c24f Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 21 Nov 2024 08:40:28 +0000 Subject: [PATCH 09/10] feat: add append announce addresses (#2834) Adds an `appendAnnounce` key to the address manager's init type - any multiaddrs specified here will be added to the list of announced addresses. --- packages/libp2p/src/address-manager.ts | 31 +++++++++++++------ .../test/addresses/address-manager.spec.ts | 27 ++++++++++++++++ 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/packages/libp2p/src/address-manager.ts b/packages/libp2p/src/address-manager.ts index 0566db59d7..37ae0c0aaa 100644 --- a/packages/libp2p/src/address-manager.ts +++ b/packages/libp2p/src/address-manager.ts @@ -13,19 +13,24 @@ export interface AddressManagerInit { announceFilter?: AddressFilter /** - * list of multiaddrs string representation to listen + * A list of string multiaddrs to listen on */ listen?: string[] /** - * list of multiaddrs string representation to announce + * A list of string multiaddrs to use instead of those reported by transports */ announce?: string[] /** - * list of multiaddrs string representation to never announce + * A list of string multiaddrs string to never announce */ noAnnounce?: string[] + + /** + * A list of string multiaddrs to add to the list of announced addresses + */ + appendAnnounce?: string[] } export interface AddressManagerComponents { @@ -80,12 +85,11 @@ export class AddressManager implements AddressManagerInterface { // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0` private readonly listen: string[] private readonly announce: Set + private readonly appendAnnounce: Set private readonly observed: Map private readonly announceFilter: AddressFilter private readonly ipDomainMappings: Map - private readonly where: Error - /** * Responsible for managing the peer addresses. * Peers can specify their listen and announce addresses. @@ -93,12 +97,13 @@ export class AddressManager implements AddressManagerInterface { * while the announce addresses will be used for the peer addresses' to other peers in the network. */ constructor (components: AddressManagerComponents, init: AddressManagerInit = {}) { - const { listen = [], announce = [] } = init + const { listen = [], announce = [], appendAnnounce = [] } = init this.components = components this.log = components.logger.forComponent('libp2p:address-manager') this.listen = listen.map(ma => ma.toString()) this.announce = new Set(announce.map(ma => ma.toString())) + this.appendAnnounce = new Set(appendAnnounce.map(ma => ma.toString())) this.observed = new Map() this.ipDomainMappings = new Map() this.announceFilter = init.announceFilter ?? defaultAddressFilter @@ -115,8 +120,6 @@ export class AddressManager implements AddressManagerInterface { components.events.addEventListener('transport:close', () => { this._updatePeerStoreAddresses() }) - - this.where = new Error('where') } readonly [Symbol.toStringTag] = '@libp2p/address-manager' @@ -159,6 +162,13 @@ export class AddressManager implements AddressManagerInterface { return Array.from(this.announce).map((a) => multiaddr(a)) } + /** + * Get peer announcing multiaddrs + */ + getAppendAnnounceAddrs (): Multiaddr[] { + return Array.from(this.appendAnnounce).map((a) => multiaddr(a)) + } + /** * Get observed multiaddrs */ @@ -218,9 +228,12 @@ export class AddressManager implements AddressManagerInterface { multiaddrs = this.components.transportManager.getAddrs() } - // add observed addresses we are confident in multiaddrs = multiaddrs .concat( + // add additional announce addresses + ...this.getAppendAnnounceAddrs(), + + // add observed addresses we are confident in Array.from(this.observed) .filter(([ma, metadata]) => metadata.confident) .map(([ma]) => multiaddr(ma)) diff --git a/packages/libp2p/test/addresses/address-manager.spec.ts b/packages/libp2p/test/addresses/address-manager.spec.ts index d2069a5864..f8a425a1c6 100644 --- a/packages/libp2p/test/addresses/address-manager.spec.ts +++ b/packages/libp2p/test/addresses/address-manager.spec.ts @@ -85,6 +85,33 @@ describe('Address Manager', () => { expect(announceMultiaddrs[0].equals(multiaddr(announceAddreses[0]))).to.equal(true) }) + it('should add appendAnnounce multiaddrs on get', () => { + const transportManager = stubInterface() + const am = new AddressManager({ + peerId, + transportManager, + peerStore, + events, + logger: defaultLogger() + }, { + announceFilter: (mas) => mas, + listen: listenAddresses, + appendAnnounce: announceAddreses + }) + + transportManager.getAddrs.returns(listenAddresses.map(ma => multiaddr(ma))) + + expect(am.getListenAddrs()).to.have.lengthOf(listenAddresses.length) + expect(am.getAppendAnnounceAddrs()).to.have.lengthOf(announceAddreses.length) + + const announceMultiaddrs = am.getAddresses() + expect(announceMultiaddrs.length).to.equal(3) + expect(announceMultiaddrs.map(ma => ma.toString())).to.deep.equal([ + ...listenAddresses.map(ma => `${ma}/p2p/${peerId}`), + ...announceAddreses.map(ma => `${ma}/p2p/${peerId}`) + ]) + }) + it('should add observed addresses', () => { const am = new AddressManager({ peerId, From 98f3c773dce0deea7abf15c77fad5d2bb83b507e Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 21 Nov 2024 16:24:17 +0000 Subject: [PATCH 10/10] fix: include DHT client in FIND_NODE response if exact match (#2835) If we receive a query for a peer id, and that peer is in the peer store, include that peer in the response whether or not it is a DHT server. This is not mentioned in the spec but is in the go implementation. --- packages/kad-dht/src/peer-routing/index.ts | 50 ++++- packages/kad-dht/test/kad-dht.spec.ts | 6 +- packages/kad-dht/test/multiple-nodes.spec.ts | 26 ++- packages/kad-dht/test/peer-routing.spec.ts | 176 ++++++++++++++++++ .../kad-dht/test/utils/sort-closest-peers.ts | 21 +++ 5 files changed, 258 insertions(+), 21 deletions(-) create mode 100644 packages/kad-dht/test/peer-routing.spec.ts diff --git a/packages/kad-dht/src/peer-routing/index.ts b/packages/kad-dht/src/peer-routing/index.ts index 5774865807..8c47152069 100644 --- a/packages/kad-dht/src/peer-routing/index.ts +++ b/packages/kad-dht/src/peer-routing/index.ts @@ -1,8 +1,11 @@ import { publicKeyFromProtobuf } from '@libp2p/crypto/keys' import { InvalidPublicKeyError, NotFoundError } from '@libp2p/interface' -import { peerIdFromPublicKey } from '@libp2p/peer-id' +import { peerIdFromPublicKey, peerIdFromMultihash } from '@libp2p/peer-id' import { Libp2pRecord } from '@libp2p/record' +import * as Digest from 'multiformats/hashes/digest' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { xor as uint8ArrayXor } from 'uint8arrays/xor' +import { xorCompare as uint8ArrayXorCompare } from 'uint8arrays/xor-compare' import { QueryError, InvalidRecordError } from '../errors.js' import { MessageType } from '../message/dht.js' import { PeerDistanceList } from '../peer-distance-list.js' @@ -12,14 +15,20 @@ import { valueEvent } from '../query/events.js' import { verifyRecord } from '../record/validators.js' -import { convertBuffer, keyForPublicKey } from '../utils.js' -import type { KadDHTComponents, DHTRecord, FinalPeerEvent, QueryEvent, Validators } from '../index.js' +import { convertBuffer, convertPeerId, keyForPublicKey } from '../utils.js' +import type { DHTRecord, FinalPeerEvent, QueryEvent, Validators } from '../index.js' import type { Message } from '../message/dht.js' import type { Network } from '../network.js' import type { QueryManager, QueryOptions } from '../query/manager.js' import type { QueryFunc } from '../query/types.js' import type { RoutingTable } from '../routing-table/index.js' -import type { Logger, PeerId, PeerInfo, PeerStore, RoutingOptions } from '@libp2p/interface' +import type { ComponentLogger, Logger, PeerId, PeerInfo, PeerStore, RoutingOptions } from '@libp2p/interface' + +export interface PeerRoutingComponents { + peerId: PeerId + peerStore: PeerStore + logger: ComponentLogger +} export interface PeerRoutingInit { routingTable: RoutingTable @@ -38,7 +47,7 @@ export class PeerRouting { private readonly peerStore: PeerStore private readonly peerId: PeerId - constructor (components: KadDHTComponents, init: PeerRoutingInit) { + constructor (components: PeerRoutingComponents, init: PeerRoutingInit) { this.routingTable = init.routingTable this.network = init.network this.validators = init.validators @@ -283,19 +292,42 @@ export class PeerRouting { } /** - * Get the nearest peers to the given query, but if closer - * than self + * Get the nearest peers to the given query, but if closer than self */ async getCloserPeersOffline (key: Uint8Array, closerThan: PeerId): Promise { - const id = await convertBuffer(key) - const ids = this.routingTable.closestPeers(id) const output: PeerInfo[] = [] + // try getting the peer directly + try { + const multihash = Digest.decode(key) + const targetPeerId = peerIdFromMultihash(multihash) + + const peer = await this.peerStore.get(targetPeerId) + + output.push({ + id: peer.id, + multiaddrs: peer.addresses.map(({ multiaddr }) => multiaddr) + }) + } catch {} + + const keyKadId = await convertBuffer(key) + const ids = this.routingTable.closestPeers(keyKadId) + const closerThanKadId = await convertPeerId(closerThan) + const requesterXor = uint8ArrayXor(closerThanKadId, keyKadId) + for (const peerId of ids) { if (peerId.equals(closerThan)) { continue } + const peerKadId = await convertPeerId(peerId) + const peerXor = uint8ArrayXor(peerKadId, keyKadId) + + // only include if peer isy closer than requester + if (uint8ArrayXorCompare(peerXor, requesterXor) !== -1) { + continue + } + try { const peer = await this.peerStore.get(peerId) diff --git a/packages/kad-dht/test/kad-dht.spec.ts b/packages/kad-dht/test/kad-dht.spec.ts index e0ee0065bb..ed4db55f6d 100644 --- a/packages/kad-dht/test/kad-dht.spec.ts +++ b/packages/kad-dht/test/kad-dht.spec.ts @@ -22,7 +22,7 @@ import * as kadUtils from '../src/utils.js' import { createPeerIdsWithPrivateKey } from './utils/create-peer-id.js' import { createValues } from './utils/create-values.js' import { countDiffPeers } from './utils/index.js' -import { sortClosestPeers } from './utils/sort-closest-peers.js' +import { sortClosestPeers, sortDHTs } from './utils/sort-closest-peers.js' import { TestDHT } from './utils/test-dht.js' import type { PeerIdWithPrivateKey } from './utils/create-peer-id.js' import type { FinalPeerEvent, QueryEvent, ValueEvent } from '../src/index.js' @@ -371,12 +371,12 @@ describe('KadDHT', () => { const key = uint8ArrayFromString('/v/hello') const value = uint8ArrayFromString('world') - const dhts = await Promise.all([ + const dhts = await sortDHTs(await Promise.all([ tdht.spawn(), tdht.spawn(), tdht.spawn(), tdht.spawn() - ]) + ]), await kadUtils.convertBuffer(key)) // Connect all await Promise.all([ diff --git a/packages/kad-dht/test/multiple-nodes.spec.ts b/packages/kad-dht/test/multiple-nodes.spec.ts index 4365d747c7..8468294239 100644 --- a/packages/kad-dht/test/multiple-nodes.spec.ts +++ b/packages/kad-dht/test/multiple-nodes.spec.ts @@ -4,6 +4,8 @@ import { expect } from 'aegir/chai' import drain from 'it-drain' import last from 'it-last' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' +import { convertBuffer } from '../src/utils.js' +import { sortDHTs } from './utils/sort-closest-peers.js' import { TestDHT } from './utils/test-dht.js' import type { KadDHT } from '../src/kad-dht.js' @@ -37,6 +39,8 @@ describe('multiple nodes', function () { const key = uint8ArrayFromString('/v/hello0') const value = uint8ArrayFromString('world') + dhts = await sortDHTs(dhts, await convertBuffer(key)) + await drain(dhts[7].put(key, value)) const res = await Promise.all([ @@ -62,6 +66,8 @@ describe('multiple nodes', function () { const key = uint8ArrayFromString('/v/hello1') const value = uint8ArrayFromString('world') + dhts = await sortDHTs(dhts, await convertBuffer(key)) + await drain(dhts[1].put(key, value)) const res = await Promise.all([ @@ -87,17 +93,19 @@ describe('multiple nodes', function () { const key = uint8ArrayFromString('/v/hallo') const result = uint8ArrayFromString('world4') - await drain(dhts[0].put(key, uint8ArrayFromString('world0'))) - await drain(dhts[1].put(key, uint8ArrayFromString('world1'))) - await drain(dhts[2].put(key, uint8ArrayFromString('world2'))) - await drain(dhts[3].put(key, uint8ArrayFromString('world3'))) - await drain(dhts[4].put(key, uint8ArrayFromString('world4'))) + dhts = await sortDHTs(dhts, await convertBuffer(key)) + + await drain(dhts[3].put(key, uint8ArrayFromString('world0'))) + await drain(dhts[4].put(key, uint8ArrayFromString('world1'))) + await drain(dhts[5].put(key, uint8ArrayFromString('world2'))) + await drain(dhts[6].put(key, uint8ArrayFromString('world3'))) + await drain(dhts[7].put(key, uint8ArrayFromString('world4'))) const res = await Promise.all([ - last(dhts[4].get(key)), - last(dhts[5].get(key)), - last(dhts[6].get(key)), - last(dhts[7].get(key)) + last(dhts[0].get(key)), + last(dhts[1].get(key)), + last(dhts[2].get(key)), + last(dhts[3].get(key)) ]) expect(res[0]).have.property('value').that.equalBytes(result) diff --git a/packages/kad-dht/test/peer-routing.spec.ts b/packages/kad-dht/test/peer-routing.spec.ts new file mode 100644 index 0000000000..2fb9b0ae0e --- /dev/null +++ b/packages/kad-dht/test/peer-routing.spec.ts @@ -0,0 +1,176 @@ +import { generateKeyPair } from '@libp2p/crypto/keys' +import { defaultLogger } from '@libp2p/logger' +import { peerIdFromPrivateKey } from '@libp2p/peer-id' +import { multiaddr } from '@multiformats/multiaddr' +import { expect } from 'aegir/chai' +import { stubInterface, type StubbedInstance } from 'sinon-ts' +import { PeerRouting } from '../src/peer-routing/index.js' +import { convertBuffer } from '../src/utils.js' +import { sortClosestPeers } from './utils/sort-closest-peers.js' +import type { Validators } from '../src/index.js' +import type { Network } from '../src/network.js' +import type { QueryManager } from '../src/query/manager.js' +import type { RoutingTable } from '../src/routing-table/index.js' +import type { Peer, ComponentLogger, PeerId, PeerStore } from '@libp2p/interface' + +interface StubbedPeerRoutingComponents { + peerId: PeerId + peerStore: StubbedInstance + logger: ComponentLogger +} + +interface StubbedPeerRoutingInit { + routingTable: StubbedInstance + network: StubbedInstance + validators: Validators + queryManager: StubbedInstance + logPrefix: string +} + +describe('peer-routing', () => { + let peerRouting: PeerRouting + let components: StubbedPeerRoutingComponents + let init: StubbedPeerRoutingInit + + beforeEach(async () => { + const privateKey = await generateKeyPair('Ed25519') + const peerId = peerIdFromPrivateKey(privateKey) + components = { + peerId, + peerStore: stubInterface(), + logger: defaultLogger() + } + + init = { + routingTable: stubInterface(), + network: stubInterface(), + validators: {}, + queryManager: stubInterface(), + logPrefix: 'libp2p:test-dht' + } + + peerRouting = new PeerRouting(components, init) + }) + + describe('getCloserPeersOffline', () => { + it('should only return DHT servers', async () => { + const key = Uint8Array.from([0, 1, 2, 3, 4]) + const [ + clientPeerId, + serverPeerId, + requester + ] = await getSortedPeers(key) + + const clientPeer: Peer = stubInterface({ + id: clientPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001') + }] + }) + const serverPeer: Peer = stubInterface({ + id: serverPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002') + }] + }) + + init.routingTable.closestPeers.returns([ + serverPeer.id + ]) + + components.peerStore.get.withArgs(serverPeer.id).resolves(serverPeer) + components.peerStore.get.withArgs(clientPeer.id).resolves(clientPeer) + + const closer = await peerRouting.getCloserPeersOffline(key, requester) + + expect(closer).to.have.lengthOf(1) + expect(closer[0].id).to.equal(serverPeer.id) + }) + + it('should include the target peer if known, even if the peer is not a DHT server', async () => { + const clientPeerId = peerIdFromPrivateKey(await generateKeyPair('Ed25519')) + const key = clientPeerId.toMultihash().bytes + const [ + serverPeerId, + requester + ] = await getSortedPeers(key) + + const clientPeer: Peer = stubInterface({ + id: clientPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001') + }] + }) + const serverPeer: Peer = stubInterface({ + id: serverPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002') + }] + }) + + init.routingTable.closestPeers.returns([ + serverPeer.id + ]) + + components.peerStore.get.withArgs(serverPeer.id).resolves(serverPeer) + components.peerStore.get.withArgs(clientPeer.id).resolves(clientPeer) + + const closer = await peerRouting.getCloserPeersOffline(key, requester) + + expect(closer).to.have.lengthOf(2) + expect(closer[0].id).to.equal(clientPeer.id) + expect(closer[1].id).to.equal(serverPeer.id) + }) + + it('should only include peers closer than the requesting peer', async () => { + const key = Uint8Array.from([0, 1, 2, 3, 4]) + const [ + closerPeerId, + requester, + furtherPeerId + ] = await getSortedPeers(key) + + const closerPeer: Peer = stubInterface({ + id: closerPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4001') + }] + }) + const furtherPeer: Peer = stubInterface({ + id: furtherPeerId, + addresses: [{ + isCertified: true, + multiaddr: multiaddr('/ip4/127.0.0.1/tcp/4002') + }] + }) + + init.routingTable.closestPeers.returns([ + closerPeer.id, + furtherPeer.id + ]) + + components.peerStore.get.withArgs(closerPeer.id).resolves(closerPeer) + components.peerStore.get.withArgs(furtherPeer.id).resolves(furtherPeer) + + const closer = await peerRouting.getCloserPeersOffline(key, requester) + + expect(closer).to.have.lengthOf(1) + expect(closer[0].id).to.equal(closerPeer.id) + }) + }) +}) + +async function getSortedPeers (key: Uint8Array, count = 3): Promise { + const keyKadId = await convertBuffer(key) + + const peers = await Promise.all( + new Array(count).fill(0).map(async () => peerIdFromPrivateKey(await generateKeyPair('Ed25519'))) + ) + + return sortClosestPeers(peers, keyKadId) +} diff --git a/packages/kad-dht/test/utils/sort-closest-peers.ts b/packages/kad-dht/test/utils/sort-closest-peers.ts index ef12bf07ff..74dea34ac7 100644 --- a/packages/kad-dht/test/utils/sort-closest-peers.ts +++ b/packages/kad-dht/test/utils/sort-closest-peers.ts @@ -3,6 +3,7 @@ import map from 'it-map' import { xor as uint8ArrayXor } from 'uint8arrays/xor' import { xorCompare as uint8ArrayXorCompare } from 'uint8arrays/xor-compare' import { convertPeerId } from '../../src/utils.js' +import type { KadDHT } from '../../src/kad-dht.js' import type { PeerId } from '@libp2p/interface' /** @@ -26,3 +27,23 @@ export async function sortClosestPeers (peers: T[], }) .map((d) => d.peer) } + +export async function sortDHTs (dhts: T, kadId: Uint8Array): Promise { + const distances = await all( + map(dhts, async (dht) => { + const id = await convertPeerId(dht.components.peerId) + + return { + dht, + distance: uint8ArrayXor(id, kadId) + } + }) + ) + + // @ts-expect-error KadDHT may not be T + return distances + .sort((a, b) => { + return uint8ArrayXorCompare(a.distance, b.distance) + }) + .map((d) => d.dht) +}