From a36ae9f17d2d444264f7322c6b2ed5c904993440 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 11:48:35 +0200 Subject: [PATCH 01/20] auto tls --- package-lock.json | 956 ++++++++++++++++++++++++++++++++---- package.json | 4 +- src/components/P2P/index.ts | 12 +- 3 files changed, 888 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index afe5f547b..72dada5a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@chainsafe/libp2p-noise": "^17.0.0", "@chainsafe/libp2p-yamux": "^8.0.1", "@elastic/elasticsearch": "^8.14.0", + "@ipshipyard/libp2p-auto-tls": "^2.0.1", "@libp2p/autonat": "^3.0.9", "@libp2p/bootstrap": "^12.0.10", "@libp2p/circuit-relay-v2": "^4.1.2", @@ -19,6 +20,7 @@ "@libp2p/dcutr": "^3.0.9", "@libp2p/identify": "^4.0.9", "@libp2p/kad-dht": "^16.1.2", + "@libp2p/keychain": "^6.0.9", "@libp2p/mdns": "^12.0.10", "@libp2p/peer-id": "^6.0.4", "@libp2p/peer-id-factory": "^4.2.4", @@ -100,6 +102,30 @@ "node": ">=0.10.0" } }, + "node_modules/@achingbrain/http-parser-js": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@achingbrain/http-parser-js/-/http-parser-js-0.5.9.tgz", + "integrity": "sha512-nPuMf2zVzBAGRigH/1jFpb/6HmJsps+15f4BPlGDp3vsjYB2ZgruAErUpKpcFiVRz3DHLXcGNmuwmqZx/sVI7A==", + "license": "MIT", + "dependencies": { + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@achingbrain/http-parser-js/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@achingbrain/http-parser-js/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/@achingbrain/nat-port-mapper": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@achingbrain/nat-port-mapper/-/nat-port-mapper-4.0.5.tgz", @@ -178,7 +204,6 @@ "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -2270,6 +2295,69 @@ } } }, + "node_modules/@ipshipyard/libp2p-auto-tls": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@ipshipyard/libp2p-auto-tls/-/libp2p-auto-tls-2.0.1.tgz", + "integrity": "sha512-zpDXVMY1ZgB6o30zFocXUzrD9+tz1bbEdgewFoBf4olDh5/CwjDi/k9v2RrJqujWKYWyRuHRg6Q+VRpvtGrpuw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.2", + "@libp2p/crypto": "^5.0.9", + "@libp2p/http": "^2.0.0", + "@libp2p/interface": "^3.0.2", + "@libp2p/interface-internal": "^3.0.4", + "@libp2p/keychain": "^6.0.4", + "@libp2p/utils": "^7.0.4", + "@multiformats/multiaddr": "^13.0.1", + "@multiformats/multiaddr-matcher": "^3.0.1", + "@peculiar/x509": "^1.12.3", + "acme-client": "^5.4.0", + "any-signal": "^4.1.1", + "delay": "^6.0.0", + "interface-datastore": "^9.0.2", + "multiformats": "^13.3.1", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@ipshipyard/libp2p-auto-tls/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@ipshipyard/libp2p-auto-tls/node_modules/delay": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-6.0.0.tgz", + "integrity": "sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ipshipyard/libp2p-auto-tls/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@ipshipyard/libp2p-auto-tls/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -2817,6 +2905,236 @@ "multiformats": "^13.0.0" } }, + "node_modules/@libp2p/http": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/http/-/http-2.0.1.tgz", + "integrity": "sha512-NjTvXdpwlGNvPsjiumRWJ3jm+9euQkKLXzdHnE+cPCEjPWo6cyGGB541161Jgi8CZ5tNTudddlriwkZRb8Z6KQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/http-fetch": "^4.0.0", + "@libp2p/http-peer-id-auth": "^2.0.0", + "@libp2p/http-utils": "^2.0.0", + "@libp2p/http-websocket": "^2.0.0", + "@libp2p/interface": "^3.0.2", + "@libp2p/interface-internal": "^3.0.4", + "@multiformats/multiaddr": "^13.0.1", + "cookie": "^1.0.2", + "undici": "^7.16.0" + } + }, + "node_modules/@libp2p/http-fetch": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/http-fetch/-/http-fetch-4.0.1.tgz", + "integrity": "sha512-7vtJVOfyGol6CWrNm9HhjlYOmCsJVLKWYdhpmjdpS6pGWtpkTMrHJLznSJ7PYkMq7OnhzhXNFq0FhWygP6mmPQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@achingbrain/http-parser-js": "^0.5.9", + "@libp2p/http-utils": "^2.0.0", + "@libp2p/interface": "^3.0.2", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/http-fetch/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/http-fetch/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, + "node_modules/@libp2p/http-peer-id-auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@libp2p/http-peer-id-auth/-/http-peer-id-auth-2.0.0.tgz", + "integrity": "sha512-GKs0DXK/JVKKH57IGQDiWsC6hYsLY+cwKNRMuX1FY6FZo09zc1QPwvgr0FNtIB2c5WJFf/vja4M4QekLsWU+xw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.12", + "@libp2p/interface": "^3.0.2", + "@libp2p/peer-id": "^6.0.3", + "uint8-varint": "^2.0.4", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/http-peer-id-auth/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/http-peer-id-auth/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, + "node_modules/@libp2p/http-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/http-utils/-/http-utils-2.0.1.tgz", + "integrity": "sha512-dJFRV2gAzPkF5NOnGMdWXXO3PFK0cMSn5uDbW55n5Usnrx6hHQmDCRfKh3ClQUzjG66pFjXM3zFXLKORyasl3A==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@achingbrain/http-parser-js": "^0.5.9", + "@libp2p/interface": "^3.0.2", + "@libp2p/peer-id": "^6.0.3", + "@libp2p/utils": "^7.0.4", + "@multiformats/multiaddr": "^13.0.1", + "@multiformats/multiaddr-to-uri": "^12.0.0", + "@multiformats/uri-to-multiaddr": "^10.0.0", + "it-to-browser-readablestream": "^2.0.12", + "multiformats": "^13.4.1", + "race-event": "^1.6.1", + "readable-stream": "^4.7.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/http-utils/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@libp2p/http-utils/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/http-utils/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@libp2p/http-utils/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, + "node_modules/@libp2p/http-websocket": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@libp2p/http-websocket/-/http-websocket-2.0.1.tgz", + "integrity": "sha512-hMMWVKAK3P3oAmatUB8SQ4mUMhkkLdERAjgZUoKdohIPumPGQ6ADFSJMYsSWv9ZwyBiXMHBbwluYEBZUw85GCw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@achingbrain/http-parser-js": "^0.5.9", + "@libp2p/http-utils": "^2.0.0", + "@libp2p/interface": "^3.0.2", + "@libp2p/interface-internal": "^3.0.4", + "@libp2p/utils": "^7.0.4", + "@multiformats/multiaddr": "^13.0.1", + "multiformats": "^13.4.1", + "race-event": "^1.6.1", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/http-websocket/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@libp2p/http-websocket/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/http-websocket/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, + "node_modules/@libp2p/http/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@libp2p/http/node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@libp2p/http/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/http/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, + "node_modules/@libp2p/http/node_modules/undici": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", + "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/@libp2p/identify": { "version": "4.0.9", "resolved": "https://registry.npmjs.org/@libp2p/identify/-/identify-4.0.9.tgz", @@ -3012,6 +3330,49 @@ "multiformats": "^13.0.0" } }, + "node_modules/@libp2p/keychain": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@libp2p/keychain/-/keychain-6.0.9.tgz", + "integrity": "sha512-gO8krY3iPbXzc+LLA2haTEKbnINpx/p/FlXeHZsyXSD5Q31aV2zQsOrNlVaCyDhKqb1uiyon7NMMPn8UUqkJWQ==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.13", + "@libp2p/interface": "^3.1.0", + "@noble/hashes": "^2.0.1", + "asn1js": "^3.0.6", + "interface-datastore": "^9.0.1", + "multiformats": "^13.4.0", + "sanitize-filename": "^1.6.3", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/keychain/node_modules/@noble/hashes": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz", + "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@libp2p/keychain/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/keychain/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/@libp2p/logger": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-6.2.2.tgz", @@ -4044,6 +4405,43 @@ "multiformats": "^13.0.0" } }, + "node_modules/@multiformats/uri-to-multiaddr": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@multiformats/uri-to-multiaddr/-/uri-to-multiaddr-10.0.0.tgz", + "integrity": "sha512-QsmwLmY6iB1wDU1e1wyctqF0eP/2KD1QPLQ+APISuqETbCTSpaq159S/K/ssmWlBpSEkhH0SUfBUgGi014Ttfw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@multiformats/multiaddr": "^13.0.0", + "is-ip": "^5.0.0" + } + }, + "node_modules/@multiformats/uri-to-multiaddr/node_modules/@multiformats/multiaddr": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-13.0.1.tgz", + "integrity": "sha512-XToN915cnfr6Lr9EdGWakGJbPT0ghpg/850HvdC+zFX8XvpLZElwa8synCiwa8TuvKNnny6m8j8NVBNCxhIO3g==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@chainsafe/is-ip": "^2.0.1", + "multiformats": "^13.0.0", + "uint8-varint": "^2.0.1", + "uint8arrays": "^5.0.0" + } + }, + "node_modules/@multiformats/uri-to-multiaddr/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@multiformats/uri-to-multiaddr/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/@noble/ciphers": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.1.1.tgz", @@ -4272,7 +4670,6 @@ "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", @@ -4375,97 +4772,311 @@ "dev": true, "license": "MIT", "dependencies": { - "@octokit/types": "^15.0.1" - }, - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" + "@octokit/types": "^15.0.1" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-26.0.0.tgz", + "integrity": "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-15.0.2.tgz", + "integrity": "sha512-rR+5VRjhYSer7sC51krfCctQhVTmjyUMAaShfPB8mscVa8tSoLyon3coxQmXu0ahJoLVWl8dSGD/3OGZlFV44Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^26.0.0" + } + }, + "node_modules/@octokit/request": { + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.7.tgz", + "integrity": "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^11.0.2", + "@octokit/request-error": "^7.0.2", + "@octokit/types": "^16.0.0", + "fast-content-type-parse": "^3.0.0", + "universal-user-agent": "^7.0.2" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/request-error": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", + "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/rest": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.0.tgz", + "integrity": "sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/core": "^7.0.2", + "@octokit/plugin-paginate-rest": "^13.0.1", + "@octokit/plugin-request-log": "^6.0.0", + "@octokit/plugin-rest-endpoint-methods": "^16.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/@octokit/types": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^27.0.0" + } + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@peculiar/asn1-cms": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.6.0.tgz", + "integrity": "sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "@peculiar/asn1-x509-attr": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-cms/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-csr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.6.0.tgz", + "integrity": "sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-csr/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-ecc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.6.0.tgz", + "integrity": "sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-ecc/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-pfx": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.6.0.tgz", + "integrity": "sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-pkcs8": "^2.6.0", + "@peculiar/asn1-rsa": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-pfx/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-pkcs8": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.6.0.tgz", + "integrity": "sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/openapi-types": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-26.0.0.tgz", - "integrity": "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA==", - "dev": true, - "license": "MIT" + "node_modules/@peculiar/asn1-pkcs8/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, - "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-15.0.2.tgz", - "integrity": "sha512-rR+5VRjhYSer7sC51krfCctQhVTmjyUMAaShfPB8mscVa8tSoLyon3coxQmXu0ahJoLVWl8dSGD/3OGZlFV44Q==", - "dev": true, + "node_modules/@peculiar/asn1-pkcs9": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.6.0.tgz", + "integrity": "sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw==", "license": "MIT", "dependencies": { - "@octokit/openapi-types": "^26.0.0" + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-pfx": "^2.6.0", + "@peculiar/asn1-pkcs8": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "@peculiar/asn1-x509-attr": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" } }, - "node_modules/@octokit/request": { - "version": "10.0.7", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.7.tgz", - "integrity": "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==", - "dev": true, + "node_modules/@peculiar/asn1-pkcs9/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-rsa": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.6.0.tgz", + "integrity": "sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w==", "license": "MIT", "dependencies": { - "@octokit/endpoint": "^11.0.2", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "fast-content-type-parse": "^3.0.0", - "universal-user-agent": "^7.0.2" - }, - "engines": { - "node": ">= 20" + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" } }, - "node_modules/@octokit/request-error": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz", - "integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==", - "dev": true, + "node_modules/@peculiar/asn1-rsa/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.6.0.tgz", + "integrity": "sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg==", "license": "MIT", "dependencies": { - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" + "asn1js": "^3.0.6", + "pvtsutils": "^1.3.6", + "tslib": "^2.8.1" } }, - "node_modules/@octokit/rest": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-22.0.0.tgz", - "integrity": "sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA==", - "dev": true, + "node_modules/@peculiar/asn1-schema/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-x509": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.6.0.tgz", + "integrity": "sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA==", "license": "MIT", "dependencies": { - "@octokit/core": "^7.0.2", - "@octokit/plugin-paginate-rest": "^13.0.1", - "@octokit/plugin-request-log": "^6.0.0", - "@octokit/plugin-rest-endpoint-methods": "^16.0.0" - }, - "engines": { - "node": ">= 20" + "@peculiar/asn1-schema": "^2.6.0", + "asn1js": "^3.0.6", + "pvtsutils": "^1.3.6", + "tslib": "^2.8.1" } }, - "node_modules/@octokit/types": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", - "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", - "dev": true, + "node_modules/@peculiar/asn1-x509-attr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.6.0.tgz", + "integrity": "sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA==", "license": "MIT", "dependencies": { - "@octokit/openapi-types": "^27.0.0" + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" } }, - "node_modules/@opentelemetry/api": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", - "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", - "license": "Apache-2.0", + "node_modules/@peculiar/asn1-x509-attr/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/asn1-x509/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/@peculiar/x509": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz", + "integrity": "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-csr": "^2.6.0", + "@peculiar/asn1-ecc": "^2.6.0", + "@peculiar/asn1-pkcs9": "^2.6.0", + "@peculiar/asn1-rsa": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "pvtsutils": "^1.3.6", + "reflect-metadata": "^0.2.2", + "tslib": "^2.8.1", + "tsyringe": "^4.10.0" + }, "engines": { - "node": ">=8.0.0" + "node": ">=20.0.0" } }, + "node_modules/@peculiar/x509/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, "node_modules/@phun-ky/typeof": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@phun-ky/typeof/-/typeof-2.0.3.tgz", @@ -5007,7 +5618,6 @@ "resolved": "https://registry.npmjs.org/@rdfjs/types/-/types-1.1.2.tgz", "integrity": "sha512-wqpOJK1QCbmsGNtyzYnojPU8gRDPid2JO0Q0kMtb4j65xhCK880cnKAfEOwC+dX85VJcCByQx5zOwyyfCjDJsg==", "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*" } @@ -5422,7 +6032,6 @@ "node_modules/@types/rdfjs__namespace": { "version": "2.0.10", "license": "MIT", - "peer": true, "dependencies": { "@rdfjs/types": "*" } @@ -5447,6 +6056,7 @@ "node_modules/@types/rdfjs__prefix-map": { "version": "0.1.5", "license": "MIT", + "peer": true, "dependencies": { "@rdfjs/types": "*" } @@ -5462,6 +6072,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/rdfjs__serializer-jsonld-ext/-/rdfjs__serializer-jsonld-ext-4.0.1.tgz", "integrity": "sha512-jgbQ/1kV7nESKG7SY8FJED6K4OFznr6Sz3ybF1ncpBR7TUBTuy3InpZOVRK4Wjpy2zi84iIAzJ1CIIo9NZh2Xw==", + "peer": true, "dependencies": { "@rdfjs/types": ">=1.0.0", "@types/jsonld": "*", @@ -5479,6 +6090,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@types/rdfjs__serializer-turtle/-/rdfjs__serializer-turtle-1.1.0.tgz", "integrity": "sha512-NGHnbz5985UwS/YS6WL/FkS94B+QiVTdsfvJCqPwLmY3E7UeClw91c2KbiphZUR/uh7uwLwxeKKhV2T1gYgT5Q==", + "peer": true, "dependencies": { "@rdfjs/types": ">=1.0.0", "@types/node": "*", @@ -5649,7 +6261,6 @@ "version": "6.9.1", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "6.9.1", "@typescript-eslint/types": "6.9.1", @@ -5956,11 +6567,26 @@ "node": ">= 0.6" } }, + "node_modules/acme-client": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/acme-client/-/acme-client-5.4.0.tgz", + "integrity": "sha512-mORqg60S8iML6XSmVjqjGHJkINrCGLMj2QvDmFzI9vIlv1RGlyjmw3nrzaINJjkNsYXC41XhhD5pfy7CtuGcbA==", + "license": "MIT", + "dependencies": { + "@peculiar/x509": "^1.11.0", + "asn1js": "^3.0.5", + "axios": "^1.7.2", + "debug": "^4.3.5", + "node-forge": "^1.3.1" + }, + "engines": { + "node": ">= 16" + } + }, "node_modules/acorn": { "version": "8.11.2", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -6627,7 +7253,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001688", "electron-to-chromium": "^1.5.73", @@ -7220,6 +7845,21 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clone-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-3.0.0.tgz", + "integrity": "sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==", + "license": "MIT", + "dependencies": { + "is-regexp": "^3.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/clownface": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/clownface/-/clownface-2.0.2.tgz", @@ -7385,6 +8025,18 @@ "node": ">= 0.6" } }, + "node_modules/convert-hrtime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/convert-hrtime/-/convert-hrtime-5.0.0.tgz", + "integrity": "sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/convert-source-map": { "version": "1.9.0", "dev": true, @@ -8377,7 +9029,6 @@ "version": "8.52.0", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -8625,7 +9276,6 @@ "version": "2.29.0", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -8675,7 +9325,6 @@ "version": "15.7.0", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "builtins": "^5.0.1", "eslint-plugin-es": "^4.1.0", @@ -8787,7 +9436,6 @@ "version": "6.1.1", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -8799,7 +9447,6 @@ "version": "7.33.2", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "array-includes": "^3.1.6", "array.prototype.flatmap": "^1.3.1", @@ -9765,6 +10412,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/function-timeout": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/function-timeout/-/function-timeout-0.1.1.tgz", + "integrity": "sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/function.prototype.name": { "version": "1.1.6", "dev": true, @@ -10650,6 +11309,18 @@ "node": ">= 12" } }, + "node_modules/ip-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-5.0.0.tgz", + "integrity": "sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ipaddr.js": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.3.0.tgz", @@ -10875,6 +11546,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-ip": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-5.0.1.tgz", + "integrity": "sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==", + "license": "MIT", + "dependencies": { + "ip-regex": "^5.0.0", + "super-regex": "^0.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-lambda": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", @@ -10976,6 +11663,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-regexp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz", + "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-set": { "version": "2.0.2", "dev": true, @@ -11452,6 +12151,15 @@ "integrity": "sha512-XMeUbnjOcgrhFXPUqa7H0VIjYSV/BvyxxjCp76QHVAFDJw2LmR1SHxUFiqyGeobgzJr7P2ZwSRRJQGn4D2BVlA==", "license": "Apache-2.0 OR MIT" }, + "node_modules/it-to-browser-readablestream": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/it-to-browser-readablestream/-/it-to-browser-readablestream-2.0.12.tgz", + "integrity": "sha512-9pcVGxY8jrfMUgCqPrxjVN0bl6fQXCK1NEbUq5Bi+APlr3q0s2AsQINBPcWYgJbMnSHAfoRDthsi4GHqtkvHgw==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "get-iterator": "^2.0.1" + } + }, "node_modules/iterator.prototype": { "version": "1.1.2", "dev": true, @@ -11717,7 +12425,6 @@ "node_modules/ky": { "version": "0.33.3", "license": "MIT", - "peer": true, "engines": { "node": ">=14.16" }, @@ -12820,6 +13527,15 @@ "dev": true, "license": "MIT" }, + "node_modules/node-forge": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", + "integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/node-gyp": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", @@ -14117,7 +14833,6 @@ "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -14689,6 +15404,12 @@ "node": ">=8.10.0" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0" + }, "node_modules/reflect.getprototypeof": { "version": "1.0.4", "dev": true, @@ -15220,6 +15941,15 @@ "version": "2.1.2", "license": "MIT" }, + "node_modules/sanitize-filename": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", + "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", + "license": "WTFPL OR ISC", + "dependencies": { + "truncate-utf8-bytes": "^1.0.0" + } + }, "node_modules/sax": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz", @@ -15990,6 +16720,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/super-regex": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/super-regex/-/super-regex-0.2.0.tgz", + "integrity": "sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==", + "license": "MIT", + "dependencies": { + "clone-regexp": "^3.0.0", + "function-timeout": "^0.1.0", + "time-span": "^5.1.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "8.1.1", "dev": true, @@ -16270,6 +17017,21 @@ "version": "1.1.0", "license": "MIT" }, + "node_modules/time-span": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/time-span/-/time-span-5.1.0.tgz", + "integrity": "sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==", + "license": "MIT", + "dependencies": { + "convert-hrtime": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/timers-ext": { "version": "0.1.7", "license": "ISC", @@ -16329,7 +17091,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -16403,6 +17164,15 @@ "node": ">= 14.0.0" } }, + "node_modules/truncate-utf8-bytes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", + "license": "WTFPL", + "dependencies": { + "utf8-byte-length": "^1.0.1" + } + }, "node_modules/ts-api-utils": { "version": "1.0.3", "dev": true, @@ -16470,6 +17240,24 @@ "fsevents": "~2.3.3" } }, + "node_modules/tsyringe": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.10.0.tgz", + "integrity": "sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==", + "license": "MIT", + "dependencies": { + "tslib": "^1.9.3" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tsyringe/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -16610,7 +17398,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -16700,7 +17487,6 @@ "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", "license": "MIT", - "peer": true, "dependencies": { "@fastify/busboy": "^2.0.0" }, @@ -16812,6 +17598,12 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/utf8-byte-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "license": "(WTFPL OR MIT)" + }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" diff --git a/package.json b/package.json index 4697ca6b6..1688517ce 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@chainsafe/libp2p-noise": "^17.0.0", "@chainsafe/libp2p-yamux": "^8.0.1", "@elastic/elasticsearch": "^8.14.0", + "@ipshipyard/libp2p-auto-tls": "^2.0.1", "@libp2p/autonat": "^3.0.9", "@libp2p/bootstrap": "^12.0.10", "@libp2p/circuit-relay-v2": "^4.1.2", @@ -58,6 +59,7 @@ "@libp2p/dcutr": "^3.0.9", "@libp2p/identify": "^4.0.9", "@libp2p/kad-dht": "^16.1.2", + "@libp2p/keychain": "^6.0.9", "@libp2p/mdns": "^12.0.10", "@libp2p/peer-id": "^6.0.4", "@libp2p/peer-id-factory": "^4.2.4", @@ -159,4 +161,4 @@ "publish": false } } -} \ No newline at end of file +} diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 857ca9c95..3c3f9b43b 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -47,6 +47,9 @@ import { P2P_LOGGER } from '../../utils/logging/common.js' import { CoreHandlersRegistry } from '../core/handler/coreHandlersRegistry' import { Multiaddr, multiaddr } from '@multiformats/multiaddr' // import { getIPv4, getIPv6 } from '../../utils/ip.js' +import { autoTLS } from '@ipshipyard/libp2p-auto-tls' +import { keychain } from '@libp2p/keychain' +import { http } from '@libp2p/http' const DEFAULT_OPTIONS = { pollInterval: 1000 @@ -332,7 +335,14 @@ export class OceanP2P extends EventEmitter { allowedTopics: ['oceanprotocol._peer-discovery._p2p._pubsub', 'oceanprotocol'] }), */ ping: ping(), - dcutr: dcutr() + dcutr: dcutr(), + keychain: keychain(), + http: http(), + autoTLS: autoTLS({ + // we trust that it will configure the DNS records to answer the ACME DNS-01 challenge correctly. + autoConfirmAddress: true, + acmeDirectory: 'https://acme-staging-v02.api.letsencrypt.org/directory' + }) } // eslint-disable-next-line no-constant-condition, no-self-compare From ed727ca6de5d7c1dc4971f580557a413db00fcd2 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 12:43:15 +0200 Subject: [PATCH 02/20] certificate log --- src/components/P2P/index.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 3c3f9b43b..5cf72718e 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -117,6 +117,9 @@ export class OceanP2P extends EventEmitter { this._libp2p.addEventListener('peer:discovery', (details: any) => { this.handlePeerDiscovery(details) }) + this._libp2p.addEventListener('certificate:provision', (details: any) => { + this.handleCertificateProvision(details) + }) this._options = Object.assign( {}, lodash.cloneDeep(DEFAULT_OPTIONS), @@ -192,6 +195,22 @@ export class OceanP2P extends EventEmitter { } } + handleCertificateProvision(details: any) { + console.info('A TLS certificate was provisioned') + console.info('Details: ' + JSON.stringify(details)) + const interval = setInterval(() => { + const mas = this._libp2p + .getMultiaddrs() + .filter((ma: any) => ma.toString().includes('/sni/')) + .map((ma: any) => ma.toString()) + if (mas.length > 0) { + console.info('addresses:') + console.info(mas.join('\n')) + } + clearInterval(interval) + }, 1_000) + } + handlePeerJoined(details: any) { P2P_LOGGER.debug('New peer joined us:' + details) } @@ -353,7 +372,10 @@ export class OceanP2P extends EventEmitter { // eslint-disable-next-line no-constant-condition, no-self-compare if (config.p2pConfig.upnp) { P2P_LOGGER.info('Enabling UPnp discovery') - servicesConfig = { ...servicesConfig, ...{ upnpNAT: uPnPNAT() } } + servicesConfig = { + ...servicesConfig, + ...{ upnpNAT: uPnPNAT({ autoConfirmAddress: true }) } + } } // eslint-disable-next-line no-constant-condition, no-self-compare if (config.p2pConfig.autoNat) { From 816c491a4eb116e273f69b47b19bcfb30f5769ce Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 13:53:08 +0200 Subject: [PATCH 03/20] fix network stats --- src/components/P2P/index.ts | 18 +++++++++++++----- src/components/core/handler/p2p.ts | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 5cf72718e..3af1c237d 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -489,8 +489,10 @@ export class OceanP2P extends EventEmitter { getNetworkingStats() { const ret: any = {} - ret.announce = this._libp2p.getMultiaddrs() - ret.connections = this._libp2p.getConnections() + ret.announce = this._libp2p.getMultiaddrs().map((ma) => ma.toString()) + ret.connections = this._libp2p + .getConnections() + .map((conn) => conn.remoteAddr.toString()) const libp2pInternal = this._libp2p as Libp2p & { components: { @@ -499,9 +501,15 @@ export class OceanP2P extends EventEmitter { } } if (libp2pInternal.components) { - ret.binds = libp2pInternal.components.addressManager.getListenAddrs() - ret.listen = libp2pInternal.components.transportManager.getAddrs() - ret.observing = libp2pInternal.components.addressManager.getObservedAddrs() + ret.binds = libp2pInternal.components.addressManager + .getListenAddrs() + .map((ma) => ma.toString()) + ret.listen = libp2pInternal.components.transportManager + .getAddrs() + .map((ma) => ma.toString()) + ret.observing = libp2pInternal.components.addressManager + .getObservedAddrs() + .map((ma) => ma.toString()) } return ret diff --git a/src/components/core/handler/p2p.ts b/src/components/core/handler/p2p.ts index fa87f367d..6b4a58617 100644 --- a/src/components/core/handler/p2p.ts +++ b/src/components/core/handler/p2p.ts @@ -134,7 +134,7 @@ export class GetP2PNetworkStatsHandler extends CommandHandler { if (config.p2pConfig.enableNetworkStats) { const stats = this.getOceanNode().getP2PNode().getNetworkingStats() return { - stream: Readable.from(JSON.stringify(stats, null, 4)), + stream: Readable.from(JSON.stringify(stats)), status: { httpStatus: 200 } } } else { From 94e6094154aa4db6669eb144d3c285013a61b865 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 15:19:59 +0200 Subject: [PATCH 04/20] logs --- src/components/P2P/index.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 3af1c237d..1898ce9a2 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -120,6 +120,9 @@ export class OceanP2P extends EventEmitter { this._libp2p.addEventListener('certificate:provision', (details: any) => { this.handleCertificateProvision(details) }) + this._libp2p.addEventListener('certificate:renew', (details: any) => { + this.handleCertificateProvision(details) + }) this._options = Object.assign( {}, lodash.cloneDeep(DEFAULT_OPTIONS), @@ -196,16 +199,16 @@ export class OceanP2P extends EventEmitter { } handleCertificateProvision(details: any) { - console.info('A TLS certificate was provisioned') - console.info('Details: ' + JSON.stringify(details)) + console.log('A TLS certificate was provisioned') + console.log('Details: ' + JSON.stringify(details)) const interval = setInterval(() => { const mas = this._libp2p .getMultiaddrs() .filter((ma: any) => ma.toString().includes('/sni/')) .map((ma: any) => ma.toString()) if (mas.length > 0) { - console.info('addresses:') - console.info(mas.join('\n')) + console.log('addresses:') + console.log(mas.join('\n')) } clearInterval(interval) }, 1_000) @@ -357,11 +360,7 @@ export class OceanP2P extends EventEmitter { dcutr: dcutr(), keychain: keychain(), http: http(), - autoTLS: autoTLS({ - // we trust that it will configure the DNS records to answer the ACME DNS-01 challenge correctly. - autoConfirmAddress: true, - acmeDirectory: 'https://acme-staging-v02.api.letsencrypt.org/directory' - }) + autoTLS: autoTLS() } // eslint-disable-next-line no-constant-condition, no-self-compare @@ -374,7 +373,7 @@ export class OceanP2P extends EventEmitter { P2P_LOGGER.info('Enabling UPnp discovery') servicesConfig = { ...servicesConfig, - ...{ upnpNAT: uPnPNAT({ autoConfirmAddress: true }) } + ...{ upnpNAT: uPnPNAT() } } } // eslint-disable-next-line no-constant-condition, no-self-compare From 6365ea7619b50d7e432d59d1f6586fcc2f3579ea Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 15:40:55 +0200 Subject: [PATCH 05/20] append announce --- src/components/P2P/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 1898ce9a2..bc00040ae 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -316,7 +316,7 @@ export class OceanP2P extends EventEmitter { listen: bindInterfaces, announceFilter: (multiaddrs: any[]) => multiaddrs.filter((m) => this.shouldAnnounce(m)), - announce: config.p2pConfig.announceAddresses + appendAnnounce: config.p2pConfig.announceAddresses } } else { addresses = { @@ -360,7 +360,9 @@ export class OceanP2P extends EventEmitter { dcutr: dcutr(), keychain: keychain(), http: http(), - autoTLS: autoTLS() + autoTLS: autoTLS({ + autoConfirmAddress: true + }) } // eslint-disable-next-line no-constant-condition, no-self-compare From cfa5781514e1fc59b3adbd3a0fe2d072f1571cd8 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 16:17:52 +0200 Subject: [PATCH 06/20] staging acme --- src/components/P2P/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index bc00040ae..31fb3fd81 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -361,7 +361,8 @@ export class OceanP2P extends EventEmitter { keychain: keychain(), http: http(), autoTLS: autoTLS({ - autoConfirmAddress: true + autoConfirmAddress: true, + acmeDirectory: 'https://acme-staging-v02.api.letsencrypt.org/directory' }) } From 4a423c999fa49a385744dc8072ab2c83acbf9677 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 13 Jan 2026 16:55:44 +0200 Subject: [PATCH 07/20] revert default domain --- src/components/P2P/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 31fb3fd81..68dd5aab0 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -360,10 +360,7 @@ export class OceanP2P extends EventEmitter { dcutr: dcutr(), keychain: keychain(), http: http(), - autoTLS: autoTLS({ - autoConfirmAddress: true, - acmeDirectory: 'https://acme-staging-v02.api.letsencrypt.org/directory' - }) + autoTLS: autoTLS() } // eslint-disable-next-line no-constant-condition, no-self-compare From b838e4bf3bd6bfb56f2f1120e17c0b2b5b456f8c Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 14:59:43 +0200 Subject: [PATCH 08/20] Patch package --- package-lock.json | 204 +++++++++++++++++++++++++ package.json | 5 +- patches/@libp2p+http-utils+2.0.1.patch | 26 ++++ src/components/P2P/index.ts | 22 +-- 4 files changed, 247 insertions(+), 10 deletions(-) create mode 100644 patches/@libp2p+http-utils+2.0.1.patch diff --git a/package-lock.json b/package-lock.json index 72dada5a8..e2e5934a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,6 +87,8 @@ "eslint-plugin-promise": "^6.1.1", "mocha": "^11.1.0", "nyc": "^17.1.0", + "patch-package": "^8.0.1", + "postinstall-postinstall": "^2.1.0", "prettier": "^3.7.4", "release-it": "^19.0.6", "sinon": "^19.0.2", @@ -6417,6 +6419,13 @@ "@rdfjs/types": "^1.0.0" } }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/@zazuko/env-core": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@zazuko/env-core/-/env-core-1.1.2.tgz", @@ -10222,6 +10231,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat": { "version": "5.0.2", "dev": true, @@ -10374,6 +10393,21 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -12249,6 +12283,26 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true, @@ -12265,6 +12319,29 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonld": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.3.3.tgz", @@ -12418,6 +12495,16 @@ "json-buffer": "3.0.1" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kuler": { "version": "2.0.0", "license": "MIT" @@ -14587,6 +14674,79 @@ "node": ">= 0.8" } }, + "node_modules/patch-package": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^10.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.2.4", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -14794,6 +14954,14 @@ "node": ">= 0.4" } }, + "node_modules/postinstall-postinstall": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", + "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT" + }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -17109,6 +17277,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/tmp": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, "node_modules/to-buffer": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", @@ -17523,6 +17701,16 @@ "dev": true, "license": "ISC" }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/unlimited-timeout": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unlimited-timeout/-/unlimited-timeout-0.1.0.tgz", @@ -18076,6 +18264,22 @@ "version": "4.0.0", "license": "ISC" }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yargs": { "version": "17.7.2", "license": "MIT", diff --git a/package.json b/package.json index 1688517ce..72a7d9ce8 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ "test:stress": "npm run test:k6-common k6 run -e TEST_TYPE=stress \"./dist/test/performance/perf_test.js\"", "test:request:rate": "npm run test:k6-common && k6 run -e RATE=true \"./dist/test/performance/perf_test.js\"", "release": "release-it --non-interactive", - "changelog": "auto-changelog -p" + "changelog": "auto-changelog -p", + "postinstall": "patch-package" }, "dependencies": { "@chainsafe/libp2p-noise": "^17.0.0", @@ -126,6 +127,8 @@ "eslint-plugin-promise": "^6.1.1", "mocha": "^11.1.0", "nyc": "^17.1.0", + "patch-package": "^8.0.1", + "postinstall-postinstall": "^2.1.0", "prettier": "^3.7.4", "release-it": "^19.0.6", "sinon": "^19.0.2", diff --git a/patches/@libp2p+http-utils+2.0.1.patch b/patches/@libp2p+http-utils+2.0.1.patch new file mode 100644 index 000000000..ef52b3299 --- /dev/null +++ b/patches/@libp2p+http-utils+2.0.1.patch @@ -0,0 +1,26 @@ +diff --git a/node_modules/@libp2p/http-utils/dist/src/index.js b/node_modules/@libp2p/http-utils/dist/src/index.js +index f1f98d5..2ad6be6 100644 +--- a/node_modules/@libp2p/http-utils/dist/src/index.js ++++ b/node_modules/@libp2p/http-utils/dist/src/index.js +@@ -213,7 +213,7 @@ export function getHost(addresses, headers) { + let protocol = 'http:'; + if (addresses instanceof URL) { + host = addresses.hostname; +- port = parseInt(addresses.port, 10); ++ port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10); + protocol = addresses.protocol; + } + if (!isValidHost(host)) { +diff --git a/node_modules/@libp2p/http-utils/src/index.ts b/node_modules/@libp2p/http-utils/src/index.ts +index 5a73139..a5e0dc5 100644 +--- a/node_modules/@libp2p/http-utils/src/index.ts ++++ b/node_modules/@libp2p/http-utils/src/index.ts +@@ -301,7 +301,7 @@ export function getHost (addresses: URL | Multiaddr[], headers: Headers): string + + if (addresses instanceof URL) { + host = addresses.hostname +- port = parseInt(addresses.port, 10) ++ port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10) + protocol = addresses.protocol + } + diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 68dd5aab0..dec7479f2 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -117,11 +117,11 @@ export class OceanP2P extends EventEmitter { this._libp2p.addEventListener('peer:discovery', (details: any) => { this.handlePeerDiscovery(details) }) - this._libp2p.addEventListener('certificate:provision', (details: any) => { - this.handleCertificateProvision(details) + this._libp2p.addEventListener('certificate:provision', () => { + this.handleCertificateProvision() }) - this._libp2p.addEventListener('certificate:renew', (details: any) => { - this.handleCertificateProvision(details) + this._libp2p.addEventListener('certificate:renew', () => { + this.handleCertificateRenew() }) this._options = Object.assign( {}, @@ -198,22 +198,26 @@ export class OceanP2P extends EventEmitter { } } - handleCertificateProvision(details: any) { - console.log('A TLS certificate was provisioned') - console.log('Details: ' + JSON.stringify(details)) + handleCertificateProvision() { + console.log('----- A TLS certificate was provisioned -----') const interval = setInterval(() => { const mas = this._libp2p .getMultiaddrs() .filter((ma: any) => ma.toString().includes('/sni/')) .map((ma: any) => ma.toString()) if (mas.length > 0) { - console.log('addresses:') + console.log('----- TLS addresses: -----') console.log(mas.join('\n')) + console.log('----- End of TLS addresses -----') } clearInterval(interval) }, 1_000) } + handleCertificateRenew() { + console.log('----- A TLS certificate was renewed -----') + } + handlePeerJoined(details: any) { P2P_LOGGER.debug('New peer joined us:' + details) } @@ -316,7 +320,7 @@ export class OceanP2P extends EventEmitter { listen: bindInterfaces, announceFilter: (multiaddrs: any[]) => multiaddrs.filter((m) => this.shouldAnnounce(m)), - appendAnnounce: config.p2pConfig.announceAddresses + announce: config.p2pConfig.announceAddresses } } else { addresses = { From e8d043589ac28293cef12c71c202e218fd4d7bcb Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 15:03:20 +0200 Subject: [PATCH 09/20] use logger --- src/components/P2P/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index dec7479f2..e8d457580 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -199,23 +199,23 @@ export class OceanP2P extends EventEmitter { } handleCertificateProvision() { - console.log('----- A TLS certificate was provisioned -----') + P2P_LOGGER.info('----- A TLS certificate was provisioned -----') const interval = setInterval(() => { const mas = this._libp2p .getMultiaddrs() .filter((ma: any) => ma.toString().includes('/sni/')) .map((ma: any) => ma.toString()) if (mas.length > 0) { - console.log('----- TLS addresses: -----') - console.log(mas.join('\n')) - console.log('----- End of TLS addresses -----') + P2P_LOGGER.info('----- TLS addresses: -----') + P2P_LOGGER.info(mas.join('\n')) + P2P_LOGGER.info('----- End of TLS addresses -----') } clearInterval(interval) }, 1_000) } handleCertificateRenew() { - console.log('----- A TLS certificate was renewed -----') + P2P_LOGGER.info('----- A TLS certificate was renewed -----') } handlePeerJoined(details: any) { From b92c537e7d690896b42d39d7eabe4eba065c7434 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 15:42:30 +0200 Subject: [PATCH 10/20] append and auto-announce --- src/components/P2P/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index e8d457580..937b127f4 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -320,7 +320,7 @@ export class OceanP2P extends EventEmitter { listen: bindInterfaces, announceFilter: (multiaddrs: any[]) => multiaddrs.filter((m) => this.shouldAnnounce(m)), - announce: config.p2pConfig.announceAddresses + appendAnnounce: config.p2pConfig.announceAddresses } } else { addresses = { @@ -364,7 +364,9 @@ export class OceanP2P extends EventEmitter { dcutr: dcutr(), keychain: keychain(), http: http(), - autoTLS: autoTLS() + autoTLS: autoTLS({ + autoConfirmAddress: true + }) } // eslint-disable-next-line no-constant-condition, no-self-compare From 8426e5cafc0bb1e50c3e8b3e6fd5b154165736b3 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 16:23:35 +0200 Subject: [PATCH 11/20] add has install script --- package-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package-lock.json b/package-lock.json index e2e5934a3..95ea905b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "ocean-node", "version": "0.2.3", + "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "@chainsafe/libp2p-noise": "^17.0.0", From 06d7ffe5bb1b0f10cd9fcf5d64322525cfea58f7 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 17:02:16 +0200 Subject: [PATCH 12/20] manual script --- package-lock.json | 204 ------------------------- package.json | 4 +- patches/@libp2p+http-utils+2.0.1.patch | 26 ---- scripts/fix-libp2p-http-utils.py | 52 +++++++ 4 files changed, 53 insertions(+), 233 deletions(-) delete mode 100644 patches/@libp2p+http-utils+2.0.1.patch create mode 100755 scripts/fix-libp2p-http-utils.py diff --git a/package-lock.json b/package-lock.json index 95ea905b0..97f3ab101 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,8 +88,6 @@ "eslint-plugin-promise": "^6.1.1", "mocha": "^11.1.0", "nyc": "^17.1.0", - "patch-package": "^8.0.1", - "postinstall-postinstall": "^2.1.0", "prettier": "^3.7.4", "release-it": "^19.0.6", "sinon": "^19.0.2", @@ -6420,13 +6418,6 @@ "@rdfjs/types": "^1.0.0" } }, - "node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true, - "license": "BSD-2-Clause" - }, "node_modules/@zazuko/env-core": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@zazuko/env-core/-/env-core-1.1.2.tgz", @@ -10232,16 +10223,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "micromatch": "^4.0.2" - } - }, "node_modules/flat": { "version": "5.0.2", "dev": true, @@ -10394,21 +10375,6 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -12284,26 +12250,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-stable-stringify": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", - "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "isarray": "^2.0.5", - "jsonify": "^0.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "dev": true, @@ -12320,29 +12266,6 @@ "node": ">=6" } }, - "node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsonify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", - "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", - "dev": true, - "license": "Public Domain", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/jsonld": { "version": "8.3.3", "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-8.3.3.tgz", @@ -12496,16 +12419,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.11" - } - }, "node_modules/kuler": { "version": "2.0.0", "license": "MIT" @@ -14675,79 +14588,6 @@ "node": ">= 0.8" } }, - "node_modules/patch-package": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", - "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^4.1.2", - "ci-info": "^3.7.0", - "cross-spawn": "^7.0.3", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^10.0.0", - "json-stable-stringify": "^1.0.2", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.6", - "open": "^7.4.2", - "semver": "^7.5.3", - "slash": "^2.0.0", - "tmp": "^0.2.4", - "yaml": "^2.2.2" - }, - "bin": { - "patch-package": "index.js" - }, - "engines": { - "node": ">=14", - "npm": ">5" - } - }, - "node_modules/patch-package/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/patch-package/node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/patch-package/node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -14955,14 +14795,6 @@ "node": ">= 0.4" } }, - "node_modules/postinstall-postinstall": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", - "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", - "dev": true, - "hasInstallScript": true, - "license": "MIT" - }, "node_modules/prebuild-install": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", @@ -17278,16 +17110,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.14" - } - }, "node_modules/to-buffer": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.2.tgz", @@ -17702,16 +17524,6 @@ "dev": true, "license": "ISC" }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/unlimited-timeout": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unlimited-timeout/-/unlimited-timeout-0.1.0.tgz", @@ -18265,22 +18077,6 @@ "version": "4.0.0", "license": "ISC" }, - "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, "node_modules/yargs": { "version": "17.7.2", "license": "MIT", diff --git a/package.json b/package.json index 72a7d9ce8..975d2ebc1 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:request:rate": "npm run test:k6-common && k6 run -e RATE=true \"./dist/test/performance/perf_test.js\"", "release": "release-it --non-interactive", "changelog": "auto-changelog -p", - "postinstall": "patch-package" + "postinstall": "python3 scripts/fix-libp2p-http-utils.py" }, "dependencies": { "@chainsafe/libp2p-noise": "^17.0.0", @@ -127,8 +127,6 @@ "eslint-plugin-promise": "^6.1.1", "mocha": "^11.1.0", "nyc": "^17.1.0", - "patch-package": "^8.0.1", - "postinstall-postinstall": "^2.1.0", "prettier": "^3.7.4", "release-it": "^19.0.6", "sinon": "^19.0.2", diff --git a/patches/@libp2p+http-utils+2.0.1.patch b/patches/@libp2p+http-utils+2.0.1.patch deleted file mode 100644 index ef52b3299..000000000 --- a/patches/@libp2p+http-utils+2.0.1.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/node_modules/@libp2p/http-utils/dist/src/index.js b/node_modules/@libp2p/http-utils/dist/src/index.js -index f1f98d5..2ad6be6 100644 ---- a/node_modules/@libp2p/http-utils/dist/src/index.js -+++ b/node_modules/@libp2p/http-utils/dist/src/index.js -@@ -213,7 +213,7 @@ export function getHost(addresses, headers) { - let protocol = 'http:'; - if (addresses instanceof URL) { - host = addresses.hostname; -- port = parseInt(addresses.port, 10); -+ port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10); - protocol = addresses.protocol; - } - if (!isValidHost(host)) { -diff --git a/node_modules/@libp2p/http-utils/src/index.ts b/node_modules/@libp2p/http-utils/src/index.ts -index 5a73139..a5e0dc5 100644 ---- a/node_modules/@libp2p/http-utils/src/index.ts -+++ b/node_modules/@libp2p/http-utils/src/index.ts -@@ -301,7 +301,7 @@ export function getHost (addresses: URL | Multiaddr[], headers: Headers): string - - if (addresses instanceof URL) { - host = addresses.hostname -- port = parseInt(addresses.port, 10) -+ port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10) - protocol = addresses.protocol - } - diff --git a/scripts/fix-libp2p-http-utils.py b/scripts/fix-libp2p-http-utils.py new file mode 100755 index 000000000..e5468af54 --- /dev/null +++ b/scripts/fix-libp2p-http-utils.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +import os +import sys +from pathlib import Path + +SCRIPT_DIR = Path(__file__).parent +PROJECT_ROOT = SCRIPT_DIR.parent +TARGET_FILE = PROJECT_ROOT / "node_modules/@libp2p/http-utils/dist/src/index.js" + +def fix_http_utils(): + if not TARGET_FILE.exists(): + print("⚠️ @libp2p/http-utils not found, skipping patch") + print(f" Expected: {TARGET_FILE}") + return 0 + + try: + with open(TARGET_FILE, 'r', encoding='utf-8') as f: + content = f.read() + except Exception as e: + print(f"❌ Error reading file: {e}") + return 1 + + # Check if already fixed + if "addresses.port === '' ?" in content: + print("✅ @libp2p/http-utils already patched") + return 0 + + old_pattern = "port = parseInt(addresses.port, 10);" + new_pattern = "port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10);" + + if old_pattern not in content: + print("⚠️ @libp2p/http-utils: Pattern not found, file may have changed") + print(f" Looking for: {old_pattern}") + return 0 + + fixed_content = content.replace(old_pattern, new_pattern) + + if fixed_content == content: + print("⚠️ @libp2p/http-utils: No changes made") + return 0 + + try: + with open(TARGET_FILE, 'w', encoding='utf-8') as f: + f.write(fixed_content) + print("✅ Successfully patched @libp2p/http-utils") + return 0 + except Exception as e: + print(f"❌ Error writing file: {e}") + return 1 + +if __name__ == "__main__": + sys.exit(fix_http_utils()) From a3e3968a772c334486ab3a8242a1da4e3447c06d Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 17:10:15 +0200 Subject: [PATCH 13/20] use node script --- package.json | 4 +-- scripts/fix-libp2p-http-utils.js | 34 +++++++++++++++++++++ scripts/fix-libp2p-http-utils.py | 52 -------------------------------- 3 files changed, 36 insertions(+), 54 deletions(-) create mode 100755 scripts/fix-libp2p-http-utils.js delete mode 100755 scripts/fix-libp2p-http-utils.py diff --git a/package.json b/package.json index 975d2ebc1..9fd8542ce 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:request:rate": "npm run test:k6-common && k6 run -e RATE=true \"./dist/test/performance/perf_test.js\"", "release": "release-it --non-interactive", "changelog": "auto-changelog -p", - "postinstall": "python3 scripts/fix-libp2p-http-utils.py" + "postinstall": "node scripts/fix-libp2p-http-utils.js" }, "dependencies": { "@chainsafe/libp2p-noise": "^17.0.0", @@ -162,4 +162,4 @@ "publish": false } } -} +} \ No newline at end of file diff --git a/scripts/fix-libp2p-http-utils.js b/scripts/fix-libp2p-http-utils.js new file mode 100755 index 000000000..972b92a3e --- /dev/null +++ b/scripts/fix-libp2p-http-utils.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node +import { readFileSync, writeFileSync } from 'fs' +import { join, dirname } from 'path' +import { fileURLToPath } from 'url' + +const file = join( + dirname(fileURLToPath(import.meta.url)), + '..', + 'node_modules/@libp2p/http-utils/dist/src/index.js' +) + +try { + let content = readFileSync(file, 'utf8') + + if (content.includes("addresses.port === '' ?")) { + console.log('✅ Already patched') + process.exit(0) + } + + content = content.replace( + 'port = parseInt(addresses.port, 10);', + "port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10);" + ) + + writeFileSync(file, content, 'utf8') + console.log('✅ Patched @libp2p/http-utils') +} catch (error) { + if (error.code === 'ENOENT') { + console.log('⚠️ Package not found, skipping') + process.exit(0) + } + console.error('❌ Error:', error.message) + process.exit(1) +} diff --git a/scripts/fix-libp2p-http-utils.py b/scripts/fix-libp2p-http-utils.py deleted file mode 100755 index e5468af54..000000000 --- a/scripts/fix-libp2p-http-utils.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -import os -import sys -from pathlib import Path - -SCRIPT_DIR = Path(__file__).parent -PROJECT_ROOT = SCRIPT_DIR.parent -TARGET_FILE = PROJECT_ROOT / "node_modules/@libp2p/http-utils/dist/src/index.js" - -def fix_http_utils(): - if not TARGET_FILE.exists(): - print("⚠️ @libp2p/http-utils not found, skipping patch") - print(f" Expected: {TARGET_FILE}") - return 0 - - try: - with open(TARGET_FILE, 'r', encoding='utf-8') as f: - content = f.read() - except Exception as e: - print(f"❌ Error reading file: {e}") - return 1 - - # Check if already fixed - if "addresses.port === '' ?" in content: - print("✅ @libp2p/http-utils already patched") - return 0 - - old_pattern = "port = parseInt(addresses.port, 10);" - new_pattern = "port = parseInt(addresses.port === '' ? (addresses.protocol === 'https:' ? '443' : '80') : addresses.port, 10);" - - if old_pattern not in content: - print("⚠️ @libp2p/http-utils: Pattern not found, file may have changed") - print(f" Looking for: {old_pattern}") - return 0 - - fixed_content = content.replace(old_pattern, new_pattern) - - if fixed_content == content: - print("⚠️ @libp2p/http-utils: No changes made") - return 0 - - try: - with open(TARGET_FILE, 'w', encoding='utf-8') as f: - f.write(fixed_content) - print("✅ Successfully patched @libp2p/http-utils") - return 0 - except Exception as e: - print(f"❌ Error writing file: {e}") - return 1 - -if __name__ == "__main__": - sys.exit(fix_http_utils()) From 56ad9cb3ea5f00efb30252b9d3d9787e8824f9b9 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Thu, 15 Jan 2026 17:19:05 +0200 Subject: [PATCH 14/20] copy scripts --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f37bc3678..a146f3dd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ ENV ARWEAVE_GATEWAY='https://arweave.net/' FROM base AS builder COPY package*.json /usr/src/app/ +COPY scripts/ /usr/src/app/scripts/ WORKDIR /usr/src/app/ RUN npm ci --maxsockets 1 From d5a466493f2c97ba250b1a323bdadcc38bcf3954 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Mon, 19 Jan 2026 11:08:53 +0200 Subject: [PATCH 15/20] do not filter --- src/components/P2P/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 937b127f4..7628797f4 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -318,15 +318,15 @@ export class OceanP2P extends EventEmitter { ) { addresses = { listen: bindInterfaces, - announceFilter: (multiaddrs: any[]) => - multiaddrs.filter((m) => this.shouldAnnounce(m)), + // announceFilter: (multiaddrs: any[]) => + // multiaddrs.filter((m) => this.shouldAnnounce(m)), appendAnnounce: config.p2pConfig.announceAddresses } } else { addresses = { listen: bindInterfaces, - announceFilter: (multiaddrs: any[]) => - multiaddrs.filter((m) => this.shouldAnnounce(m)) + // announceFilter: (multiaddrs: any[]) => + // multiaddrs.filter((m) => this.shouldAnnounce(m)) } } const dhtOptions = { From 0752e791ab69bf0c47d281dec0196adf95398c28 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Mon, 19 Jan 2026 11:27:20 +0200 Subject: [PATCH 16/20] bind all --- src/components/P2P/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 7628797f4..ada8418d0 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -287,7 +287,10 @@ export class OceanP2P extends EventEmitter { this._privateKey = config.keys.privateKey.raw /** @type {import('libp2p').Libp2pOptions} */ // start with some default, overwrite based on config later - const bindInterfaces = [] + const bindInterfaces = [ + '/ip4/0.0.0.0/tcp/0/ws', + '/ip6/::/tcp/0/ws' + ] if (config.p2pConfig.enableIPV4) { P2P_LOGGER.info('Binding P2P sockets to IPV4') bindInterfaces.push( @@ -690,7 +693,7 @@ export class OceanP2P extends EventEmitter { useNetwork: true }) return data - } catch (e) {} + } catch (e) { } return null } @@ -774,7 +777,7 @@ export class OceanP2P extends EventEmitter { P2P_LOGGER.error(`P2P communication error: ${err.message}`) try { stream.abort(err as Error) - } catch {} + } catch { } return { status: { httpStatus: 500, error: `P2P error: ${err.message}` } } } } From fd02ea5f1e87227317c8f495a02a4465f93091a4 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Mon, 19 Jan 2026 11:47:10 +0200 Subject: [PATCH 17/20] Revert "bind all" This reverts commit 0752e791ab69bf0c47d281dec0196adf95398c28. --- src/components/P2P/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index ada8418d0..7628797f4 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -287,10 +287,7 @@ export class OceanP2P extends EventEmitter { this._privateKey = config.keys.privateKey.raw /** @type {import('libp2p').Libp2pOptions} */ // start with some default, overwrite based on config later - const bindInterfaces = [ - '/ip4/0.0.0.0/tcp/0/ws', - '/ip6/::/tcp/0/ws' - ] + const bindInterfaces = [] if (config.p2pConfig.enableIPV4) { P2P_LOGGER.info('Binding P2P sockets to IPV4') bindInterfaces.push( @@ -693,7 +690,7 @@ export class OceanP2P extends EventEmitter { useNetwork: true }) return data - } catch (e) { } + } catch (e) {} return null } @@ -777,7 +774,7 @@ export class OceanP2P extends EventEmitter { P2P_LOGGER.error(`P2P communication error: ${err.message}`) try { stream.abort(err as Error) - } catch { } + } catch {} return { status: { httpStatus: 500, error: `P2P error: ${err.message}` } } } } From 138554d7cb98134d17bf2151f7b96657ce050e42 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Mon, 19 Jan 2026 17:12:33 +0200 Subject: [PATCH 18/20] add tls transport --- package-lock.json | 84 +++++++++++++++++++++++++++++++++++-- package.json | 1 + src/components/P2P/index.ts | 4 +- 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8033daab..4c959ed59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@libp2p/pubsub": "^10.1.18", "@libp2p/pubsub-peer-discovery": "^12.0.0", "@libp2p/tcp": "^11.0.9", + "@libp2p/tls": "^3.0.10", "@libp2p/upnp-nat": "^4.0.9", "@libp2p/websockets": "^10.1.2", "@multiformats/multiaddr": "^12.2.3", @@ -4062,6 +4063,42 @@ "multiformats": "^13.0.0" } }, + "node_modules/@libp2p/tls": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@libp2p/tls/-/tls-3.0.10.tgz", + "integrity": "sha512-O/e/kEzXZPgHb1asyN1P4hCcECQnFEiGAQCgjkKU/nTjHYCvWG0CAU5uJuJkj9RXLpDFPVZ38FMN3dSzx0Ny7Q==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "@libp2p/crypto": "^5.1.13", + "@libp2p/interface": "^3.1.0", + "@libp2p/peer-id": "^6.0.4", + "@libp2p/utils": "^7.0.10", + "@peculiar/asn1-schema": "^2.4.0", + "@peculiar/asn1-x509": "^2.4.0", + "@peculiar/webcrypto": "^1.5.0", + "@peculiar/x509": "^1.13.0", + "asn1js": "^3.0.6", + "p-event": "^7.0.0", + "protons-runtime": "^5.6.0", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" + } + }, + "node_modules/@libp2p/tls/node_modules/multiformats": { + "version": "13.4.2", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.4.2.tgz", + "integrity": "sha512-eh6eHCrRi1+POZ3dA+Dq1C6jhP1GNtr9CRINMb67OKzqW9I5DUuZM/3jLPlzhgpGeiNUlEGEbkCYChXMCc/8DQ==", + "license": "Apache-2.0 OR MIT" + }, + "node_modules/@libp2p/tls/node_modules/uint8arrays": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.1.0.tgz", + "integrity": "sha512-vA6nFepEmlSKkMBnLBaUMVvAC4G3CTmO58C12y4sq6WPDOR7mOFYOi7GlrQ4djeSbP6JG9Pv9tJDM97PedRSww==", + "license": "Apache-2.0 OR MIT", + "dependencies": { + "multiformats": "^13.0.0" + } + }, "node_modules/@libp2p/upnp-nat": { "version": "4.0.9", "resolved": "https://registry.npmjs.org/@libp2p/upnp-nat/-/upnp-nat-4.0.9.tgz", @@ -4108,9 +4145,9 @@ } }, "node_modules/@libp2p/utils": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-7.0.9.tgz", - "integrity": "sha512-2wYhsgfbFXfh5ui0ME9MNHc7uUIuZwpeZ/yagKmDSjIP7B+L3/9mj+vVXO14AhmjfwnKx2xUDQvzGZeq5to4ow==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-7.0.10.tgz", + "integrity": "sha512-+mzD+7yLMoZ8+34y/iS9d1CnwHjJJ/qEsao9FckHf9T9tnVXEyLLu9TpzBCcGRm4fUK/QCSHK2AcZH50kkAFkw==", "license": "Apache-2.0 OR MIT", "dependencies": { "@chainsafe/is-ip": "^2.1.0", @@ -5051,6 +5088,34 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@peculiar/webcrypto": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.5.0.tgz", + "integrity": "sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.3.8", + "@peculiar/json-schema": "^1.1.12", + "pvtsutils": "^1.3.5", + "tslib": "^2.6.2", + "webcrypto-core": "^1.8.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/@peculiar/x509": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz", @@ -17812,6 +17877,19 @@ "node": ">= 8" } }, + "node_modules/webcrypto-core": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.8.1.tgz", + "integrity": "sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A==", + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.3.13", + "@peculiar/json-schema": "^1.1.12", + "asn1js": "^3.0.5", + "pvtsutils": "^1.3.5", + "tslib": "^2.7.0" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "license": "BSD-2-Clause" diff --git a/package.json b/package.json index bb2fbd4c5..7f106049b 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@libp2p/pubsub": "^10.1.18", "@libp2p/pubsub-peer-discovery": "^12.0.0", "@libp2p/tcp": "^11.0.9", + "@libp2p/tls": "^3.0.10", "@libp2p/upnp-nat": "^4.0.9", "@libp2p/websockets": "^10.1.2", "@multiformats/multiaddr": "^12.2.3", diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 1aafc73eb..4d37bce6b 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -53,6 +53,7 @@ const store = new LevelDatastore('./databases/p2p-store') import { autoTLS } from '@ipshipyard/libp2p-auto-tls' import { keychain } from '@libp2p/keychain' import { http } from '@libp2p/http' +import { tls } from '@libp2p/tls' const DEFAULT_OPTIONS = { pollInterval: 1000 @@ -408,7 +409,8 @@ export class OceanP2P extends EventEmitter { transports, streamMuxers: [yamux()], connectionEncrypters: [ - noise() + noise(), + tls() // plaintext() ], services: servicesConfig, From 4f4fe66a4e9c863eab9602d7a26d432fa8fe5e07 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 20 Jan 2026 16:33:10 +0200 Subject: [PATCH 19/20] lint fix and filter announce --- src/components/P2P/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 4d37bce6b..45b5cd012 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -47,13 +47,13 @@ import { P2P_LOGGER } from '../../utils/logging/common.js' import { CoreHandlersRegistry } from '../core/handler/coreHandlersRegistry' import { Multiaddr, multiaddr } from '@multiformats/multiaddr' import { LevelDatastore } from 'datastore-level' -const store = new LevelDatastore('./databases/p2p-store') // import { getIPv4, getIPv6 } from '../../utils/ip.js' import { autoTLS } from '@ipshipyard/libp2p-auto-tls' import { keychain } from '@libp2p/keychain' import { http } from '@libp2p/http' import { tls } from '@libp2p/tls' +const store = new LevelDatastore('./databases/p2p-store') const DEFAULT_OPTIONS = { pollInterval: 1000 @@ -322,15 +322,15 @@ export class OceanP2P extends EventEmitter { ) { addresses = { listen: bindInterfaces, - // announceFilter: (multiaddrs: any[]) => - // multiaddrs.filter((m) => this.shouldAnnounce(m)), + announceFilter: (multiaddrs: any[]) => + multiaddrs.filter((m) => this.shouldAnnounce(m)), appendAnnounce: config.p2pConfig.announceAddresses } } else { addresses = { listen: bindInterfaces, - // announceFilter: (multiaddrs: any[]) => - // multiaddrs.filter((m) => this.shouldAnnounce(m)) + announceFilter: (multiaddrs: any[]) => + multiaddrs.filter((m) => this.shouldAnnounce(m)) } } const dhtOptions = { From 1b8144109b3e7eddd7bf9f9966572ec55c332b94 Mon Sep 17 00:00:00 2001 From: giurgiur99 Date: Tue, 20 Jan 2026 17:22:24 +0200 Subject: [PATCH 20/20] add comment --- src/components/P2P/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/P2P/index.ts b/src/components/P2P/index.ts index 45b5cd012..338ebff1f 100644 --- a/src/components/P2P/index.ts +++ b/src/components/P2P/index.ts @@ -368,6 +368,9 @@ export class OceanP2P extends EventEmitter { dcutr: dcutr(), keychain: keychain(), http: http(), + // Always announe the public address and tls in P2P_ANNOUNCE_ADDRESSES / p2pConfig.announceAddresses. + // Ex. /ip4//tcp//tls/ws + // Ex. /ip4//tcp//tls/wss autoTLS: autoTLS({ autoConfirmAddress: true })