From a1aea637c0f3efdf73c8b5fb3d06c571f8d6dad4 Mon Sep 17 00:00:00 2001 From: Oak Date: Tue, 2 Jul 2024 02:31:29 +0100 Subject: [PATCH] fix: p2p connection between browsers (#28) --- examples/canvas/webpack.config.js | 3 + examples/canvas/yarn.lock | 536 ++++++++++++------------------ packages/network/package.json | 1 + packages/network/src/node.ts | 34 +- packages/network/src/relay.ts | 7 +- packages/node/package.json | 1 + yarn.lock | 15 + 7 files changed, 273 insertions(+), 324 deletions(-) diff --git a/examples/canvas/webpack.config.js b/examples/canvas/webpack.config.js index d15d89b4..46ac5e36 100644 --- a/examples/canvas/webpack.config.js +++ b/examples/canvas/webpack.config.js @@ -7,6 +7,9 @@ module.exports = { entry: path.resolve(__dirname, "./src/index.ts"), devServer: { allowedHosts: "all", + client: { + overlay: false, + }, static: { directory: path.join(__dirname, "public"), }, diff --git a/examples/canvas/yarn.lock b/examples/canvas/yarn.lock index 11351060..08992306 100644 --- a/examples/canvas/yarn.lock +++ b/examples/canvas/yarn.lock @@ -18,12 +18,12 @@ integrity sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA== "@chainsafe/libp2p-gossipsub@^13.0.0": - version "13.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-13.0.0.tgz#b1dfa5c2d455d77ab8dfc97f5eb8961861bb623e" - integrity sha512-2q+v429uZjMl6N3d+j9QCMj8YO0aiYvLSN1t0aTdpMXQHCHLJaaT9PtNn845B1Li7/uZjYESmikgVt8r7keH0w== + version "13.1.0" + resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-gossipsub/-/libp2p-gossipsub-13.1.0.tgz#b0c2d84c334dc1bcbd67cb379c7f0a0feca6a4c1" + integrity sha512-Wk1O6ZT/L0o+p9vlAB4qxDa9pAwTh5yxPrQbyc98wvKbrnPhAfZbjMfhCBOEvFKzMkEFDsTd3TGPjP8TTtNtQw== dependencies: "@libp2p/crypto" "^4.0.1" - "@libp2p/interface" "^1.1.2" + "@libp2p/interface" "^1.5.0" "@libp2p/interface-internal" "^1.0.7" "@libp2p/peer-id" "^4.0.5" "@libp2p/pubsub" "^9.0.8" @@ -38,16 +38,16 @@ uint8arrays "^5.0.1" "@chainsafe/libp2p-noise@^15.0.0": - version "15.0.0" - resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-noise/-/libp2p-noise-15.0.0.tgz#c3f38a31d03d96b475f7e35b592a22f5fe9269a0" - integrity sha512-O8Y/WVU4J/qrnG72jwVhbmdXiBzv1dT9B3PMClCRmZ9z/5vVPEGRVXE/SVYeGF3bNuBTLoh+F+GaKG/9UHlMhg== + version "15.1.0" + resolved "https://registry.yarnpkg.com/@chainsafe/libp2p-noise/-/libp2p-noise-15.1.0.tgz#f30caa146d3d11c6dfd6da3c4510b664f8b0881c" + integrity sha512-84S/Uk7ZZRYpSlE5d1odMmQTl5g5Da8etgcf4QI7arTAHkvBs3il7yGHIPt4wV4EV0qIMG+XjdGIYihRXfI2/w== dependencies: "@chainsafe/as-chacha20poly1305" "^0.1.0" "@chainsafe/as-sha256" "^0.4.1" "@libp2p/crypto" "^4.0.0" - "@libp2p/interface" "^1.0.0" + "@libp2p/interface" "^1.5.0" "@libp2p/peer-id" "^4.0.0" - "@noble/ciphers" "^0.4.0" + "@noble/ciphers" "^0.5.1" "@noble/curves" "^1.1.0" "@noble/hashes" "^1.3.1" it-length-prefixed "^9.0.1" @@ -206,16 +206,16 @@ "@multiformats/multiaddr" "^12.2.3" "@libp2p/circuit-relay-v2@^1.0.24": - version "1.0.24" - resolved "https://registry.yarnpkg.com/@libp2p/circuit-relay-v2/-/circuit-relay-v2-1.0.24.tgz#77445964d4a151788567eccdfd2bb52bc2704641" - integrity sha512-Q+1/RjwSu5MYICaaZ5haa5HouASEZ41Lef4qz9ckk9KPW7UPUpQZIFWiDCLiokX9L1RKr/3uk54vbG19bIyOAw== - dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/interface-internal" "^1.2.2" - "@libp2p/peer-collections" "^5.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/peer-record" "^7.0.18" - "@libp2p/utils" "^5.4.2" + version "1.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/circuit-relay-v2/-/circuit-relay-v2-1.1.0.tgz#b4b472c0cf9932e63f5676c7c235a13f90e2fd6b" + integrity sha512-6VQTUA+eyxVXeSn8aCbEsZHptEgh2MU533LIXHhW9vWW36QqCYeTbDib1rb5EieSmG+NF/rYkRXEgzcT+Z9TKg== + dependencies: + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/peer-collections" "^5.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/peer-record" "^7.0.20" + "@libp2p/utils" "^5.4.4" "@multiformats/mafmt" "^12.1.6" "@multiformats/multiaddr" "^12.2.3" any-signal "^4.1.1" @@ -223,17 +223,17 @@ it-stream-types "^2.0.1" multiformats "^13.1.0" p-defer "^4.0.1" - p-retry "^6.2.0" protons-runtime "^5.4.0" + race-signal "^1.0.2" uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/crypto@^4.0.0", "@libp2p/crypto@^4.0.1", "@libp2p/crypto@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-4.1.2.tgz#10981aad6fdd2259db9b6202914ba9b74b7382da" - integrity sha512-mlCbqF/HLLBTp3DtQ6pL02BTE+/Jqujq15yG2bEf+3ai7HU7DpgQlh9i76rQIuEgJ1tMI2c87xqSTyz7uhBqEQ== +"@libp2p/crypto@^4.0.0", "@libp2p/crypto@^4.0.1", "@libp2p/crypto@^4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-4.1.4.tgz#0f88d34d0186e68a9545dc512aed2dd9193beb83" + integrity sha512-xiKIAAsh5xFo1KiO8bfDu1V5g73jtxwYV36Jp6qvSA6538UuUn8sGpO4IMINjmtSnC/DSx6hyu1MnJU1BMbDDA== dependencies: - "@libp2p/interface" "^1.4.0" + "@libp2p/interface" "^1.5.0" "@noble/curves" "^1.4.0" "@noble/hashes" "^1.4.0" asn1js "^3.0.5" @@ -242,29 +242,30 @@ uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/crypto@^4.1.4": - version "4.1.4" - resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-4.1.4.tgz#0f88d34d0186e68a9545dc512aed2dd9193beb83" - integrity sha512-xiKIAAsh5xFo1KiO8bfDu1V5g73jtxwYV36Jp6qvSA6538UuUn8sGpO4IMINjmtSnC/DSx6hyu1MnJU1BMbDDA== +"@libp2p/dcutr@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/dcutr/-/dcutr-1.1.0.tgz#0a73881361bb265ad6b43f0acffb5b41158fdb4d" + integrity sha512-C8tBevJxb6D8c8Qb2N14/nzSGJY84MyTwzAhf8cwKp7Um17RouTljUJEOakk+TRCp/UrPx3tbbVDOb2cmUR1Tg== dependencies: "@libp2p/interface" "^1.5.0" - "@noble/curves" "^1.4.0" - "@noble/hashes" "^1.4.0" - asn1js "^3.0.5" - multiformats "^13.1.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/utils" "^5.4.4" + "@multiformats/multiaddr" "^12.2.3" + "@multiformats/multiaddr-matcher" "^1.2.1" + delay "^6.0.0" + it-protobuf-stream "^1.1.3" protons-runtime "^5.4.0" uint8arraylist "^2.4.8" - uint8arrays "^5.1.0" "@libp2p/identify@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@libp2p/identify/-/identify-2.0.2.tgz#a11c566dbbcdfda15a1e3762e6b8e88188c4f48b" - integrity sha512-5KGfZ9JNbvog8CCGabrYcK4uW+bSozaQ6jDXfl+jBlnjAkEjv9vEF8sUrk079diJO5m5bv96CJTt4enAkgSl9A== + version "2.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/identify/-/identify-2.1.0.tgz#663daa8e1f541326630655a8bd52aba015797017" + integrity sha512-aHaMNNFxG1w/CNsTXaYaY/MkwKe4Y4Rtea7Npsnrtj5Ka7/TM6Xg9ZsYoaKtL13MZriKPCRatvU59qxNYzNtQQ== dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/interface-internal" "^1.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/peer-record" "^7.0.18" + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/peer-record" "^7.0.20" "@multiformats/multiaddr" "^12.2.3" "@multiformats/multiaddr-matcher" "^1.2.1" it-drain "^3.0.7" @@ -286,17 +287,7 @@ it-stream-types "^2.0.1" uint8arraylist "^2.4.3" -"@libp2p/interface-internal@^1.0.1", "@libp2p/interface-internal@^1.0.7", "@libp2p/interface-internal@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@libp2p/interface-internal/-/interface-internal-1.2.2.tgz#bd254ade1d21d0cf78345fb5fc7e8b0e676d6ccf" - integrity sha512-JoQeYf7MhBEuBBiLgDFrBLddzxzc6pjqeorIaClPu82meL3/k3PwEReiH2zMat31hVC5wdNMvDK8fG/oMzOmQQ== - dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/peer-collections" "^5.2.2" - "@multiformats/multiaddr" "^12.2.3" - uint8arraylist "^2.4.8" - -"@libp2p/interface-internal@^1.2.4": +"@libp2p/interface-internal@^1.0.1", "@libp2p/interface-internal@^1.0.7", "@libp2p/interface-internal@^1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@libp2p/interface-internal/-/interface-internal-1.2.4.tgz#7471042558f125c8848bd00db43bcd7ccc71aff4" integrity sha512-bleC1yDl3wju8qerL9uLIw8xBkzwPCr5XdOsby8PYW6XktqSCXmjkrHQ4iZuPwC4IqLPT01sgy/glxCBxQyHCQ== @@ -324,19 +315,7 @@ it-pushable "^3.1.3" uint8arraylist "^2.4.3" -"@libp2p/interface@^1.0.0", "@libp2p/interface@^1.0.1", "@libp2p/interface@^1.1.2", "@libp2p/interface@^1.1.3", "@libp2p/interface@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-1.4.0.tgz#19066f29c21e6ad0d7237997f13f785e3a4fd056" - integrity sha512-XkbZ0NfLVnxvWgo1nVyMwCUYDQbFYFvYPA6KUPLV7/XgcxBapVZT5sJ9hgQ4kTsqSBbjQl6YDXDxCclAPZDNTQ== - dependencies: - "@multiformats/multiaddr" "^12.2.3" - it-pushable "^3.2.3" - it-stream-types "^2.0.1" - multiformats "^13.1.0" - progress-events "^1.0.0" - uint8arraylist "^2.4.8" - -"@libp2p/interface@^1.5.0": +"@libp2p/interface@^1.0.0", "@libp2p/interface@^1.0.1", "@libp2p/interface@^1.1.3", "@libp2p/interface@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-1.5.0.tgz#306197f30a43d966dcda71a2522877e7d6fc6506" integrity sha512-SivVvZ+7r7Vgnv+Y88nGZTpG449PYZAPgfLhVqTXn6T4NAFt47InzC7UMFnVqSQuT21YmI9DoeaVXH73CsHNrg== @@ -353,18 +332,7 @@ resolved "https://registry.yarnpkg.com/@libp2p/interfaces/-/interfaces-3.3.2.tgz#5d8079be845b0960939b5b18880e785a4714465a" integrity sha512-p/M7plbrxLzuQchvNwww1Was7ZeGE2NaOFulMaZBYIihU8z3fhaV+a033OqnC/0NTX/yhfdNOG7znhYq3XoR/g== -"@libp2p/logger@^4.0.13", "@libp2p/logger@^4.0.6": - version "4.0.13" - resolved "https://registry.yarnpkg.com/@libp2p/logger/-/logger-4.0.13.tgz#9a32d933c79be8854726a1d3c69d95ed69e1f677" - integrity sha512-z1i4Ksdr4cl96Y+VwJdhdNUkwP7189oTn0AQrAQc9WnLKqRUGXWwDf2OgdpJbPU71KteZT3UXLRQGWzXKCt2Wg== - dependencies: - "@libp2p/interface" "^1.4.0" - "@multiformats/multiaddr" "^12.2.3" - debug "^4.3.4" - interface-datastore "^8.2.11" - multiformats "^13.1.0" - -"@libp2p/logger@^4.0.15": +"@libp2p/logger@^4.0.15", "@libp2p/logger@^4.0.6": version "4.0.15" resolved "https://registry.yarnpkg.com/@libp2p/logger/-/logger-4.0.15.tgz#f55cc052dc71c98c15fa13c6f12496043eae6eb9" integrity sha512-Xi8Ud5EOtJE5gRp9EUBbtJpNqh39+J5WUZJ05fiQUwv8Q3r5xbXYnff2cOXKDVpY8c71cg+nfQNqRRqKDyu3jQ== @@ -375,12 +343,12 @@ interface-datastore "^8.2.11" multiformats "^13.1.0" -"@libp2p/multistream-select@^5.1.10": - version "5.1.10" - resolved "https://registry.yarnpkg.com/@libp2p/multistream-select/-/multistream-select-5.1.10.tgz#39e31f0f8c20d337b3d48cef405ea36633c21dbe" - integrity sha512-jaAHwjAwuBhNzF/dYqxqsvWeBqVVN8Lm8pdJiyM954rU6OG2iiog8RTbxEjl54ngbBWojc5v3XEwMotLoQxwJg== +"@libp2p/multistream-select@^5.1.12": + version "5.1.12" + resolved "https://registry.yarnpkg.com/@libp2p/multistream-select/-/multistream-select-5.1.12.tgz#dd7f100567d74c36688bc6f3ef7851eca48fe2e8" + integrity sha512-s26oxTm30ZFDxlPNpmXlxN5+qau3o+OfuhTzcUZnLpPFn4czIlszFZjRA/l0zVaFdv/i4sa4G7FyCya1rvxbOQ== dependencies: - "@libp2p/interface" "^1.4.0" + "@libp2p/interface" "^1.5.0" it-length-prefixed "^9.0.4" it-length-prefixed-stream "^1.1.7" it-stream-types "^2.0.1" @@ -390,15 +358,6 @@ uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/peer-collections@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@libp2p/peer-collections/-/peer-collections-5.2.2.tgz#54ce9de477b1d4660ef6736e230e3e5a260c0bab" - integrity sha512-Etx4C5vo/46WY2FG5jpeAUl0DDJf6OlhSRGo2yZbGGIy3m861awm59ExCr9i2tvKxvLTRfhzlK82HXP+CFPWMQ== - dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/utils" "^5.4.2" - "@libp2p/peer-collections@^5.2.4": version "5.2.4" resolved "https://registry.yarnpkg.com/@libp2p/peer-collections/-/peer-collections-5.2.4.tgz#6b7986a2fef094c5867a8324d6b62675174245e4" @@ -408,28 +367,19 @@ "@libp2p/peer-id" "^4.1.4" "@libp2p/utils" "^5.4.4" -"@libp2p/peer-id-factory@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@libp2p/peer-id-factory/-/peer-id-factory-4.1.2.tgz#7c3d446898a9bd56a9e3c787453b5a813f95f88d" - integrity sha512-6IYa4m6n0YXYIVwYRpjPeXlt9+hhOVykj/AX7bK68XZUU68vaYDW0ZZJQCR90qi98y2MkJxWaBMwK0vngiMi6g== +"@libp2p/peer-id-factory@^4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@libp2p/peer-id-factory/-/peer-id-factory-4.1.4.tgz#603f676032159ad045df7248fa77cc53e901b9f9" + integrity sha512-9DibdM1adRyY2GSQmLNTVbJezCCU93tyQWJjHYGVTZp0+gcnDIPh7HQ+OGNHtcaebfeJxw8PrFul/hYKVk+JGQ== dependencies: - "@libp2p/crypto" "^4.1.2" - "@libp2p/interface" "^1.4.0" - "@libp2p/peer-id" "^4.1.2" + "@libp2p/crypto" "^4.1.4" + "@libp2p/interface" "^1.5.0" + "@libp2p/peer-id" "^4.1.4" protons-runtime "^5.4.0" uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/peer-id@^4.0.0", "@libp2p/peer-id@^4.0.1", "@libp2p/peer-id@^4.0.5", "@libp2p/peer-id@^4.1.2": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@libp2p/peer-id/-/peer-id-4.1.2.tgz#41f309087bf8a449f4ab7730f8bc21f7b5d4d461" - integrity sha512-kJmomQLUAbp6MazpAugjiOfEvzTG8aMfUoF4zmUU4b/8wA+fe8mpvPoPTvqgM13XuMB1QzG0SRF1ozQXoRxyWw== - dependencies: - "@libp2p/interface" "^1.4.0" - multiformats "^13.1.0" - uint8arrays "^5.1.0" - -"@libp2p/peer-id@^4.1.4": +"@libp2p/peer-id@^4.0.0", "@libp2p/peer-id@^4.0.1", "@libp2p/peer-id@^4.0.5", "@libp2p/peer-id@^4.1.4": version "4.1.4" resolved "https://registry.yarnpkg.com/@libp2p/peer-id/-/peer-id-4.1.4.tgz#bf9c09a93f7f61c1b7a98e04790da0a392fee452" integrity sha512-EZAhYrvE8PNR1ImmuXPzJuTeojDFjDTWsVIgNLyDgnqsT0hZJ0FX0K/NYQoCTg9hynrsiRrm99uhWVA45K42AA== @@ -438,30 +388,30 @@ multiformats "^13.1.0" uint8arrays "^5.1.0" -"@libp2p/peer-record@^7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@libp2p/peer-record/-/peer-record-7.0.18.tgz#397055c40000fd298758615a1766faad6ec1c025" - integrity sha512-b6Exe+r9T1Ruq6Zotxhi4+7AeK7u+NUkOa/8WIiMGa4vPFDQrDk4QaH6p/TwuPnJ7tfbxezHB6kOsr154SuBmQ== +"@libp2p/peer-record@^7.0.20": + version "7.0.20" + resolved "https://registry.yarnpkg.com/@libp2p/peer-record/-/peer-record-7.0.20.tgz#b6ce6b1d4f0cd25f5d512bb8d1b058b0f1cb1b16" + integrity sha512-CLHnXWqqfuH481fRDvbkFXUp6dYY6RKtrxil+aiFmrVxz926CLwjb1kKW2q9OcljVwqLSIoN5v7BGtjV+ksDBg== dependencies: - "@libp2p/crypto" "^4.1.2" - "@libp2p/interface" "^1.4.0" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/utils" "^5.4.2" + "@libp2p/crypto" "^4.1.4" + "@libp2p/interface" "^1.5.0" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/utils" "^5.4.4" "@multiformats/multiaddr" "^12.2.3" protons-runtime "^5.4.0" uint8-varint "^2.0.4" uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/peer-store@^10.0.19": - version "10.0.19" - resolved "https://registry.yarnpkg.com/@libp2p/peer-store/-/peer-store-10.0.19.tgz#ef332c6cd21682d7d18eb0817184625a3c83d5cc" - integrity sha512-5YNt4LiybysysdzjqPrxO0etLjqz4YlQTRDq4DcIllVH3yPbteYILBtfW8ts/QDZVyawrQg8Sk21ayb9H/nYcQ== +"@libp2p/peer-store@^10.1.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/peer-store/-/peer-store-10.1.0.tgz#7b96e9aeb38cd857739d675a2d186f358a3f0435" + integrity sha512-b3bKM7b6mudnTVu7CYwPt9Fy4i1Nx1LBFQOvnqFcZPnTgGAAetQzmTImdC/mmq3o6ms7bt6tPnq7RDLvWDgaiA== dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/peer-collections" "^5.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/peer-record" "^7.0.18" + "@libp2p/interface" "^1.5.0" + "@libp2p/peer-collections" "^5.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/peer-record" "^7.0.20" "@multiformats/multiaddr" "^12.2.3" interface-datastore "^8.2.11" it-all "^3.0.6" @@ -485,16 +435,16 @@ uint8arrays "^4.0.9" "@libp2p/pubsub@^9.0.8": - version "9.0.19" - resolved "https://registry.yarnpkg.com/@libp2p/pubsub/-/pubsub-9.0.19.tgz#18b04311246dc67cf0a1d689c4bcbda7644c846e" - integrity sha512-oIwitpk9Bq1Qna4HAAQy0uGWOc2Qlf1CUj4v51yrdcHo7e03hJYhgHZ+kEYgDC0QzsTrzfrvMCDvLxFiaw7O4Q== - dependencies: - "@libp2p/crypto" "^4.1.2" - "@libp2p/interface" "^1.4.0" - "@libp2p/interface-internal" "^1.2.2" - "@libp2p/peer-collections" "^5.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/utils" "^5.4.2" + version "9.0.21" + resolved "https://registry.yarnpkg.com/@libp2p/pubsub/-/pubsub-9.0.21.tgz#3ce96e7e8918f7cde9f81d19d7660a62a2768095" + integrity sha512-rNrMXfH0UQZqCSF6sACqqYMYDMLE4n1Ky+OKQdX2Ruw6fEU2IxBuW8MVZ0Xzj0NS2lavcBi8Hn6ouNsFIJT1MA== + dependencies: + "@libp2p/crypto" "^4.1.4" + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/peer-collections" "^5.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/utils" "^5.4.4" it-length-prefixed "^9.0.4" it-pipe "^3.0.1" it-pushable "^3.2.3" @@ -503,34 +453,7 @@ uint8arraylist "^2.4.8" uint8arrays "^5.1.0" -"@libp2p/utils@^5.2.5", "@libp2p/utils@^5.4.2": - version "5.4.2" - resolved "https://registry.yarnpkg.com/@libp2p/utils/-/utils-5.4.2.tgz#c781885f5b5b1642263512dd44b408cc1d881f92" - integrity sha512-UknYsWCHPWcKRZKLV4odxVXzNY5WysnneS7OY0/dmh4WPi/0WAe/kS4SdOPK4gyZAc3t/Scf+eVwSvvBdwIo3g== - dependencies: - "@chainsafe/is-ip" "^2.0.2" - "@libp2p/crypto" "^4.1.2" - "@libp2p/interface" "^1.4.0" - "@libp2p/logger" "^4.0.13" - "@multiformats/multiaddr" "^12.2.3" - "@multiformats/multiaddr-matcher" "^1.2.1" - "@sindresorhus/fnv1a" "^3.1.0" - "@types/murmurhash3js-revisited" "^3.0.3" - any-signal "^4.1.1" - delay "^6.0.0" - get-iterator "^2.0.1" - is-loopback-addr "^2.0.2" - it-pushable "^3.2.3" - it-stream-types "^2.0.1" - murmurhash3js-revisited "^3.0.0" - netmask "^2.0.2" - p-defer "^4.0.1" - race-event "^1.3.0" - race-signal "^1.0.2" - uint8arraylist "^2.4.8" - uint8arrays "^5.1.0" - -"@libp2p/utils@^5.4.4": +"@libp2p/utils@^5.2.5", "@libp2p/utils@^5.4.4": version "5.4.4" resolved "https://registry.yarnpkg.com/@libp2p/utils/-/utils-5.4.4.tgz#4e9a20b2b0322b45dba4018d5c8b9a735a93e2a5" integrity sha512-7hppKcVZ0smBTDMwIdEO7Lqn26f7XZFXSPLs4anxr0EQ1dpax8xWTiHU1cRk7cD3KpUXLGMaqYoz7ko+kj8oSw== @@ -558,15 +481,15 @@ uint8arrays "^5.1.0" "@libp2p/webrtc@^4.0.33": - version "4.0.33" - resolved "https://registry.yarnpkg.com/@libp2p/webrtc/-/webrtc-4.0.33.tgz#6548a8653f49174217be240af862f0c62419db29" - integrity sha512-vg+BYhP1u8HneC7LLRrNw/Cdtg/UsZnrSBA9gBwZYB7x4aTH7b4+Gp1UpTpUmE58q8nuorJX+oN96+LfTVhV7A== + version "4.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/webrtc/-/webrtc-4.1.0.tgz#d20a7de075dadde7619386c2ea771ec8d5d89d31" + integrity sha512-SZr8jSEqBNnULj/k6iP4xsTmP1wkWcmPgGxJfneHiNZhOwT9X60QQG8zbEwqXD4eyFhP46EdnBtovWYdzhfY4g== dependencies: "@chainsafe/libp2p-noise" "^15.0.0" - "@libp2p/interface" "^1.4.0" - "@libp2p/interface-internal" "^1.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/utils" "^5.4.2" + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/utils" "^5.4.4" "@multiformats/mafmt" "^12.1.6" "@multiformats/multiaddr" "^12.2.3" "@multiformats/multiaddr-matcher" "^1.2.1" @@ -588,12 +511,12 @@ uint8arrays "^5.1.0" "@libp2p/websockets@^8.0.24": - version "8.0.24" - resolved "https://registry.yarnpkg.com/@libp2p/websockets/-/websockets-8.0.24.tgz#74bf48030cdb221e7b5bdd2cef889758b9173a53" - integrity sha512-oOriMCYOq7s7S5zN7hutxMUkaIB4dyCxg12dqDRIUTSik26mJsEkF3nd7JNuKUSg+4sM7l0tL8UB0A54BtyhHA== + version "8.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/websockets/-/websockets-8.1.0.tgz#fb0ba5eb9f30a238f2ce9caaa263c6f45f095017" + integrity sha512-jUeCm7elT3wqMMyz5Zcafh2Wq3BLCrwRmOSE6ib//h0CeD7SNg4zPIjqL6RQR6xPIj3WFHIl/nUOe+HAVw/X8Q== dependencies: - "@libp2p/interface" "^1.4.0" - "@libp2p/utils" "^5.4.2" + "@libp2p/interface" "^1.5.0" + "@libp2p/utils" "^5.4.4" "@multiformats/mafmt" "^12.1.6" "@multiformats/multiaddr" "^12.2.3" "@multiformats/multiaddr-to-uri" "^10.0.1" @@ -646,35 +569,22 @@ "@multiformats/multiaddr" "^12.0.0" "@multiformats/multiaddr-matcher@^1.2.1": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.2.tgz#4865374f2d89a7ef5c83d3ab23b67d079f188599" - integrity sha512-/fVOHPT39Iyo/ZVLssXQWKjKLBGjBthvLkqDGPH1C8yi9Fy7nTcJeMaVK+jRrHTmFejG/BumQg3swFgiwV0jSA== + version "1.2.4" + resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-matcher/-/multiaddr-matcher-1.2.4.tgz#affb3c63b5cd83b44156be19583981651373ec2e" + integrity sha512-GgpqzQFL4Mj8t7cLNHC5nuYUuSm0kTtSUyYswiyWwTSUY3XwRAMx0UiFWQg+ETk0u+/IvFaHxfnyEoH3tasvwg== dependencies: "@chainsafe/is-ip" "^2.0.1" "@multiformats/multiaddr" "^12.0.0" multiformats "^13.0.0" "@multiformats/multiaddr-to-uri@^10.0.1": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-10.0.1.tgz#f26a480d35766e601cd02d48d148c7a4c6ff6e62" - integrity sha512-RtOBRJucMCzINPytvt1y7tJ2jr4aSKJmv3DF7/C515RJO9+nu9sZHdsk9vn251OtN8k21rAGlIHESt/BSJWAnQ== - dependencies: - "@multiformats/multiaddr" "^12.0.0" - -"@multiformats/multiaddr@^12.0.0", "@multiformats/multiaddr@^12.1.14", "@multiformats/multiaddr@^12.2.3": - version "12.2.3" - resolved "https://registry.yarnpkg.com/@multiformats/multiaddr/-/multiaddr-12.2.3.tgz#b669bb39fa6999f9a35d03471c702630771a624e" - integrity sha512-qUP24ZgYXnyZs0lpYBvPg8Jyn3KFOJFH3a3tAcupulYIVQpR+3/fbaAZp4dYUJxBIDTOfEIpvPKm0DOFxbCDKw== + version "10.1.0" + resolved "https://registry.yarnpkg.com/@multiformats/multiaddr-to-uri/-/multiaddr-to-uri-10.1.0.tgz#f52312cee11b6ad25997e743d9c575c44726c7d0" + integrity sha512-ZNwSAx3ssBWwd4y0LKrOsq9xG7LBHboQxnUdSduNc2fTh/NS1UjA2slgUy6KHxH5k9S2DSus0iU2CoyJyN0/pg== dependencies: - "@chainsafe/is-ip" "^2.0.1" - "@chainsafe/netmask" "^2.0.0" - "@libp2p/interface" "^1.0.0" - "@multiformats/dns" "^1.0.3" - multiformats "^13.0.0" - uint8-varint "^2.0.1" - uint8arrays "^5.0.0" + "@multiformats/multiaddr" "^12.3.0" -"@multiformats/multiaddr@^12.3.0": +"@multiformats/multiaddr@^12.0.0", "@multiformats/multiaddr@^12.1.14", "@multiformats/multiaddr@^12.2.3", "@multiformats/multiaddr@^12.3.0": version "12.3.0" resolved "https://registry.yarnpkg.com/@multiformats/multiaddr/-/multiaddr-12.3.0.tgz#b1422813446e5cdec4b0f6cba51f93239f390884" integrity sha512-JQ8Gc/jgucqqvEaDTFN/AvxlYDHEE7lgEWLMYW7hKZkWggER+GvG/tVxUgUxIP8M0vFpvEHKKHE0lKzyMsgi8Q== @@ -687,10 +597,10 @@ uint8-varint "^2.0.1" uint8arrays "^5.0.0" -"@noble/ciphers@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.4.1.tgz#977fc35f563a4ca315ebbc4cbb1f9b670bd54456" - integrity sha512-QCOA9cgf3Rc33owG0AYBB9wszz+Ul2kramWN8tXG44Gyciud/tbkEqvxRF/IpqQaBpRBNi9f4jdNxqB2CQCIXg== +"@noble/ciphers@^0.5.1": + version "0.5.3" + resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.5.3.tgz#48b536311587125e0d0c1535f73ec8375cd76b23" + integrity sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w== "@noble/curves@^1.1.0", "@noble/curves@^1.4.0": version "1.4.0" @@ -714,11 +624,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/fnv1a/-/fnv1a-3.1.0.tgz#f8e46597298f6fd4c12dc901cdd4e73beb4d24fa" integrity sha512-KV321z5m/0nuAg83W1dPLy85HpHDk7Sdi4fJbwvacWsEhAh+rZUW4ZfGcXmUIvjZg4ss2bcwNlRhJ7GBEUG08w== -"@topology-foundation/crdt@0.0.8", "@topology-foundation/crdt@file:../../packages/crdt": - version "0.0.8" +"@topology-foundation/crdt@0.0.10", "@topology-foundation/crdt@file:../../packages/crdt": + version "0.0.10" -"@topology-foundation/network@0.0.8", "@topology-foundation/network@file:../../packages/network": - version "0.0.8" +"@topology-foundation/network@0.0.10", "@topology-foundation/network@file:../../packages/network": + version "0.0.10" dependencies: "@chainsafe/libp2p-gossipsub" "^13.0.0" "@chainsafe/libp2p-noise" "^15.0.0" @@ -726,6 +636,7 @@ "@libp2p/autonat" "^1.0.0" "@libp2p/bootstrap" "^10.1.0" "@libp2p/circuit-relay-v2" "^1.0.24" + "@libp2p/dcutr" "^1.1.0" "@libp2p/identify" "^2.0.2" "@libp2p/interface-pubsub" "^4.0.1" "@libp2p/pubsub-peer-discovery" "^10.0.2" @@ -737,19 +648,20 @@ libp2p "^1.6.0" "@topology-foundation/node@file:../../packages/node": - version "0.0.8" + version "0.0.10" dependencies: - "@topology-foundation/crdt" "0.0.8" - "@topology-foundation/network" "0.0.8" - "@topology-foundation/object" "0.0.8" + "@libp2p/dcutr" "^1.1.0" + "@topology-foundation/crdt" "0.0.10" + "@topology-foundation/network" "0.0.10" + "@topology-foundation/object" "0.0.10" -"@topology-foundation/object@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@topology-foundation/object/-/object-0.0.8.tgz#39e57a7cee3c210b94c9a048da5befb0e6695e71" - integrity sha512-hlwqX2/IWuFVk29ssGUT/ZT6sED0r0At13TH3GnUGewijhnn0ZKriQEXr01BQurvm5pOXIJ8php1Jtafzg4RFA== +"@topology-foundation/object@0.0.10": + version "0.0.10" + resolved "https://registry.yarnpkg.com/@topology-foundation/object/-/object-0.0.10.tgz#04bb130d923b9c5a08d0222f05ce21b2c13c270d" + integrity sha512-XlvnBTIDV/00rdtJ/ZZXGNdw34flSI5SkjpAiw304RF62IiMGH/hEvdfw9A24rTjF2YmzZz0a94ExLxTDBkeTA== "@topology-foundation/object@file:../../packages/object": - version "0.0.8" + version "0.0.10" "@tsconfig/node10@^1.0.7": version "1.0.11" @@ -830,9 +742,9 @@ integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.33": - version "4.19.1" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.19.1.tgz#57d34698bb580720fd6e3c360d4b2fdef579b979" - integrity sha512-ej0phymbFLoCB26dbbq5PGScsf2JAJ4IJHjG10LalgUV36XKTmA4GdA+PVllKvRk0sEKt64X8975qFnkSi0hqA== + version "4.19.5" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz#218064e321126fcf9048d1ca25dd2465da55d9c6" + integrity sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg== dependencies: "@types/node" "*" "@types/qs" "*" @@ -884,9 +796,9 @@ "@types/node" "*" "@types/node@*", "@types/node@^20.11.16": - version "20.12.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.12.tgz#7cbecdf902085cec634fdb362172dfe12b8f2050" - integrity sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw== + version "20.14.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.9.tgz#12e8e765ab27f8c421a1820c99f5f313a933b420" + integrity sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg== dependencies: undici-types "~5.26.4" @@ -1097,20 +1009,22 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -acorn-import-assertions@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" - integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== acorn-walk@^8.1.1: - version "8.3.2" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" - integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + version "8.3.3" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" -acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.11.0, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2: + version "8.12.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.0.tgz#1627bfa2e058148036133b8d9b51a700663c294c" + integrity sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw== ajv-formats@^2.1.1: version "2.1.1" @@ -1142,9 +1056,9 @@ ajv@^6.12.5: uri-js "^4.2.2" ajv@^8.0.0, ajv@^8.9.0: - version "8.14.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.14.0.tgz#f514ddfd4756abb200e1704414963620a625ebbb" - integrity sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA== + version "8.16.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" + integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== dependencies: fast-deep-equal "^3.1.3" json-schema-traverse "^1.0.0" @@ -1359,14 +1273,14 @@ browserify-sign@^4.0.0: safe-buffer "^5.2.1" browserslist@^4.21.10: - version "4.23.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" - integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== + version "4.23.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== dependencies: - caniuse-lite "^1.0.30001587" - electron-to-chromium "^1.4.668" + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + update-browserslist-db "^1.0.16" buffer-from@^1.0.0: version "1.1.2" @@ -1422,10 +1336,10 @@ call-bind@^1.0.7: get-intrinsic "^1.2.4" set-function-length "^1.2.1" -caniuse-lite@^1.0.30001587: - version "1.0.30001625" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001625.tgz#ead1b155ea691d6a87938754d3cb119c24465b03" - integrity sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w== +caniuse-lite@^1.0.30001629: + version "1.0.30001639" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001639.tgz#972b3a6adeacdd8f46af5fc7f771e9639f6c1521" + integrity sha512-eFHflNTBIlFwP2AIKaYuBQN/apnUoKNhBdza8ZnW/h2di4LCZ4xFqYlxUxo+LQ76KFI1PGcC1QDxMbxTZpSCAg== chalk@^4.1.0: version "4.1.2" @@ -1456,9 +1370,9 @@ chownr@^1.1.1: integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + version "1.0.4" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -1643,14 +1557,14 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@4.3.4, debug@^4.1.0: +debug@4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -debug@^4.3.4: +debug@^4.1.0, debug@^4.3.4: version "4.3.5" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== @@ -1782,10 +1696,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.668: - version "1.4.783" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.783.tgz#933887165b8b6025a81663d2d97cf4b85cde27b2" - integrity sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ== +electron-to-chromium@^1.4.796: + version "1.4.815" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.815.tgz#e901b195c57c3e0fae8dc6d596e4188a33c3e82c" + integrity sha512-OvpTT2ItpOXJL7IGcYakRjHCt8L5GrrN/wHCQsRB4PQa1X9fe+X9oen245mIId7s14xvArCGSTIq644yPUKKLg== elliptic@^6.5.3, elliptic@^6.5.5: version "6.5.5" @@ -1822,10 +1736,10 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0, enhanced-resolve@^5.16.0: - version "5.16.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz#e8bc63d51b826d6f1cbc0a150ecb5a8b0c62e567" - integrity sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.0: + version "5.17.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz#d037603789dd9555b89aaec7eb78845c49089bc5" + integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1853,9 +1767,9 @@ es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-module-lexer@^1.2.1: - version "1.5.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.3.tgz#25969419de9c0b1fbe54279789023e8a9a788412" - integrity sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg== + version "1.5.4" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" + integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== escalade@^3.1.2: version "3.1.2" @@ -2199,7 +2113,7 @@ hashlru@^2.3.0: resolved "https://registry.yarnpkg.com/hashlru/-/hashlru-2.3.0.tgz#5dc15928b3f6961a2056416bb3a4910216fdfb51" integrity sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A== -hasown@^2.0.0: +hasown@^2.0.0, hasown@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== @@ -2362,11 +2276,11 @@ is-binary-path@~2.1.0: binary-extensions "^2.0.0" is-core-module@^2.13.0: - version "2.13.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" - integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw== + version "2.14.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.14.0.tgz#43b8ef9f46a6a08888db67b1ffd4ec9e3dfd59d1" + integrity sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A== dependencies: - hasown "^2.0.0" + hasown "^2.0.2" is-docker@^3.0.0: version "3.0.0" @@ -2671,20 +2585,20 @@ launch-editor@^2.6.1: shell-quote "^1.8.1" libp2p@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/libp2p/-/libp2p-1.6.0.tgz#7012b4e5ea04f832a75c8047562581f4aa764c9e" - integrity sha512-cwU+hPXUP4517TSQ8FNOyxOqCZ6IkxPDB+Wduz+xoKJGVUyVto0BXYww209fZTZgP79urQ+OWLxQ9P6J42fjrg== - dependencies: - "@libp2p/crypto" "^4.1.2" - "@libp2p/interface" "^1.4.0" - "@libp2p/interface-internal" "^1.2.2" - "@libp2p/logger" "^4.0.13" - "@libp2p/multistream-select" "^5.1.10" - "@libp2p/peer-collections" "^5.2.2" - "@libp2p/peer-id" "^4.1.2" - "@libp2p/peer-id-factory" "^4.1.2" - "@libp2p/peer-store" "^10.0.19" - "@libp2p/utils" "^5.4.2" + version "1.7.0" + resolved "https://registry.yarnpkg.com/libp2p/-/libp2p-1.7.0.tgz#2d7b336dad02f8955118d6ec54a585875a657233" + integrity sha512-NYNhCpGudpSfcRzOF/X7UaDD4AUR0TSZxbJuodNR0vcb8k5/ZxUmhrdIsyPvBEnTg4MZO5HlF0eHmnxk6XjCAA== + dependencies: + "@libp2p/crypto" "^4.1.4" + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/logger" "^4.0.15" + "@libp2p/multistream-select" "^5.1.12" + "@libp2p/peer-collections" "^5.2.4" + "@libp2p/peer-id" "^4.1.4" + "@libp2p/peer-id-factory" "^4.1.4" + "@libp2p/peer-store" "^10.1.0" + "@libp2p/utils" "^5.4.4" "@multiformats/dns" "^1.0.6" "@multiformats/multiaddr" "^12.2.3" "@multiformats/multiaddr-matcher" "^1.2.1" @@ -2713,9 +2627,9 @@ locate-path@^5.0.0: p-locate "^4.1.0" lru-cache@^10.2.0: - version "10.2.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" - integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== + version "10.3.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.3.0.tgz#4a4aaf10c84658ab70f79a85a9a3f1e1fb11196b" + integrity sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ== make-error@^1.1.1: version "1.3.6" @@ -2822,9 +2736,9 @@ minimalistic-crypto-utils@^1.0.1: integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== minimatch@^9.0.4: - version "9.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" - integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== dependencies: brace-expansion "^2.0.1" @@ -2892,12 +2806,7 @@ multiformats@^12.0.1: resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-12.1.3.tgz#cbf7a9861e11e74f8228b21376088cb43ba8754e" integrity sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw== -multiformats@^13.0.0, multiformats@^13.1.0: - version "13.1.0" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.1.0.tgz#5aa9d2175108a448fc3bdb54ba8a3d0b6cab3ac3" - integrity sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ== - -multiformats@^13.0.1: +multiformats@^13.0.0, multiformats@^13.0.1, multiformats@^13.1.0: version "13.1.1" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.1.1.tgz#b22ce4df26330d2cf0d69f5bdcbc9a787095a6e5" integrity sha512-JiptvwMmlxlzIlLLwhCi/srf/nk409UL0eUBr0kioRJq15hqqKyg68iftrBvhCRjR6Rw4fkNnSc4ZJXJDuta/Q== @@ -2942,16 +2851,16 @@ netmask@^2.0.2: integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== node-abi@^3.3.0: - version "3.63.0" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.63.0.tgz#9bfbe68b87357f8b508554608b323e9b1052d045" - integrity sha512-vAszCsOUrUxjGAmdnM/pq7gUgie0IRteCQMX6d4A534fQCR93EJU5qgzBvU6EkFfK27s0T3HEV3BOyJIr7OMYw== + version "3.65.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.65.0.tgz#ca92d559388e1e9cab1680a18c1a18757cdac9d3" + integrity sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA== dependencies: semver "^7.3.5" node-datachannel@^0.9.0: - version "0.9.1" - resolved "https://registry.yarnpkg.com/node-datachannel/-/node-datachannel-0.9.1.tgz#73b63f8ce8e75e9a3bc3cc1a25baa5b097b962dd" - integrity sha512-b6Uc6YN5We2/aZA6QGicxSdWUDSwlR+vcO/Dn44BY5gieF3AOwsL/zPD+Ril+1KvYDwVJkVbRIovbG76E4PpwA== + version "0.9.2" + resolved "https://registry.yarnpkg.com/node-datachannel/-/node-datachannel-0.9.2.tgz#0cfccb9d95afff3a6ff01f0e75e99d9d6764d109" + integrity sha512-sknq4EAJcSNHUMiK6Gru3vtwo8QICiFs5xJyaitJy/ZLSUbikaGrDORpIpdGp8++4AYQOYC5vr9VyA6i01KeJQ== dependencies: node-domexception "^2.0.1" prebuild-install "^7.0.1" @@ -2984,9 +2893,9 @@ npm-run-path@^4.0.1: path-key "^3.0.0" object-inspect@^1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" - integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + version "1.13.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" + integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== observable-webworkers@^2.0.1: version "2.0.1" @@ -3796,9 +3705,9 @@ terser-webpack-plugin@^5.3.10: terser "^5.26.0" terser@^5.26.0: - version "5.31.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.0.tgz#06eef86f17007dbad4593f11a574c7f5eb02c6a1" - integrity sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg== + version "5.31.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.1.tgz#735de3c987dd671e95190e6b98cfe2f07f3cf0d4" + integrity sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -3828,9 +3737,9 @@ toidentifier@1.0.1: integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tree-dump@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tree-dump/-/tree-dump-1.0.1.tgz#b448758da7495580e6b7830d6b7834fca4c45b96" - integrity sha512-WCkcRBVPSlHHq1dc/px9iOfqklvzCbdRwvlNfxGZsrHqf6aZttfPrd7DJTt6oR10dwUfpFFQeVTkPbBIZxX/YA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/tree-dump/-/tree-dump-1.0.2.tgz#c460d5921caeb197bde71d0e9a7b479848c5b8ac" + integrity sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ== ts-loader@^9.3.1: version "9.5.1" @@ -3862,16 +3771,11 @@ ts-node@^10.9.2: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tslib@^2.0.0: +tslib@^2.0.0, tslib@^2.4.0, tslib@^2.6.1: version "2.6.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== -tslib@^2.4.0, tslib@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -3938,7 +3842,7 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== -update-browserslist-db@^1.0.13: +update-browserslist-db@^1.0.16: version "1.0.16" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz#f6d489ed90fb2f07d67784eb3f53d7891f736356" integrity sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ== @@ -4085,9 +3989,9 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.74.0: - version "5.91.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.91.0.tgz#ffa92c1c618d18c878f06892bbdc3373c71a01d9" - integrity sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw== + version "5.92.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.92.1.tgz#eca5c1725b9e189cffbd86e8b6c3c7400efc5788" + integrity sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.5" @@ -4095,10 +3999,10 @@ webpack@^5.74.0: "@webassemblyjs/wasm-edit" "^1.12.1" "@webassemblyjs/wasm-parser" "^1.12.1" acorn "^8.7.1" - acorn-import-assertions "^1.9.0" + acorn-import-attributes "^1.9.5" browserslist "^4.21.10" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.16.0" + enhanced-resolve "^5.17.0" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" diff --git a/packages/network/package.json b/packages/network/package.json index df4ce68b..be55c52f 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -37,6 +37,7 @@ "@libp2p/autonat": "^1.0.0", "@libp2p/bootstrap": "^10.1.0", "@libp2p/circuit-relay-v2": "^1.0.24", + "@libp2p/dcutr": "^1.1.0", "@libp2p/identify": "^2.0.2", "@libp2p/interface-pubsub": "^4.0.1", "@libp2p/pubsub-peer-discovery": "^10.0.2", diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index a60ff2e8..6169a0a4 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -6,6 +6,7 @@ import { import { noise } from "@chainsafe/libp2p-noise"; import { yamux } from "@chainsafe/libp2p-yamux"; import { circuitRelayTransport } from "@libp2p/circuit-relay-v2"; +import { dcutr } from "@libp2p/dcutr"; import { identify } from "@libp2p/identify"; import { EventHandler, PubSub, Stream, StreamHandler } from "@libp2p/interface"; import { pubsubPeerDiscovery } from "@libp2p/pubsub-peer-discovery"; @@ -16,6 +17,8 @@ import { Libp2p, createLibp2p } from "libp2p"; import { stringToStream } from "./stream.js"; import { webTransport } from "@libp2p/webtransport"; import { bootstrap } from "@libp2p/bootstrap"; +import { fromString as uint8ArrayFromString } from "uint8arrays/from-string"; +import { toString as uint8ArrayToString } from "uint8arrays/to-string"; export interface TopologyNetworkNodeConfig {} @@ -47,7 +50,7 @@ export class TopologyNetworkNode { peerDiscovery: [ pubsubPeerDiscovery({ interval: 10_000, - listenOnly: false, + topics: ["topology::discovery"], }), bootstrap({ list: [ @@ -59,11 +62,16 @@ export class TopologyNetworkNode { identify: identify(), pubsub: gossipsub({ allowPublishToZeroTopicPeers: true, + runOnTransientConnection: true, }), + dcutr: dcutr(), }, streamMuxers: [yamux()], transports: [ - circuitRelayTransport(), + circuitRelayTransport({ + discoverRelays: 2, + reservationConcurrency: 1, + }), webRTC({ rtcConfiguration: { iceServers: [ @@ -91,9 +99,17 @@ export class TopologyNetworkNode { this.peerId, ); - this._node.addEventListener("peer:connect", (evt) => { - console.log("topology::network::peer::connect: ", evt.detail.toString()); - }); + // TODO remove this or add better logger + // we need to keep it now for debugging + this._node.addEventListener("peer:connect", (e) => + console.log("peer:connect", e.detail), + ); + this._node.addEventListener("peer:discovery", (e) => + console.log("peer:discovery", e.detail), + ); + this._node.addEventListener("peer:identify", (e) => + console.log("peer:identify", e.detail), + ); } subscribe(topic: string) { @@ -164,7 +180,9 @@ export class TopologyNetworkNode { async sendMessage(peerId: string, protocols: string[], message: string) { try { const connection = await this._node?.dial([multiaddr(`/p2p/${peerId}`)]); - const stream = await connection?.newStream(protocols); + const stream = await connection?.newStream(protocols, { + runOnTransientConnection: true, + }); stringToStream(stream, message); console.log( @@ -186,7 +204,9 @@ export class TopologyNetworkNode { const peerId = peers[Math.floor(Math.random() * peers.length)]; const connection = await this._node?.dial(peerId); - const stream: Stream = (await connection?.newStream(protocols)) as Stream; + const stream: Stream = (await connection?.newStream(protocols, { + runOnTransientConnection: true, + })) as Stream; stringToStream(stream, message); console.log( diff --git a/packages/network/src/relay.ts b/packages/network/src/relay.ts index 5c2dd188..60be820f 100644 --- a/packages/network/src/relay.ts +++ b/packages/network/src/relay.ts @@ -23,7 +23,12 @@ export const createRelayNode = async () => { listen: ["/ip4/0.0.0.0/tcp/50000/ws", "/ip4/0.0.0.0/tcp/50001"], }, connectionEncryption: [noise()], - peerDiscovery: [pubsubPeerDiscovery()], + peerDiscovery: [ + pubsubPeerDiscovery({ + interval: 10_000, + topics: ["topology::discovery"], + }), + ], services: { autonat: autoNAT(), identify: identify(), diff --git a/packages/node/package.json b/packages/node/package.json index f50714ee..8b035bee 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -37,6 +37,7 @@ "vitest": "^1.6.0" }, "dependencies": { + "@libp2p/dcutr": "^1.1.0", "@topology-foundation/crdt": "0.0.10", "@topology-foundation/network": "0.0.10", "@topology-foundation/object": "0.0.10" diff --git a/yarn.lock b/yarn.lock index ed74df58..ed71e1f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -310,6 +310,21 @@ uint8arraylist "^2.4.8" uint8arrays "^5.1.0" +"@libp2p/dcutr@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@libp2p/dcutr/-/dcutr-1.1.0.tgz#0a73881361bb265ad6b43f0acffb5b41158fdb4d" + integrity sha512-C8tBevJxb6D8c8Qb2N14/nzSGJY84MyTwzAhf8cwKp7Um17RouTljUJEOakk+TRCp/UrPx3tbbVDOb2cmUR1Tg== + dependencies: + "@libp2p/interface" "^1.5.0" + "@libp2p/interface-internal" "^1.2.4" + "@libp2p/utils" "^5.4.4" + "@multiformats/multiaddr" "^12.2.3" + "@multiformats/multiaddr-matcher" "^1.2.1" + delay "^6.0.0" + it-protobuf-stream "^1.1.3" + protons-runtime "^5.4.0" + uint8arraylist "^2.4.8" + "@libp2p/identify@^2.0.2": version "2.1.0" resolved "https://registry.yarnpkg.com/@libp2p/identify/-/identify-2.1.0.tgz#663daa8e1f541326630655a8bd52aba015797017"