diff --git a/README.md b/README.md index 6f74326..4c7cd2e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Here is the list of the examples using [`js-waku`](https://www.npmjs.com/package/js-waku) and the features they demonstrate: -See https://docs.wakuconnect.dev/docs/examples/ for more examples. +See https://examples.waku.org/ for more examples. ### Web Chat App diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index f280d9f..69ef641 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -53,7 +53,6 @@ pipeline { } stage('Publish') { - //when { expression { GIT_BRANCH.endsWith('master') } } steps { script { sh "echo ${SITE_DOMAIN} > build/docs/CNAME" sshagent(credentials: ['status-im-auto-ssh']) { @@ -78,6 +77,8 @@ def buildExample(example=STAGE_NAME) { } def copyExample(example=STAGE_NAME) { - sh "mkdir -p build/docs/${example}" - sh "cp examples/${example}/*.(js|css|html) build/docs/${example}/" + def source = "examples/${example}" + def dest = "build/docs/${example}" + sh "mkdir -p ${dest}" + sh "cp -r ${source}/. ${dest}" } diff --git a/create-waku-app/README.md b/create-waku-app/README.md index 6427100..7b489f7 100644 --- a/create-waku-app/README.md +++ b/create-waku-app/README.md @@ -9,4 +9,4 @@ Usage: For options you can specify template from which to initialize your app. Template correlates directly to the name of example you can see in this repository. #### How to add support for new example: -Extend `wakuExamples` property defined in `package.json` in this package with the name of the example and relative path to it where folder of the example should be the same as it's name. \ No newline at end of file +Just create an example in the `examples` folder in the root of the repository. \ No newline at end of file diff --git a/create-waku-app/package-lock.json b/create-waku-app/package-lock.json index 022a7c6..05c9f5a 100644 --- a/create-waku-app/package-lock.json +++ b/create-waku-app/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT OR Apache-2.0", "dependencies": { "commander": "^9.4.1", + "enquirer": "^2.3.6", "fs-extra": "^11.1.0", "semver": "^7.3.8", "validate-npm-package-name": "^5.0.0" @@ -21,6 +22,14 @@ "node": ">=16" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "engines": { + "node": ">=6" + } + }, "node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -37,6 +46,17 @@ "node": "^12.20.0 || >=14" } }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/fs-extra": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", @@ -117,6 +137,11 @@ } }, "dependencies": { + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==" + }, "builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -130,6 +155,14 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==" }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "requires": { + "ansi-colors": "^4.1.1" + } + }, "fs-extra": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", diff --git a/create-waku-app/package.json b/create-waku-app/package.json index e592a92..e9044a4 100644 --- a/create-waku-app/package.json +++ b/create-waku-app/package.json @@ -1,45 +1,45 @@ { - "name": "@waku/create-app", - "version": "0.1.0", - "description": "Helper package to bootstrap Waku app ", - "repository": { - "type": "git", - "url": "https://github.com/waku-org/js-waku-examples.git", - "directory": "packages/create-app" - }, - "engines": { - "node": ">=16" - }, - "bugs": { - "url": "https://github.com/waku-org/js-waku-examples/issues" - }, - "files": [ - "index.js", - "createApp.js", - "examples" - ], - "main": "index.js", - "bin": { - "create-waku-app": "./index.js" - }, - "scripts": { - "build": "node ./build.js", - "prepublishOnly": "npm run build" - }, - "keywords": [ - "waku", - "decentralised", - "communication", - "web3", - "ethereum", - "dapps" - ], - "license": "MIT OR Apache-2.0", - "dependencies": { - "commander": "^9.4.1", - "enquirer": "^2.3.6", - "fs-extra": "^11.1.0", - "semver": "^7.3.8", - "validate-npm-package-name": "^5.0.0" - } + "name": "@waku/create-app", + "version": "0.1.1", + "description": "Helper package to bootstrap Waku app ", + "repository": { + "type": "git", + "url": "https://github.com/waku-org/js-waku-examples.git", + "directory": "packages/create-app" + }, + "engines": { + "node": ">=16" + }, + "bugs": { + "url": "https://github.com/waku-org/js-waku-examples/issues" + }, + "files": [ + "index.js", + "createApp.js", + "examples" + ], + "main": "index.js", + "bin": { + "create-app": "./index.js" + }, + "scripts": { + "build": "node ./build.js", + "prepublishOnly": "npm run build" + }, + "keywords": [ + "waku", + "decentralised", + "communication", + "web3", + "ethereum", + "dapps" + ], + "license": "MIT OR Apache-2.0", + "dependencies": { + "commander": "^9.4.1", + "enquirer": "^2.3.6", + "fs-extra": "^11.1.0", + "semver": "^7.3.8", + "validate-npm-package-name": "^5.0.0" + } } diff --git a/examples/eth-pm/public/favicon.png b/examples/eth-pm/public/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/eth-pm/public/favicon.png and b/examples/eth-pm/public/favicon.png differ diff --git a/examples/eth-pm/public/manifest.json b/examples/eth-pm/public/manifest.json index 0f3905d..ab1f89c 100644 --- a/examples/eth-pm/public/manifest.json +++ b/examples/eth-pm/public/manifest.json @@ -1,6 +1,7 @@ { - "short_name": "Ethereum Private Messaging", - "name": "End-to-end encrypted communication between two Ethereum addresses.", + "short_name": "Waku EthChat", + "name": "Waku Ethereum Private Messaging", + "description": "End-to-end encrypted communication between two Ethereum addresses.", "icons": [ { "src": "favicon.ico", @@ -13,8 +14,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/light-chat/favicon.png b/examples/light-chat/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/light-chat/favicon.png and b/examples/light-chat/favicon.png differ diff --git a/examples/light-chat/manifest.json b/examples/light-chat/manifest.json index 5ee4e94..6fafb2c 100644 --- a/examples/light-chat/manifest.json +++ b/examples/light-chat/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Light chat", - "name": "Send messages between several users (or just one) using light client targeted protocols.", + "name": "Light Chat", + "description": "Send messages between several users (or just one) using light client targeted protocols.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/light-js/favicon.png b/examples/light-js/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/light-js/favicon.png and b/examples/light-js/favicon.png differ diff --git a/examples/light-js/manifest.json b/examples/light-js/manifest.json index 28821c6..4a01c8d 100644 --- a/examples/light-js/manifest.json +++ b/examples/light-js/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Light js", - "name": "Send messages between several users (or just one) using light client targeted protocols.", + "name": "Light JS", + "description": "Send messages between several users (or just one) using light client targeted protocols.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/relay-angular-chat/src/favicon.png b/examples/relay-angular-chat/src/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/relay-angular-chat/src/favicon.png and b/examples/relay-angular-chat/src/favicon.png differ diff --git a/examples/relay-angular-chat/src/manifest.json b/examples/relay-angular-chat/src/manifest.json index d660cdb..7d1cba9 100644 --- a/examples/relay-angular-chat/src/manifest.json +++ b/examples/relay-angular-chat/src/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Relay chat", - "name": "A barebone messaging app to illustrate the Angular Relay guide.", + "name": "Relay Chat", + "description": "A barebone messaging app to illustrate the Angular Relay guide.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/relay-js/favicon.png b/examples/relay-js/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/relay-js/favicon.png and b/examples/relay-js/favicon.png differ diff --git a/examples/relay-js/manifest.json b/examples/relay-js/manifest.json index d6b4e7e..12384eb 100644 --- a/examples/relay-js/manifest.json +++ b/examples/relay-js/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Relay js", - "name": "This example uses Waku Relay to send and receive simple text messages.", + "name": "Relay JS", + "description": "This example uses Waku Relay to send and receive simple text messages.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/relay-reactjs-chat/public/favicon.png b/examples/relay-reactjs-chat/public/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/relay-reactjs-chat/public/favicon.png and b/examples/relay-reactjs-chat/public/favicon.png differ diff --git a/examples/relay-reactjs-chat/public/manifest.json b/examples/relay-reactjs-chat/public/manifest.json index a601780..da12326 100644 --- a/examples/relay-reactjs-chat/public/manifest.json +++ b/examples/relay-reactjs-chat/public/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "React Relay", - "name": "A barebone chat app to illustrate the ReactJS Relay guide.", + "name": "Waku Relay", + "description": "A barebone chat app to illustrate the ReactJS Relay guide.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/rln-js/favicon.png b/examples/rln-js/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/rln-js/favicon.png and b/examples/rln-js/favicon.png differ diff --git a/examples/rln-js/index.html b/examples/rln-js/index.html index 49fda79..ec9206e 100644 --- a/examples/rln-js/index.html +++ b/examples/rln-js/index.html @@ -403,7 +403,9 @@ try { registerButton.disabled = true; - const pubkey = ethers.BigNumber.from(membershipKey.IDCommitment); + const idCommitment = membershipKey.IDCommitment; + const reversedArray = idCommitment.slice().reverse(); + const pubkey = ethers.utils.hexlify(reversedArray).toString(); const price = await rlnContract.MEMBERSHIP_DEPOSIT(); diff --git a/examples/rln-js/manifest.json b/examples/rln-js/manifest.json index b130e0a..5629aa1 100644 --- a/examples/rln-js/manifest.json +++ b/examples/rln-js/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Rln js", - "name": "Use RLN in the browser, compatible with nwaku chat2 and go-waku chat2 RLN implementations.", + "name": "Waku RLN", + "description": "Use RLN in the browser, compatible with nwaku chat2 and go-waku chat2 RLN implementations.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/store-js/favicon.png b/examples/store-js/favicon.png index 7f4a04d..f4cab92 100644 Binary files a/examples/store-js/favicon.png and b/examples/store-js/favicon.png differ diff --git a/examples/store-js/manifest.json b/examples/store-js/manifest.json index 8eafb9b..fe23bcd 100644 --- a/examples/store-js/manifest.json +++ b/examples/store-js/manifest.json @@ -1,6 +1,6 @@ { - "short_name": "Store js", - "name": "This example uses Waku Store to retrieve the latest ping relay message (used for keep alive purposes) and displays its timestamp.", + "name": "Waku Store", + "description": "This example uses Waku Store to retrieve the latest ping relay message (used for keep alive purposes) and displays its timestamp.", "icons": [ { "src": "favicon.ico", @@ -13,8 +13,7 @@ "sizes": "192x192" } ], - "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#ffffff", "background_color": "#ffffff" } diff --git a/examples/web-chat/.cspell.json b/examples/web-chat/.cspell.json index 3a31ad2..55e5caf 100644 --- a/examples/web-chat/.cspell.json +++ b/examples/web-chat/.cspell.json @@ -3,6 +3,7 @@ "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/master/cspell.schema.json", "language": "en", "words": [ + "AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM", "asym", "backoff", "backoffs", diff --git a/examples/web-chat/package-lock.json b/examples/web-chat/package-lock.json index 01bcafd..84d7453 100644 --- a/examples/web-chat/package-lock.json +++ b/examples/web-chat/package-lock.json @@ -14,6 +14,7 @@ "@waku/byte-utils": "^0.0.2", "@waku/core": "^0.0.6", "@waku/create": "^0.0.4", + "@waku/dns-discovery": "0.0.4", "@waku/interfaces": "^0.0.5", "process": "^0.11.10", "protons-runtime": "^3.1.0", @@ -2990,6 +2991,58 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -3868,11 +3921,42 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@leichtgewicht/base64-codec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@leichtgewicht/base64-codec/-/base64-codec-1.0.0.tgz", + "integrity": "sha512-0cgP4lRBzh3F4tlpTfs7F+PJyBN8j5yUC9KrQFWp/bREswgzZVHE8T1rNyRDWgvALwwpPtnJDQfqWUmxI33Epg==" + }, + "node_modules/@leichtgewicht/dns-packet": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@leichtgewicht/dns-packet/-/dns-packet-6.0.3.tgz", + "integrity": "sha512-qmVHhFBFiBvPsk/wJ/EdoWHb+tGkzY4haybmDPukhF6w0+8wpEbrHTIRE9LzeUu2P0bAbmrK8WOXt5V5QN6jQg==", + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.4", + "bytes.js": "^0.0.2", + "utf8-bytes": "^0.0.1", + "utf8-codec": "^1.0.0", + "utf8-length": "^0.0.1", + "utf8-string-bytes": "^1.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@leichtgewicht/dns-socket": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@leichtgewicht/dns-socket/-/dns-socket-5.0.0.tgz", + "integrity": "sha512-Sbrn/OG0HTTPGSkwIDCHy8/tUI6UglIzFsMNjzZn/Na1/i5owSm6rVi9CfKNNjRcUlYEzICELYW6EoZdjwVY2A==", + "dependencies": { + "@leichtgewicht/dns-packet": "^6.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", - "dev": true + "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, "node_modules/@libp2p/bootstrap": { "version": "5.0.2", @@ -6506,6 +6590,48 @@ "node": ">=16" } }, + "node_modules/@waku/dns-discovery": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@waku/dns-discovery/-/dns-discovery-0.0.4.tgz", + "integrity": "sha512-XwlDLHh0q2E+hH6fQa7sGiT0wTAoAfehYfo21iJUEnGbVRJY0LHXQAm7aMSOSZTXe8ctHQ6ukeu5ykR0vC2Oeg==", + "dependencies": { + "@libp2p/interface-peer-discovery": "^1.0.0", + "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/interfaces": "^3.0.2", + "@libp2p/peer-id": "^1.1.10", + "@waku/byte-utils": "*", + "@waku/enr": "*", + "@waku/libp2p-utils": "*", + "chai": "^4.3.4", + "debug": "^4.3.4", + "dns-query": "^0.11.2", + "hi-base32": "^0.5.1", + "uint8arrays": "^4.0.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@waku/enr": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@waku/enr/-/enr-0.0.4.tgz", + "integrity": "sha512-BQ/nQbhddE1hvxijJP7/Il+z5mymapU8xnax09UCZEGX9wVQBbHbzsSX6ARhfwCqBTNNsR5hlOhLISRr8H+43g==", + "dependencies": { + "@ethersproject/rlp": "^5.5.0", + "@libp2p/crypto": "^1.0.4", + "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/peer-id": "^1.1.10", + "@multiformats/multiaddr": "^11.0.6", + "@noble/secp256k1": "^1.3.4", + "@waku/byte-utils": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "js-sha3": "^0.8.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@waku/interfaces": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.5.tgz", @@ -6522,6 +6648,23 @@ "node": ">=16" } }, + "node_modules/@waku/libp2p-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@waku/libp2p-utils/-/libp2p-utils-0.0.2.tgz", + "integrity": "sha512-Zc4vFvKz62QAVCRd4648tvZRHEpclh/jZlR0dFFXjp5gpKE1W1/2kh31odTroPzAMwZiASHJUjel4Z1M/BCUhw==", + "dependencies": { + "@libp2p/interface-connection": "^3.0.3", + "@libp2p/interface-peer-id": "^1.0.6", + "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/interface-peer-store": "^1.2.3", + "@libp2p/peer-id": "^1.1.10", + "@multiformats/multiaddr": "^11.0.6", + "debug": "^4.3.4" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -7140,6 +7283,14 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "engines": { + "node": "*" + } + }, "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -7760,6 +7911,11 @@ "node": ">= 0.8" } }, + "node_modules/bytes.js": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/bytes.js/-/bytes.js-0.0.2.tgz", + "integrity": "sha512-KrLm4hv5Qs9w6b0U7h1bCdqxrsf+e9QMsfHeyQFzAz94x/5Aqa+FTEUSNBtt5d2VuV3Hfiea3c4ti74RZDDYkg==" + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -8038,6 +8194,23 @@ "node": ">= 10" } }, + "node_modules/chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -8073,6 +8246,14 @@ "node": ">=10" } }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "engines": { + "node": "*" + } + }, "node_modules/check-types": { "version": "11.2.2", "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.2.tgz", @@ -9405,6 +9586,17 @@ "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -9631,6 +9823,21 @@ "node": ">=6" } }, + "node_modules/dns-query": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/dns-query/-/dns-query-0.11.2.tgz", + "integrity": "sha512-zF8qxQpqCB467o4A63DLpQClo77H642JEKMx0Ra9GFww7Rx0234Fo8NoG0LBoSBZxamWkXfLxhzDG19bTBHvXQ==", + "dependencies": { + "@leichtgewicht/base64-codec": "^1.0.0", + "@leichtgewicht/dns-packet": "^6.0.2", + "@leichtgewicht/dns-socket": "^5.0.0", + "@leichtgewicht/ip-codec": "^2.0.4", + "utf8-codec": "^1.0.0" + }, + "bin": { + "dns-query": "bin/dns-query" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -11719,6 +11926,14 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", @@ -12160,6 +12375,11 @@ "resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz", "integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==" }, + "node_modules/hi-base32": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", + "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" + }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -15664,6 +15884,11 @@ "url": "https://opencollective.com/js-sdsl" } }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -16333,6 +16558,14 @@ "loose-envify": "cli.js" } }, + "node_modules/loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "dependencies": { + "get-func-name": "^2.0.0" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -17152,9 +17385,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -17663,6 +17896,14 @@ "node": ">=8" } }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "engines": { + "node": "*" + } + }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -22343,7 +22584,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, "engines": { "node": ">=4" } @@ -22740,6 +22980,26 @@ "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==" }, + "node_modules/utf8-bytes": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", + "integrity": "sha512-GifWmJAx2qAXT+lZLhbkWhBsy7pr6xWHiPWlVToDiELdWgZwt4Ogjf9tlgvKuALzTFR/d+EPQQI9ogJV3957Jg==" + }, + "node_modules/utf8-codec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utf8-codec/-/utf8-codec-1.0.0.tgz", + "integrity": "sha512-S/QSLezp3qvG4ld5PUfXiH7mCFxLKjSVZRFkB3DOjgwHuJPFDkInAXc/anf7BAbHt/D38ozDzL+QMZ6/7gsI6w==" + }, + "node_modules/utf8-length": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-length/-/utf8-length-0.0.1.tgz", + "integrity": "sha512-j/XH2ftofBiobnyApxlN/J6j/ixwT89WEjDcjT66d2i0+GIn9RZfzt8lpEXXE4jUe4NsjBSUq70kS2euQ4nnMw==" + }, + "node_modules/utf8-string-bytes": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/utf8-string-bytes/-/utf8-string-bytes-1.0.3.tgz", + "integrity": "sha512-i/I1Omf6lADjVBlwJpQifZOePV15snHny9w04+lc71+3t8PyWuLC/7clyoOSHOBNGXFe2PAGxmTiZ+Z4HWsPyw==" + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -26042,6 +26302,28 @@ } } }, + "@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==" + }, + "@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, "@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", @@ -26714,11 +26996,36 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "@leichtgewicht/base64-codec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@leichtgewicht/base64-codec/-/base64-codec-1.0.0.tgz", + "integrity": "sha512-0cgP4lRBzh3F4tlpTfs7F+PJyBN8j5yUC9KrQFWp/bREswgzZVHE8T1rNyRDWgvALwwpPtnJDQfqWUmxI33Epg==" + }, + "@leichtgewicht/dns-packet": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@leichtgewicht/dns-packet/-/dns-packet-6.0.3.tgz", + "integrity": "sha512-qmVHhFBFiBvPsk/wJ/EdoWHb+tGkzY4haybmDPukhF6w0+8wpEbrHTIRE9LzeUu2P0bAbmrK8WOXt5V5QN6jQg==", + "requires": { + "@leichtgewicht/ip-codec": "^2.0.4", + "bytes.js": "^0.0.2", + "utf8-bytes": "^0.0.1", + "utf8-codec": "^1.0.0", + "utf8-length": "^0.0.1", + "utf8-string-bytes": "^1.0.3" + } + }, + "@leichtgewicht/dns-socket": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@leichtgewicht/dns-socket/-/dns-socket-5.0.0.tgz", + "integrity": "sha512-Sbrn/OG0HTTPGSkwIDCHy8/tUI6UglIzFsMNjzZn/Na1/i5owSm6rVi9CfKNNjRcUlYEzICELYW6EoZdjwVY2A==", + "requires": { + "@leichtgewicht/dns-packet": "^6.0.0" + } + }, "@leichtgewicht/ip-codec": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", - "dev": true + "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, "@libp2p/bootstrap": { "version": "5.0.2", @@ -28773,6 +29080,42 @@ "@waku/interfaces": "*" } }, + "@waku/dns-discovery": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@waku/dns-discovery/-/dns-discovery-0.0.4.tgz", + "integrity": "sha512-XwlDLHh0q2E+hH6fQa7sGiT0wTAoAfehYfo21iJUEnGbVRJY0LHXQAm7aMSOSZTXe8ctHQ6ukeu5ykR0vC2Oeg==", + "requires": { + "@libp2p/interface-peer-discovery": "^1.0.0", + "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/interfaces": "^3.0.2", + "@libp2p/peer-id": "^1.1.10", + "@waku/byte-utils": "*", + "@waku/enr": "*", + "@waku/libp2p-utils": "*", + "chai": "^4.3.4", + "debug": "^4.3.4", + "dns-query": "^0.11.2", + "hi-base32": "^0.5.1", + "uint8arrays": "^4.0.2" + } + }, + "@waku/enr": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@waku/enr/-/enr-0.0.4.tgz", + "integrity": "sha512-BQ/nQbhddE1hvxijJP7/Il+z5mymapU8xnax09UCZEGX9wVQBbHbzsSX6ARhfwCqBTNNsR5hlOhLISRr8H+43g==", + "requires": { + "@ethersproject/rlp": "^5.5.0", + "@libp2p/crypto": "^1.0.4", + "@libp2p/interface-peer-id": "^1.0.2", + "@libp2p/peer-id": "^1.1.10", + "@multiformats/multiaddr": "^11.0.6", + "@noble/secp256k1": "^1.3.4", + "@waku/byte-utils": "*", + "chai": "^4.3.6", + "debug": "^4.3.4", + "js-sha3": "^0.8.0" + } + }, "@waku/interfaces": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/@waku/interfaces/-/interfaces-0.0.5.tgz", @@ -28786,6 +29129,20 @@ "libp2p": "0.40.0" } }, + "@waku/libp2p-utils": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@waku/libp2p-utils/-/libp2p-utils-0.0.2.tgz", + "integrity": "sha512-Zc4vFvKz62QAVCRd4648tvZRHEpclh/jZlR0dFFXjp5gpKE1W1/2kh31odTroPzAMwZiASHJUjel4Z1M/BCUhw==", + "requires": { + "@libp2p/interface-connection": "^3.0.3", + "@libp2p/interface-peer-id": "^1.0.6", + "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/interface-peer-store": "^1.2.3", + "@libp2p/peer-id": "^1.1.10", + "@multiformats/multiaddr": "^11.0.6", + "debug": "^4.3.4" + } + }, "@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -29296,6 +29653,11 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -29772,6 +30134,11 @@ "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", "dev": true }, + "bytes.js": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/bytes.js/-/bytes.js-0.0.2.tgz", + "integrity": "sha512-KrLm4hv5Qs9w6b0U7h1bCdqxrsf+e9QMsfHeyQFzAz94x/5Aqa+FTEUSNBtt5d2VuV3Hfiea3c4ti74RZDDYkg==" + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -30017,6 +30384,20 @@ "lodash": "^4.17.15" } }, + "chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -30045,6 +30426,11 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" + }, "check-types": { "version": "11.2.2", "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.2.tgz", @@ -31041,6 +31427,14 @@ "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -31209,6 +31603,18 @@ "@leichtgewicht/ip-codec": "^2.0.1" } }, + "dns-query": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/dns-query/-/dns-query-0.11.2.tgz", + "integrity": "sha512-zF8qxQpqCB467o4A63DLpQClo77H642JEKMx0Ra9GFww7Rx0234Fo8NoG0LBoSBZxamWkXfLxhzDG19bTBHvXQ==", + "requires": { + "@leichtgewicht/base64-codec": "^1.0.0", + "@leichtgewicht/dns-packet": "^6.0.2", + "@leichtgewicht/dns-socket": "^5.0.0", + "@leichtgewicht/ip-codec": "^2.0.4", + "utf8-codec": "^1.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -32797,6 +33203,11 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==" + }, "get-intrinsic": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", @@ -33129,6 +33540,11 @@ "resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz", "integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==" }, + "hi-base32": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/hi-base32/-/hi-base32-0.5.1.tgz", + "integrity": "sha512-EmBBpvdYh/4XxsnUybsPag6VikPYnN30td+vQk+GI3qpahVEG9+gTkG0aXVxTjBqQ5T6ijbWIu77O+C5WFWsnA==" + }, "hoist-non-react-statics": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", @@ -35727,6 +36143,11 @@ "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", "dev": true }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -36260,6 +36681,14 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "requires": { + "get-func-name": "^2.0.0" + } + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -36870,9 +37299,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true }, "object-keys": { @@ -37220,6 +37649,11 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -40581,8 +41015,7 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, "type-fest": { "version": "1.4.0", @@ -40854,6 +41287,26 @@ "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==" }, + "utf8-bytes": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", + "integrity": "sha512-GifWmJAx2qAXT+lZLhbkWhBsy7pr6xWHiPWlVToDiELdWgZwt4Ogjf9tlgvKuALzTFR/d+EPQQI9ogJV3957Jg==" + }, + "utf8-codec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utf8-codec/-/utf8-codec-1.0.0.tgz", + "integrity": "sha512-S/QSLezp3qvG4ld5PUfXiH7mCFxLKjSVZRFkB3DOjgwHuJPFDkInAXc/anf7BAbHt/D38ozDzL+QMZ6/7gsI6w==" + }, + "utf8-length": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-length/-/utf8-length-0.0.1.tgz", + "integrity": "sha512-j/XH2ftofBiobnyApxlN/J6j/ixwT89WEjDcjT66d2i0+GIn9RZfzt8lpEXXE4jUe4NsjBSUq70kS2euQ4nnMw==" + }, + "utf8-string-bytes": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/utf8-string-bytes/-/utf8-string-bytes-1.0.3.tgz", + "integrity": "sha512-i/I1Omf6lADjVBlwJpQifZOePV15snHny9w04+lc71+3t8PyWuLC/7clyoOSHOBNGXFe2PAGxmTiZ+Z4HWsPyw==" + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/examples/web-chat/package.json b/examples/web-chat/package.json index 755091e..3a1cfcf 100644 --- a/examples/web-chat/package.json +++ b/examples/web-chat/package.json @@ -11,6 +11,7 @@ "@waku/core": "^0.0.6", "@waku/create": "^0.0.4", "@waku/interfaces": "^0.0.5", + "@waku/dns-discovery": "0.0.4", "process": "^0.11.10", "protons-runtime": "^3.1.0", "react": "^17.0.2", diff --git a/examples/web-chat/src/App.tsx b/examples/web-chat/src/App.tsx index cb9aadb..80a9079 100644 --- a/examples/web-chat/src/App.tsx +++ b/examples/web-chat/src/App.tsx @@ -6,17 +6,12 @@ import { WakuContext } from "./WakuContext"; import { ThemeProvider } from "@livechat/ui-kit"; import { generate } from "server-name-generator"; import { Message } from "./Message"; -import { - Fleet, - getPredefinedBootstrapNodes, -} from "@waku/core/lib/predefined_bootstrap_nodes"; +import { wakuDnsDiscovery } from "@waku/dns-discovery"; import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer"; import { Protocols, WakuLight } from "@waku/interfaces"; -import process from "process"; import { createLightNode } from "@waku/create"; import { DecoderV0, MessageV0 } from "@waku/core/lib/waku_message/version_0"; import { PageDirection } from "@waku/interfaces"; -import { bootstrap } from "@libp2p/bootstrap"; const themes = { AuthorName: { @@ -200,10 +195,17 @@ export default function App() { async function initWaku(setter: (waku: WakuLight) => void) { try { + const publicKey = "AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM"; + const fqdn = "test.waku.nodes.status.im"; + const enrTree = `enrtree://${publicKey}@${fqdn}`; const waku = await createLightNode({ libp2p: { peerDiscovery: [ - bootstrap({ list: getPredefinedBootstrapNodes(selectFleetEnv()) }), + wakuDnsDiscovery(enrTree, { + store: 1, + filter: 2, + lightpush: 2, + }), ], }, }); @@ -215,15 +217,6 @@ async function initWaku(setter: (waku: WakuLight) => void) { } } -function selectFleetEnv() { - // Works with react-scripts - if (process?.env?.NODE_ENV === "development") { - return Fleet.Test; - } else { - return Fleet.Prod; - } -} - function reduceMessages(state: Message[], newMessages: Message[]) { return state.concat(newMessages); } diff --git a/examples/web-chat/src/types/types.d.ts b/examples/web-chat/src/types/types.d.ts index 6109448..8974887 100644 --- a/examples/web-chat/src/types/types.d.ts +++ b/examples/web-chat/src/types/types.d.ts @@ -1 +1,2 @@ declare module "@livechat/ui-kit"; +declare module "@waku/dns-discovery";