chore!: rename local-discovery to local-peer-cache-discovery (#1867)

This commit is contained in:
Danish Arora 2024-02-29 01:05:54 +05:30 committed by GitHub
parent 78ee39a2e2
commit f3cb10d484
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 87 additions and 72 deletions

2
.gitignore vendored
View File

@ -13,4 +13,4 @@ test-results
playwright-report playwright-report
example example
allure-results allure-results
packages/local-discovery/mock_local_storage packages/local-peer-cache-discovery/mock_local_storage

115
package-lock.json generated
View File

@ -15,7 +15,7 @@
"packages/relay", "packages/relay",
"packages/peer-exchange", "packages/peer-exchange",
"packages/dns-discovery", "packages/dns-discovery",
"packages/local-discovery", "packages/local-peer-cache-discovery",
"packages/message-encryption", "packages/message-encryption",
"packages/sdk", "packages/sdk",
"packages/tests", "packages/tests",
@ -5467,8 +5467,8 @@
"resolved": "packages/interfaces", "resolved": "packages/interfaces",
"link": true "link": true
}, },
"node_modules/@waku/local-discovery": { "node_modules/@waku/local-peer-cache-discovery": {
"resolved": "packages/local-discovery", "resolved": "packages/local-peer-cache-discovery",
"link": true "link": true
}, },
"node_modules/@waku/message-encryption": { "node_modules/@waku/message-encryption": {
@ -27913,6 +27913,7 @@
"packages/local-discovery": { "packages/local-discovery": {
"name": "@waku/local-discovery", "name": "@waku/local-discovery",
"version": "0.0.1", "version": "0.0.1",
"extraneous": true,
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"dependencies": { "dependencies": {
"@libp2p/interface": "^1.1.2", "@libp2p/interface": "^1.1.2",
@ -27939,7 +27940,36 @@
"node": ">=18" "node": ">=18"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-bundled-dicts": { "packages/local-peer-cache-discovery": {
"name": "@waku/local-peer-cache-discovery",
"version": "0.0.1",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@libp2p/interface": "^1.1.2",
"@waku/interfaces": "^0.0.21",
"@waku/utils": "^0.0.14"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.11",
"@types/node-localstorage": "^1.3.3",
"@waku/build-utils": "*",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"cspell": "^7.3.2",
"mocha": "^10.2.0",
"node-localstorage": "^3.0.5",
"npm-run-all": "^4.1.5",
"rollup": "^4.9.5",
"sinon": "^17.0.1"
},
"engines": {
"node": ">=18"
}
},
"packages/local-peer-cache-discovery/node_modules/@cspell/cspell-bundled-dicts": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-7.3.9.tgz",
"integrity": "sha512-ebfrf5Zaw33bcqT80Qrkv7IGT7GI/CDp15bSk2EUmdORzk1SCKZl6L4vUo3NLMmxVwYioS+OQmsW8E88sJNyGg==", "integrity": "sha512-ebfrf5Zaw33bcqT80Qrkv7IGT7GI/CDp15bSk2EUmdORzk1SCKZl6L4vUo3NLMmxVwYioS+OQmsW8E88sJNyGg==",
@ -27998,7 +28028,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-json-reporter": { "packages/local-peer-cache-discovery/node_modules/@cspell/cspell-json-reporter": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-7.3.9.tgz",
"integrity": "sha512-QHsem5OZXshFX+Wdlx3VpdPi9WS7KgoBMGGJ4zQZ3lp81Rb1tRj0Ij/98whq882QOmAVQfr+uOHANHLnyPr0LQ==", "integrity": "sha512-QHsem5OZXshFX+Wdlx3VpdPi9WS7KgoBMGGJ4zQZ3lp81Rb1tRj0Ij/98whq882QOmAVQfr+uOHANHLnyPr0LQ==",
@ -28010,7 +28040,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-pipe": { "packages/local-peer-cache-discovery/node_modules/@cspell/cspell-pipe": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-7.3.9.tgz",
"integrity": "sha512-gKYTHcryKOaTmr6t+M5h1sZnQ42eHeumBJejovphipXfdivedUnuYyQrrQGFAlUKzfEOWcOPME1nm17xsaX5Ww==", "integrity": "sha512-gKYTHcryKOaTmr6t+M5h1sZnQ42eHeumBJejovphipXfdivedUnuYyQrrQGFAlUKzfEOWcOPME1nm17xsaX5Ww==",
@ -28019,7 +28049,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-resolver": { "packages/local-peer-cache-discovery/node_modules/@cspell/cspell-resolver": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-7.3.9.tgz",
"integrity": "sha512-2slYAGvi7EFLKyJ5hrYBNaFT2iyOEQM1pEIzm+PDuhNJE/9wuBY5pBVqIgFSPz53vsQvW9GJThNY8h1/2EH3ZA==", "integrity": "sha512-2slYAGvi7EFLKyJ5hrYBNaFT2iyOEQM1pEIzm+PDuhNJE/9wuBY5pBVqIgFSPz53vsQvW9GJThNY8h1/2EH3ZA==",
@ -28031,7 +28061,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-service-bus": { "packages/local-peer-cache-discovery/node_modules/@cspell/cspell-service-bus": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-7.3.9.tgz",
"integrity": "sha512-VyfK3qWtJZag4Fe/x1Oh/tqCNVGKGlQ2ArX1fVdmTVGQtZcbXuMKdZI80t4b8SGtzGINHufAdakpu3xucX/FrQ==", "integrity": "sha512-VyfK3qWtJZag4Fe/x1Oh/tqCNVGKGlQ2ArX1fVdmTVGQtZcbXuMKdZI80t4b8SGtzGINHufAdakpu3xucX/FrQ==",
@ -28040,7 +28070,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/cspell-types": { "packages/local-peer-cache-discovery/node_modules/@cspell/cspell-types": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-7.3.9.tgz",
"integrity": "sha512-p7s8yEV6ASz0HjiArH11yjNj3vXzK2Ep94GrpdtYJxSxFC2w1mXAVUaJB/5+jC4+1YeYsmcBFTXmZ1rGMyTv3g==", "integrity": "sha512-p7s8yEV6ASz0HjiArH11yjNj3vXzK2Ep94GrpdtYJxSxFC2w1mXAVUaJB/5+jC4+1YeYsmcBFTXmZ1rGMyTv3g==",
@ -28049,25 +28079,25 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/dict-cryptocurrencies": { "packages/local-peer-cache-discovery/node_modules/@cspell/dict-cryptocurrencies": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-4.0.0.tgz",
"integrity": "sha512-EiZp91ATyRxTmauIQfOX9adLYCunKjHEh092rrM7o2eMXP9n7zpXAL9BK7LviL+LbB8VDOm21q+s83cKrrRrsg==", "integrity": "sha512-EiZp91ATyRxTmauIQfOX9adLYCunKjHEh092rrM7o2eMXP9n7zpXAL9BK7LviL+LbB8VDOm21q+s83cKrrRrsg==",
"dev": true "dev": true
}, },
"packages/local-discovery/node_modules/@cspell/dict-en-common-misspellings": { "packages/local-peer-cache-discovery/node_modules/@cspell/dict-en-common-misspellings": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-1.0.2.tgz",
"integrity": "sha512-jg7ZQZpZH7+aAxNBlcAG4tGhYF6Ksy+QS5Df73Oo+XyckBjC9QS+PrRwLTeYoFIgXy5j3ICParK5r3MSSoL4gw==", "integrity": "sha512-jg7ZQZpZH7+aAxNBlcAG4tGhYF6Ksy+QS5Df73Oo+XyckBjC9QS+PrRwLTeYoFIgXy5j3ICParK5r3MSSoL4gw==",
"dev": true "dev": true
}, },
"packages/local-discovery/node_modules/@cspell/dict-git": { "packages/local-peer-cache-discovery/node_modules/@cspell/dict-git": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-2.0.0.tgz",
"integrity": "sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w==", "integrity": "sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w==",
"dev": true "dev": true
}, },
"packages/local-discovery/node_modules/@cspell/dynamic-import": { "packages/local-peer-cache-discovery/node_modules/@cspell/dynamic-import": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-7.3.9.tgz",
"integrity": "sha512-P6tAmDVhrW03hmhetxhBKlNTYwL2lk8ZehYQwSpXaLnaFrS3xrQvfUaJ3Mj9W2CIMzSYXlLmPO2FLRhXK2dnEw==", "integrity": "sha512-P6tAmDVhrW03hmhetxhBKlNTYwL2lk8ZehYQwSpXaLnaFrS3xrQvfUaJ3Mj9W2CIMzSYXlLmPO2FLRhXK2dnEw==",
@ -28079,7 +28109,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/@cspell/strong-weak-map": { "packages/local-peer-cache-discovery/node_modules/@cspell/strong-weak-map": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-7.3.9.tgz", "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-7.3.9.tgz",
"integrity": "sha512-XKpw/p3+EN+PWiFAWc45RJPI9zQRkPSVdUFeZb0YLseWF/CkogScgIe4CLfMLITiVbP0X/FKk90+aTPfAU38kg==", "integrity": "sha512-XKpw/p3+EN+PWiFAWc45RJPI9zQRkPSVdUFeZb0YLseWF/CkogScgIe4CLfMLITiVbP0X/FKk90+aTPfAU38kg==",
@ -28088,16 +28118,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/commander": { "packages/local-peer-cache-discovery/node_modules/cspell": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
"integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
"dev": true,
"engines": {
"node": ">=16"
}
},
"packages/local-discovery/node_modules/cspell": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell/-/cspell-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell/-/cspell-7.3.9.tgz",
"integrity": "sha512-QzunjO9CmV5+98UfG4ONhvPtrcAC6Y2pEKeOrp5oPeyAI7HwgxmfsR3ybHRlMPAGcwKtDOurBKxM7jqXNwkzmA==", "integrity": "sha512-QzunjO9CmV5+98UfG4ONhvPtrcAC6Y2pEKeOrp5oPeyAI7HwgxmfsR3ybHRlMPAGcwKtDOurBKxM7jqXNwkzmA==",
@ -28133,7 +28154,7 @@
"url": "https://github.com/streetsidesoftware/cspell?sponsor=1" "url": "https://github.com/streetsidesoftware/cspell?sponsor=1"
} }
}, },
"packages/local-discovery/node_modules/cspell-dictionary": { "packages/local-peer-cache-discovery/node_modules/cspell-dictionary": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-7.3.9.tgz",
"integrity": "sha512-lkWfX5QNbs4yKqD9wa+G+NHRWmLgFdyposgJOyd/ojDbx99CDPMhMhg9pyMKdYl6Yt8kjMow58/i12EYvD8wnA==", "integrity": "sha512-lkWfX5QNbs4yKqD9wa+G+NHRWmLgFdyposgJOyd/ojDbx99CDPMhMhg9pyMKdYl6Yt8kjMow58/i12EYvD8wnA==",
@ -28149,13 +28170,13 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-dictionary/node_modules/fast-equals": { "packages/local-peer-cache-discovery/node_modules/cspell-dictionary/node_modules/fast-equals": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-4.0.3.tgz",
"integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==", "integrity": "sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==",
"dev": true "dev": true
}, },
"packages/local-discovery/node_modules/cspell-gitignore": { "packages/local-peer-cache-discovery/node_modules/cspell-gitignore": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-7.3.9.tgz",
"integrity": "sha512-DLuu+K2q4xYNL4DpLyysUeiGU/NYYoObzfOYiISzOKYpi3aFLiUaiyfF6xWGsahmlijif+8bwSsIMmcvGa5dgA==", "integrity": "sha512-DLuu+K2q4xYNL4DpLyysUeiGU/NYYoObzfOYiISzOKYpi3aFLiUaiyfF6xWGsahmlijif+8bwSsIMmcvGa5dgA==",
@ -28171,7 +28192,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-glob": { "packages/local-peer-cache-discovery/node_modules/cspell-glob": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-7.3.9.tgz",
"integrity": "sha512-7PaTkCzJWjQex3men857v3ExF7Q10jbQkfD+wdln2te9iNFd+HEkstA173vb828D9yeib1q1of8oONr2SeGycg==", "integrity": "sha512-7PaTkCzJWjQex3men857v3ExF7Q10jbQkfD+wdln2te9iNFd+HEkstA173vb828D9yeib1q1of8oONr2SeGycg==",
@ -28183,7 +28204,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-grammar": { "packages/local-peer-cache-discovery/node_modules/cspell-grammar": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-7.3.9.tgz",
"integrity": "sha512-s1QOPg4AxWE8XBewDQLe14j0uDyWGjREfm4dZFTrslAZUrQ8/df5s152M5LtgOEza33FrkKKE2axbGvgS9O7sQ==", "integrity": "sha512-s1QOPg4AxWE8XBewDQLe14j0uDyWGjREfm4dZFTrslAZUrQ8/df5s152M5LtgOEza33FrkKKE2axbGvgS9O7sQ==",
@ -28199,7 +28220,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-io": { "packages/local-peer-cache-discovery/node_modules/cspell-io": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-7.3.9.tgz",
"integrity": "sha512-IbXOYaDxLg94uijv13kqb+6PQjEwGboQYtABuZs2+HuUVW89K2tE+fQcEhkAsrZ11sDj5lUqgEQj9omvknZSuA==", "integrity": "sha512-IbXOYaDxLg94uijv13kqb+6PQjEwGboQYtABuZs2+HuUVW89K2tE+fQcEhkAsrZ11sDj5lUqgEQj9omvknZSuA==",
@ -28212,7 +28233,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-lib": { "packages/local-peer-cache-discovery/node_modules/cspell-lib": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-7.3.9.tgz",
"integrity": "sha512-eFYYs8XoYmdu78UxrPisD+hAoXOLaLzcevKf9+oDPDgJmHpkGoFgbIBnHMRIsAM1e+QDS6OlWG/rybhZTqanCQ==", "integrity": "sha512-eFYYs8XoYmdu78UxrPisD+hAoXOLaLzcevKf9+oDPDgJmHpkGoFgbIBnHMRIsAM1e+QDS6OlWG/rybhZTqanCQ==",
@ -28245,7 +28266,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/cspell-lib/node_modules/find-up": { "packages/local-peer-cache-discovery/node_modules/cspell-lib/node_modules/find-up": {
"version": "6.3.0", "version": "6.3.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz",
"integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==",
@ -28261,7 +28282,7 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"packages/local-discovery/node_modules/cspell-trie-lib": { "packages/local-peer-cache-discovery/node_modules/cspell-trie-lib": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-7.3.9.tgz",
"integrity": "sha512-aTWm2KYXjQ+MlM6kB37wmTV9RU8+fgZYkiFfMc48M0MhBc6XkHUibMGrFAS29gp+B70kWPxe+VHLmFIk9pRPyg==", "integrity": "sha512-aTWm2KYXjQ+MlM6kB37wmTV9RU8+fgZYkiFfMc48M0MhBc6XkHUibMGrFAS29gp+B70kWPxe+VHLmFIk9pRPyg==",
@ -28275,7 +28296,7 @@
"node": ">=16" "node": ">=16"
} }
}, },
"packages/local-discovery/node_modules/file-entry-cache": { "packages/local-peer-cache-discovery/node_modules/file-entry-cache": {
"version": "7.0.2", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.2.tgz", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-7.0.2.tgz",
"integrity": "sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==", "integrity": "sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==",
@ -28287,7 +28308,7 @@
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"packages/local-discovery/node_modules/import-meta-resolve": { "packages/local-peer-cache-discovery/node_modules/import-meta-resolve": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz",
"integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==",
@ -28297,7 +28318,7 @@
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
}, },
"packages/local-discovery/node_modules/locate-path": { "packages/local-peer-cache-discovery/node_modules/locate-path": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz",
"integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==",
@ -28312,7 +28333,7 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"packages/local-discovery/node_modules/p-limit": { "packages/local-peer-cache-discovery/node_modules/p-limit": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz",
"integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==",
@ -28327,7 +28348,7 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"packages/local-discovery/node_modules/p-locate": { "packages/local-peer-cache-discovery/node_modules/p-locate": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz",
"integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==",
@ -28342,7 +28363,7 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"packages/local-discovery/node_modules/path-exists": { "packages/local-peer-cache-discovery/node_modules/path-exists": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
"integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==",
@ -28351,7 +28372,7 @@
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
} }
}, },
"packages/local-discovery/node_modules/yocto-queue": { "packages/local-peer-cache-discovery/node_modules/yocto-queue": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz",
"integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==",
@ -28545,7 +28566,7 @@
"@waku/core": "0.0.26", "@waku/core": "0.0.26",
"@waku/dns-discovery": "0.0.20", "@waku/dns-discovery": "0.0.20",
"@waku/interfaces": "0.0.21", "@waku/interfaces": "0.0.21",
"@waku/local-discovery": "^0.0.1", "@waku/local-peer-cache-discovery": "^0.0.1",
"@waku/peer-exchange": "^0.0.19", "@waku/peer-exchange": "^0.0.19",
"@waku/relay": "0.0.9", "@waku/relay": "0.0.9",
"@waku/utils": "0.0.14", "@waku/utils": "0.0.14",
@ -32561,8 +32582,8 @@
"npm-run-all": "^4.1.5" "npm-run-all": "^4.1.5"
} }
}, },
"@waku/local-discovery": { "@waku/local-peer-cache-discovery": {
"version": "file:packages/local-discovery", "version": "file:packages/local-peer-cache-discovery",
"requires": { "requires": {
"@libp2p/interface": "^1.1.2", "@libp2p/interface": "^1.1.2",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
@ -32708,12 +32729,6 @@
"integrity": "sha512-XKpw/p3+EN+PWiFAWc45RJPI9zQRkPSVdUFeZb0YLseWF/CkogScgIe4CLfMLITiVbP0X/FKk90+aTPfAU38kg==", "integrity": "sha512-XKpw/p3+EN+PWiFAWc45RJPI9zQRkPSVdUFeZb0YLseWF/CkogScgIe4CLfMLITiVbP0X/FKk90+aTPfAU38kg==",
"dev": true "dev": true
}, },
"commander": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
"integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
"dev": true
},
"cspell": { "cspell": {
"version": "7.3.9", "version": "7.3.9",
"resolved": "https://registry.npmjs.org/cspell/-/cspell-7.3.9.tgz", "resolved": "https://registry.npmjs.org/cspell/-/cspell-7.3.9.tgz",
@ -33033,7 +33048,7 @@
"@waku/core": "0.0.26", "@waku/core": "0.0.26",
"@waku/dns-discovery": "0.0.20", "@waku/dns-discovery": "0.0.20",
"@waku/interfaces": "0.0.21", "@waku/interfaces": "0.0.21",
"@waku/local-discovery": "^0.0.1", "@waku/local-peer-cache-discovery": "^0.0.1",
"@waku/peer-exchange": "^0.0.19", "@waku/peer-exchange": "^0.0.19",
"@waku/relay": "0.0.9", "@waku/relay": "0.0.9",
"@waku/utils": "0.0.14", "@waku/utils": "0.0.14",

View File

@ -12,7 +12,7 @@
"packages/relay", "packages/relay",
"packages/peer-exchange", "packages/peer-exchange",
"packages/dns-discovery", "packages/dns-discovery",
"packages/local-discovery", "packages/local-peer-cache-discovery",
"packages/message-encryption", "packages/message-encryption",
"packages/sdk", "packages/sdk",
"packages/tests", "packages/tests",

View File

@ -3,7 +3,7 @@ import type { Peer, PeerId, TypedEventEmitter } from "@libp2p/interface";
export enum Tags { export enum Tags {
BOOTSTRAP = "bootstrap", BOOTSTRAP = "bootstrap",
PEER_EXCHANGE = "peer-exchange", PEER_EXCHANGE = "peer-exchange",
LOCAL = "local" LOCAL = "local-peer-cache"
} }
export interface ConnectionManagerOptions { export interface ConnectionManagerOptions {

View File

@ -1,7 +1,7 @@
{ {
"name": "@waku/local-discovery", "name": "@waku/local-peer-cache-discovery",
"version": "0.0.1", "version": "0.0.1",
"description": "Local Discovery keeps records of healthy peers in the browser's local storage for quicker bootstrapping.", "description": "Local Peer Cache keeps records of healthy peers in the browser's local storage for quicker bootstrapping.",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"module": "./dist/index.js", "module": "./dist/index.js",
"exports": { "exports": {
@ -12,7 +12,7 @@
}, },
"type": "module", "type": "module",
"author": "Waku Team", "author": "Waku Team",
"homepage": "https://github.com/waku-org/js-waku/tree/master/packages/local-discovery#readme", "homepage": "https://github.com/waku-org/js-waku/tree/master/packages/local-peer-cache-discovery#readme",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/waku-org/js-waku.git" "url": "https://github.com/waku-org/js-waku.git"

View File

@ -18,7 +18,7 @@ import { getWsMultiaddrFromMultiaddrs, Logger } from "@waku/utils";
const log = new Logger("peer-exchange-discovery"); const log = new Logger("peer-exchange-discovery");
type LocalStorageDiscoveryOptions = { type LocalPeerCacheDiscoveryOptions = {
tagName?: string; tagName?: string;
tagValue?: number; tagValue?: number;
tagTTL?: number; tagTTL?: number;
@ -28,7 +28,7 @@ export const DEFAULT_LOCAL_TAG_NAME = Tags.LOCAL;
const DEFAULT_LOCAL_TAG_VALUE = 50; const DEFAULT_LOCAL_TAG_VALUE = 50;
const DEFAULT_LOCAL_TAG_TTL = 100_000_000; const DEFAULT_LOCAL_TAG_TTL = 100_000_000;
export class LocalStorageDiscovery export class LocalPeerCacheDiscovery
extends TypedEventEmitter<PeerDiscoveryEvents> extends TypedEventEmitter<PeerDiscoveryEvents>
implements PeerDiscovery, Startable implements PeerDiscovery, Startable
{ {
@ -37,7 +37,7 @@ export class LocalStorageDiscovery
constructor( constructor(
private readonly components: Libp2pComponents, private readonly components: Libp2pComponents,
private readonly options?: LocalStorageDiscoveryOptions private readonly options?: LocalPeerCacheDiscoveryOptions
) { ) {
super(); super();
this.isStarted = false; this.isStarted = false;
@ -45,7 +45,7 @@ export class LocalStorageDiscovery
} }
get [Symbol.toStringTag](): string { get [Symbol.toStringTag](): string {
return "@waku/local-discovery"; return "@waku/local-peer-cache-discovery";
} }
async start(): Promise<void> { async start(): Promise<void> {
@ -149,12 +149,12 @@ function isValidStoredPeer(peer: any): peer is LocalStoragePeerInfo {
); );
} }
export function wakuLocalStorageDiscovery(): ( export function wakuLocalPeerCacheDiscovery(): (
components: Libp2pComponents, components: Libp2pComponents,
options?: LocalStorageDiscoveryOptions options?: LocalPeerCacheDiscoveryOptions
) => LocalStorageDiscovery { ) => LocalPeerCacheDiscovery {
return ( return (
components: Libp2pComponents, components: Libp2pComponents,
options?: LocalStorageDiscoveryOptions options?: LocalPeerCacheDiscoveryOptions
) => new LocalStorageDiscovery(components, options); ) => new LocalPeerCacheDiscovery(components, options);
} }

View File

@ -14,7 +14,7 @@ import { MemoryDatastore } from "datastore-core/memory";
import { LocalStorage } from "node-localstorage"; import { LocalStorage } from "node-localstorage";
import sinon from "sinon"; import sinon from "sinon";
import { LocalStorageDiscovery } from "./index.js"; import { LocalPeerCacheDiscovery } from "./index.js";
chai.use(chaiAsPromised); chai.use(chaiAsPromised);
@ -63,17 +63,17 @@ describe("Local Storage Discovery", function () {
tests({ tests({
async setup() { async setup() {
return new LocalStorageDiscovery(components); return new LocalPeerCacheDiscovery(components);
}, },
async teardown() {} async teardown() {}
}); });
}); });
describe("Unit Tests", function () { describe("Unit Tests", function () {
let discovery: LocalStorageDiscovery; let discovery: LocalPeerCacheDiscovery;
beforeEach(async function () { beforeEach(async function () {
discovery = new LocalStorageDiscovery(components); discovery = new LocalPeerCacheDiscovery(components);
await setPeersInLocalStorage(mockPeers); await setPeersInLocalStorage(mockPeers);
}); });

View File

@ -69,7 +69,7 @@
"@waku/core": "0.0.26", "@waku/core": "0.0.26",
"@waku/dns-discovery": "0.0.20", "@waku/dns-discovery": "0.0.20",
"@waku/interfaces": "0.0.21", "@waku/interfaces": "0.0.21",
"@waku/local-discovery": "^0.0.1", "@waku/local-peer-cache-discovery": "^0.0.1",
"@waku/peer-exchange": "^0.0.19", "@waku/peer-exchange": "^0.0.19",
"@waku/relay": "0.0.9", "@waku/relay": "0.0.9",
"@waku/utils": "0.0.14", "@waku/utils": "0.0.14",

View File

@ -20,7 +20,7 @@ import {
PubsubTopic, PubsubTopic,
type ShardInfo type ShardInfo
} from "@waku/interfaces"; } from "@waku/interfaces";
import { wakuLocalStorageDiscovery } from "@waku/local-discovery"; import { wakuLocalPeerCacheDiscovery } from "@waku/local-peer-cache-discovery";
import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange"; import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange";
import { RelayCreateOptions, wakuGossipSub, wakuRelay } from "@waku/relay"; import { RelayCreateOptions, wakuGossipSub, wakuRelay } from "@waku/relay";
import { ensureShardingConfigured } from "@waku/utils"; import { ensureShardingConfigured } from "@waku/utils";
@ -188,7 +188,7 @@ export function defaultPeerDiscoveries(
): ((components: Libp2pComponents) => PeerDiscovery)[] { ): ((components: Libp2pComponents) => PeerDiscovery)[] {
const discoveries = [ const discoveries = [
wakuDnsDiscovery([enrTree["PROD"]], DEFAULT_NODE_REQUIREMENTS), wakuDnsDiscovery([enrTree["PROD"]], DEFAULT_NODE_REQUIREMENTS),
wakuLocalStorageDiscovery(), wakuLocalPeerCacheDiscovery(),
wakuPeerExchangeDiscovery(pubsubTopics) wakuPeerExchangeDiscovery(pubsubTopics)
]; ];
return discoveries; return discoveries;