Merge pull request #106 from waku-org/js-waku-0.27.0

This commit is contained in:
fryorcraken.eth 2022-09-14 22:52:30 +10:00 committed by GitHub
commit 394635a049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 963 additions and 1596 deletions

View File

@ -10,7 +10,7 @@
"@material-ui/icons": "^4.11.2",
"ethers": "5.7.0",
"fontsource-roboto": "^4.0.0",
"js-waku": "0.26.0",
"js-waku": "0.27.0",
"protobufjs": "^7.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@ -14,7 +14,7 @@ specifiers:
eslint: ^8.9.0
ethers: 5.7.0
fontsource-roboto: ^4.0.0
js-waku: 0.26.0
js-waku: 0.27.0
npm-run-all: ^4.1.5
prettier: ^2.5.1
protobufjs: ^7.1.0
@ -31,7 +31,7 @@ dependencies:
'@material-ui/icons': 4.11.3_upnjamd3tbaukgopcqqdlc7jbm
ethers: 5.7.0
fontsource-roboto: 4.0.0
js-waku: 0.26.0_undici@5.10.0
js-waku: 0.27.0_undici@5.10.0
protobufjs: 7.1.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@ -47,7 +47,7 @@ devDependencies:
eslint: 8.21.0
npm-run-all: 4.1.5
prettier: 2.7.1
react-scripts: 5.0.1_e23e7evf6537qu7ubpbcii2cdu
react-scripts: 5.0.1_zqc2lflk57y5fs7vjdkkfoejyi
typescript: 4.8.2
packages:
@ -119,6 +119,11 @@ packages:
engines: {node: '>=6.9.0'}
dev: true
/@babel/compat-data/7.19.0:
resolution: {integrity: sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==}
engines: {node: '>=6.9.0'}
dev: true
/@babel/core/7.18.10:
resolution: {integrity: sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw==}
engines: {node: '>=6.9.0'}
@ -142,6 +147,29 @@ packages:
- supports-color
dev: true
/@babel/core/7.19.0:
resolution: {integrity: sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==}
engines: {node: '>=6.9.0'}
dependencies:
'@ampproject/remapping': 2.2.0
'@babel/code-frame': 7.18.6
'@babel/generator': 7.19.0
'@babel/helper-compilation-targets': 7.19.0_@babel+core@7.19.0
'@babel/helper-module-transforms': 7.19.0
'@babel/helpers': 7.19.0
'@babel/parser': 7.19.0
'@babel/template': 7.18.10
'@babel/traverse': 7.19.0
'@babel/types': 7.19.0
convert-source-map: 1.8.0
debug: 4.3.4
gensync: 1.0.0-beta.2
json5: 2.2.1
semver: 6.3.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/eslint-parser/7.18.9_xqt7ek4fk233nrovqiamjvck4u:
resolution: {integrity: sha512-KzSGpMBggz4fKbRbWLNyPVTuQr6cmCcBhOyXTw/fieOVaw5oYAwcAj4a7UKcDYCPxQq+CG1NCDZH9e2JTXquiQ==}
engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0}
@ -165,6 +193,15 @@ packages:
jsesc: 2.5.2
dev: true
/@babel/generator/7.19.0:
resolution: {integrity: sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.19.0
'@jridgewell/gen-mapping': 0.3.2
jsesc: 2.5.2
dev: true
/@babel/helper-annotate-as-pure/7.18.6:
resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==}
engines: {node: '>=6.9.0'}
@ -193,6 +230,19 @@ packages:
semver: 6.3.0
dev: true
/@babel/helper-compilation-targets/7.19.0_@babel+core@7.19.0:
resolution: {integrity: sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/compat-data': 7.19.0
'@babel/core': 7.19.0
'@babel/helper-validator-option': 7.18.6
browserslist: 4.21.3
semver: 6.3.0
dev: true
/@babel/helper-create-class-features-plugin/7.18.9_@babel+core@7.18.10:
resolution: {integrity: sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw==}
engines: {node: '>=6.9.0'}
@ -258,6 +308,14 @@ packages:
'@babel/types': 7.18.10
dev: true
/@babel/helper-function-name/7.19.0:
resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/template': 7.18.10
'@babel/types': 7.19.0
dev: true
/@babel/helper-hoist-variables/7.18.6:
resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==}
engines: {node: '>=6.9.0'}
@ -295,6 +353,22 @@ packages:
- supports-color
dev: true
/@babel/helper-module-transforms/7.19.0:
resolution: {integrity: sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-module-imports': 7.18.6
'@babel/helper-simple-access': 7.18.6
'@babel/helper-split-export-declaration': 7.18.6
'@babel/helper-validator-identifier': 7.18.6
'@babel/template': 7.18.10
'@babel/traverse': 7.19.0
'@babel/types': 7.19.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/helper-optimise-call-expression/7.18.6:
resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==}
engines: {node: '>=6.9.0'}
@ -307,6 +381,11 @@ packages:
engines: {node: '>=6.9.0'}
dev: true
/@babel/helper-plugin-utils/7.19.0:
resolution: {integrity: sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==}
engines: {node: '>=6.9.0'}
dev: true
/@babel/helper-remap-async-to-generator/7.18.9_@babel+core@7.18.10:
resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==}
engines: {node: '>=6.9.0'}
@ -394,6 +473,17 @@ packages:
- supports-color
dev: true
/@babel/helpers/7.19.0:
resolution: {integrity: sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/template': 7.18.10
'@babel/traverse': 7.19.0
'@babel/types': 7.19.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/highlight/7.18.6:
resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==}
engines: {node: '>=6.9.0'}
@ -411,6 +501,14 @@ packages:
'@babel/types': 7.18.10
dev: true
/@babel/parser/7.19.0:
resolution: {integrity: sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.19.0
dev: true
/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.18.10:
resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==}
engines: {node: '>=6.9.0'}
@ -708,6 +806,16 @@ packages:
'@babel/helper-plugin-utils': 7.18.9
dev: true
/@babel/plugin-syntax-flow/7.18.6_@babel+core@7.19.0:
resolution: {integrity: sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.19.0
'@babel/helper-plugin-utils': 7.18.9
dev: true
/@babel/plugin-syntax-import-assertions/7.18.6_@babel+core@7.18.10:
resolution: {integrity: sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ==}
engines: {node: '>=6.9.0'}
@ -746,6 +854,16 @@ packages:
'@babel/helper-plugin-utils': 7.18.9
dev: true
/@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.19.0:
resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.19.0
'@babel/helper-plugin-utils': 7.18.9
dev: true
/@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.18.10:
resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
peerDependencies:
@ -1154,6 +1272,20 @@ packages:
'@babel/types': 7.18.10
dev: true
/@babel/plugin-transform-react-jsx/7.19.0_@babel+core@7.19.0:
resolution: {integrity: sha512-UVEvX3tXie3Szm3emi1+G63jyw1w5IcMY0FSKM+CRnKRI5Mr1YbCNgsSTwoTwKphQEG9P+QqmuRFneJPZuHNhg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.19.0
'@babel/helper-annotate-as-pure': 7.18.6
'@babel/helper-module-imports': 7.18.6
'@babel/helper-plugin-utils': 7.19.0
'@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.0
'@babel/types': 7.19.0
dev: true
/@babel/plugin-transform-react-pure-annotations/7.18.6_@babel+core@7.18.10:
resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==}
engines: {node: '>=6.9.0'}
@ -1458,6 +1590,24 @@ packages:
- supports-color
dev: true
/@babel/traverse/7.19.0:
resolution: {integrity: sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.18.6
'@babel/generator': 7.19.0
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-function-name': 7.19.0
'@babel/helper-hoist-variables': 7.18.6
'@babel/helper-split-export-declaration': 7.18.6
'@babel/parser': 7.19.0
'@babel/types': 7.19.0
debug: 4.3.4
globals: 11.12.0
transitivePeerDependencies:
- supports-color
dev: true
/@babel/types/7.18.10:
resolution: {integrity: sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==}
engines: {node: '>=6.9.0'}
@ -1467,6 +1617,15 @@ packages:
to-fast-properties: 2.0.0
dev: true
/@babel/types/7.19.0:
resolution: {integrity: sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-string-parser': 7.18.10
'@babel/helper-validator-identifier': 7.18.6
to-fast-properties: 2.0.0
dev: true
/@bcoe/v8-coverage/0.2.3:
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
dev: true
@ -2847,8 +3006,8 @@ packages:
- supports-color
dev: false
/@libp2p/mplex/5.1.1_undici@5.10.0:
resolution: {integrity: sha512-a4hUUzHaFUmk6hx0lV6dveyOmHlOqB/MwDJJfIDyHvDILb2ZXGLJaI3JnbMYqPCwOCeSFkKu8Ixw5HphffV0Aw==}
/@libp2p/mplex/5.1.2_undici@5.10.0:
resolution: {integrity: sha512-PJcHwhUTXxtyG3lLjX9itBSPYuhReLn63KhJU8HsvFxi6KZC52mdOyDUuwMQr68QKcdZGP1K5sg5mRoC0U3PAw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/components': 2.0.4_undici@5.10.0
@ -6042,7 +6201,7 @@ packages:
source-map: 0.6.1
dev: true
/eslint-config-react-app/7.0.1_4xxghbdbtpkpzboxb63ap6m5cq:
/eslint-config-react-app/7.0.1_2ylqirllgycyymgyhdbcrjlvlu:
resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==}
engines: {node: '>=14.0.0'}
peerDependencies:
@ -6060,7 +6219,7 @@ packages:
babel-preset-react-app: 10.0.1
confusing-browser-globals: 1.0.11
eslint: 8.21.0
eslint-plugin-flowtype: 8.0.3_bfhyaeqlroxospgntnspvajiaq
eslint-plugin-flowtype: 8.0.3_v2k3klyshfzqdyz7lqhiiifqye
eslint-plugin-import: 2.26.0_wuikv5nqgdfyng42xxm7lklfmi
eslint-plugin-jest: 25.7.0_es3s5ega56ydzpv3u2fqyh4w34
eslint-plugin-jsx-a11y: 6.6.1_eslint@8.21.0
@ -6112,7 +6271,7 @@ packages:
- supports-color
dev: true
/eslint-plugin-flowtype/8.0.3_bfhyaeqlroxospgntnspvajiaq:
/eslint-plugin-flowtype/8.0.3_v2k3klyshfzqdyz7lqhiiifqye:
resolution: {integrity: sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==}
engines: {node: '>=12.0.0'}
peerDependencies:
@ -6120,8 +6279,8 @@ packages:
'@babel/plugin-transform-react-jsx': ^7.14.9
eslint: ^8.1.0
dependencies:
'@babel/plugin-syntax-flow': 7.18.6_@babel+core@7.18.10
'@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.10
'@babel/plugin-syntax-flow': 7.18.6_@babel+core@7.19.0
'@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.0
eslint: 8.21.0
lodash: 4.17.21
string-natural-compare: 3.0.1
@ -8284,8 +8443,8 @@ packages:
/js-tokens/4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
/js-waku/0.26.0_undici@5.10.0:
resolution: {integrity: sha512-BcgMeYj9wYGNt4fs3lFUSLpFqQttpju4FAmVbB19oYK1IWR8nGKu52eLAFBrh0uH3r73Ud9PXG3I1099THqlOQ==}
/js-waku/0.27.0_undici@5.10.0:
resolution: {integrity: sha512-uIh1h2Gu+aEyrGb4qmyk2Sc91in3fMfOil0kdtrps9HnA7ESbC5c6d148LeJaxqH5rfOkrfXXIhw1zwA3hlauw==}
engines: {node: '>=16'}
dependencies:
'@chainsafe/libp2p-gossipsub': 4.1.1_undici@5.10.0
@ -8297,8 +8456,9 @@ packages:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-peer-info': 1.0.2_undici@5.10.0
'@libp2p/interface-peer-store': 1.2.1_undici@5.10.0
'@libp2p/interface-pubsub': 2.0.1_undici@5.10.0
'@libp2p/interfaces': 3.0.3
'@libp2p/mplex': 5.1.1_undici@5.10.0
'@libp2p/mplex': 5.1.2_undici@5.10.0
'@libp2p/peer-id': 1.1.15
'@libp2p/websockets': 3.0.3_undici@5.10.0
'@multiformats/multiaddr': 10.4.0_undici@5.10.0
@ -10560,7 +10720,7 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/react-scripts/5.0.1_e23e7evf6537qu7ubpbcii2cdu:
/react-scripts/5.0.1_zqc2lflk57y5fs7vjdkkfoejyi:
resolution: {integrity: sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==}
engines: {node: '>=14.0.0'}
hasBin: true
@ -10588,7 +10748,7 @@ packages:
dotenv: 10.0.0
dotenv-expand: 5.1.0
eslint: 8.21.0
eslint-config-react-app: 7.0.1_4xxghbdbtpkpzboxb63ap6m5cq
eslint-config-react-app: 7.0.1_2ylqirllgycyymgyhdbcrjlvlu
eslint-webpack-plugin: 3.2.0_u2suxbtqimpjcabkd5w2ufy4qm
file-loader: 6.2.0_webpack@5.74.0
fs-extra: 10.1.0

View File

@ -2,7 +2,7 @@ import "@ethersproject/shims";
import React, { useEffect, useState } from "react";
import "./App.css";
import { Waku } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
import { KeyPair, PublicKeyMessageEncryptionKey } from "./crypto";
import { Message } from "./messaging/Messages";
import "fontsource-roboto";
@ -67,7 +67,7 @@ const useStyles = makeStyles({
});
function App() {
const [waku, setWaku] = useState<Waku>();
const [waku, setWaku] = useState<WakuLight>();
const [provider, setProvider] = useState<Web3Provider>();
const [encryptionKeyPair, setEncryptionKeyPair] = useState<
KeyPair | undefined

View File

@ -6,13 +6,14 @@ import {
PublicKeyMessageEncryptionKey,
} from "./crypto";
import { PublicKeyMessage } from "./messaging/wire";
import { WakuMessage, Waku } from "js-waku";
import { WakuMessage } from "js-waku";
import { WakuLight } from "js-waku/lib/interfaces";
import { PublicKeyContentTopic } from "./waku";
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
interface Props {
EncryptionKeyPair: KeyPair | undefined;
waku: Waku | undefined;
waku: WakuLight | undefined;
address: string | undefined;
signer: TypedDataSigner | undefined;
}

View File

@ -1,5 +1,5 @@
import Messages, { Message } from "./Messages";
import { Waku } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
import SendMessage from "./SendMessage";
import { makeStyles } from "@material-ui/core";
@ -13,7 +13,7 @@ const useStyles = makeStyles({
});
interface Props {
waku: Waku | undefined;
waku: WakuLight | undefined;
recipients: Map<string, Uint8Array>;
messages: Message[];
}

View File

@ -7,7 +7,8 @@ import {
TextField,
} from "@material-ui/core";
import React, { ChangeEvent, useState, KeyboardEvent } from "react";
import { utils, Waku, WakuMessage } from "js-waku";
import { utils, WakuMessage } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
import { PrivateMessage } from "./wire";
import { PrivateMessageContentTopic } from "../waku";
@ -22,7 +23,7 @@ const useStyles = makeStyles((theme) => ({
}));
export interface Props {
waku: Waku | undefined;
waku: WakuLight | undefined;
// address, public key
recipients: Map<string, Uint8Array>;
}
@ -120,7 +121,7 @@ async function encodeEncryptedWakuMessage(
}
function sendMessage(
waku: Waku,
waku: WakuLight,
recipientAddress: string,
recipientPublicKey: Uint8Array,
message: string,

View File

@ -1,22 +1,23 @@
import { Dispatch, SetStateAction } from "react";
import { Protocols, utils, Waku, WakuMessage } from "js-waku";
import { Protocols, utils, WakuMessage } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
import { PrivateMessage, PublicKeyMessage } from "./messaging/wire";
import { validatePublicKeyMessage } from "./crypto";
import { Message } from "./messaging/Messages";
import { equals } from "uint8arrays/equals";
import { createWaku } from "js-waku/lib/create_waku";
import { PeerDiscoveryStaticPeers } from "js-waku/lib/peer_discovery_static_list";
import {
getPredefinedBootstrapNodes,
Fleet,
} from "js-waku/lib/predefined_bootstrap_nodes";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
import { createLightNode } from "js-waku/lib/create_waku";
export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto";
export const PrivateMessageContentTopic = "/eth-pm/1/private-message/proto";
export async function initWaku(): Promise<Waku> {
const waku = await createWaku({
export async function initWaku(): Promise<WakuLight> {
const waku = await createLightNode({
libp2p: {
peerDiscovery: [
new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes(Fleet.Test)),

View File

@ -35,13 +35,13 @@
import {
utils,
WakuMessage
} from 'https://unpkg.com/js-waku@next/bundle/index.js';
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
import {
createLightNode
} from 'https://unpkg.com/js-waku@next/bundle/lib/create_waku.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
import {
waitForRemotePeer
} from 'https://unpkg.com/js-waku@next/bundle/lib/wait_for_remote_peer.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
const peerIdDiv = document.getElementById('peer-id');
const remotePeerIdDiv = document.getElementById('remote-peer-id');

View File

@ -21,12 +21,15 @@
"@angular/platform-browser": "~14.2.0",
"@angular/platform-browser-dynamic": "~14.2.0",
"@angular/router": "~14.2.0",
"js-waku": "0.24.0-f52dd9e",
"js-waku": "0.27.0",
"protobufjs": "^7.1.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.8"
},
"browser": {
"util": false
},
"devDependencies": {
"@angular-devkit/build-angular": "~14.2.1",
"@angular/cli": "~14.2.1",

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
import { Component, OnInit } from "@angular/core";
import { WakuService } from "../waku.service";
import { Waku, WakuMessage } from "js-waku";
import { WakuMessage } from "js-waku";
import type { WakuPrivacy } from "js-waku/lib/interfaces";
import protobuf from "protobufjs";
const ProtoChatMessage = new protobuf.Type("ChatMessage")
@ -21,7 +22,7 @@ export class MessagesComponent implements OnInit {
contentTopic: string = `/relay-angular-chat/1/chat/proto`;
messages: MessageInterface[] = [];
messageCount: number = 0;
waku!: Waku;
waku!: WakuPrivacy;
wakuStatus!: string;
constructor(private wakuService: WakuService) {}

View File

@ -1,14 +1,14 @@
import { Injectable } from "@angular/core";
import { Waku } from "js-waku";
import { BehaviorSubject, Subject } from "rxjs";
import { createWaku } from "js-waku/lib/create_waku";
import { createPrivacyNode } from "js-waku/lib/create_waku";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
import type { WakuPrivacy } from "js-waku/lib/interfaces.js";
@Injectable({
providedIn: "root",
})
export class WakuService {
private wakuSubject = new Subject<Waku>();
private wakuSubject = new Subject<WakuPrivacy>();
public waku = this.wakuSubject.asObservable();
private wakuStatusSubject = new BehaviorSubject("");
@ -17,7 +17,7 @@ export class WakuService {
constructor() {}
init() {
createWaku({ defaultBootstrap: true }).then((waku) => {
createPrivacyNode({ defaultBootstrap: true }).then((waku) => {
waku.start().then(() => {
this.wakuSubject.next(waku);
this.wakuStatusSubject.next("Connecting...");

View File

@ -28,13 +28,13 @@
import {
WakuMessage
} from 'https://unpkg.com/js-waku@0.26.0/bundle/index.js';
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
import {
createWaku
} from 'https://unpkg.com/js-waku@0.26.0/bundle/lib/create_waku.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
import {
waitForRemotePeer
} from 'https://unpkg.com/js-waku@0.26.0/bundle/lib/wait_for_remote_peer.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
const statusDiv = document.getElementById('status');
const messagesDiv = document.getElementById('messages');

View File

@ -7,7 +7,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"js-waku": "0.24.0-63bfb9b",
"js-waku": "0.27.0",
"protobufjs": "^7.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@ -19,6 +19,9 @@
"test": "exit 0",
"eject": "craco eject"
},
"browser": {
"crypto": false
},
"eslintConfig": {
"extends": [
"react-app",

File diff suppressed because it is too large Load Diff

View File

@ -1,115 +1,115 @@
import {WakuMessage, waitForRemotePeer} from "js-waku";
import { WakuMessage } from "js-waku";
import * as React from "react";
import protobuf from "protobufjs";
import {createWaku} from "js-waku/lib/create_waku";
import { createWaku } from "js-waku/lib/create_waku";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
const ContentTopic = `/relay-reactjs-chat/1/chat/proto`;
const SimpleChatMessage = new protobuf.Type("SimpleChatMessage")
.add(new protobuf.Field("timestamp", 1, "uint32"))
.add(new protobuf.Field("text", 2, "string"));
.add(new protobuf.Field("timestamp", 1, "uint32"))
.add(new protobuf.Field("text", 2, "string"));
function App() {
const [waku, setWaku] = React.useState(undefined);
const [wakuStatus, setWakuStatus] = React.useState("None");
// Using a counter just for the messages to be different
const [sendCounter, setSendCounter] = React.useState(0);
const [messages, setMessages] = React.useState([]);
const [waku, setWaku] = React.useState(undefined);
const [wakuStatus, setWakuStatus] = React.useState("None");
// Using a counter just for the messages to be different
const [sendCounter, setSendCounter] = React.useState(0);
const [messages, setMessages] = React.useState([]);
React.useEffect(() => {
if (!!waku) return;
if (wakuStatus !== "None") return;
React.useEffect(() => {
if (!!waku) return;
if (wakuStatus !== "None") return;
setWakuStatus("Starting");
(async () => {
setWakuStatus("Starting");
(async () => {
const waku = await createWaku({ defaultBootstrap: true });
const waku = await createWaku({defaultBootstrap: true})
setWaku(waku);
await waku.start();
setWakuStatus("Connecting");
await waitForRemotePeer(waku, ["relay"]);
setWakuStatus("Ready");
})();
}, [waku, wakuStatus]);
setWaku(waku);
await waku.start();
setWakuStatus("Connecting");
await waitForRemotePeer(waku, ["relay"]);
setWakuStatus("Ready");
})();
}, [waku, wakuStatus]);
const processIncomingMessage = React.useCallback((wakuMessage) => {
if (!wakuMessage.payload) return;
const processIncomingMessage = React.useCallback((wakuMessage) => {
if (!wakuMessage.payload) return;
const { text, timestamp } = SimpleChatMessage.decode(wakuMessage.payload);
const {text, timestamp} = SimpleChatMessage.decode(wakuMessage.payload);
const time = new Date();
const time = new Date();
time.setTime(timestamp);
const message = { text, timestamp: time };
time.setTime(timestamp);
const message = {text, timestamp: time};
setMessages((messages) => {
return [message].concat(messages);
});
}, []);
setMessages((messages) => {
return [message].concat(messages);
});
}, []);
React.useEffect(() => {
if (!waku) return;
React.useEffect(() => {
if (!waku) return;
// Pass the content topic to only process messages related to your dApp
waku.relay.addObserver(processIncomingMessage, [ContentTopic]);
// Pass the content topic to only process messages related to your dApp
waku.relay.addObserver(processIncomingMessage, [ContentTopic]);
// `cleanUp` is called when the component is unmounted, see ReactJS doc.
return function cleanUp() {
waku.relay.deleteObserver(processIncomingMessage, [ContentTopic]);
};
}, [waku, wakuStatus, processIncomingMessage]);
const sendMessageOnClick = () => {
// Check Waku is started and connected first.
if (wakuStatus !== "Ready") return;
sendMessage(`Here is message #${sendCounter}`, waku, new Date()).then(() =>
console.log("Message sent")
);
// For demonstration purposes.
setSendCounter(sendCounter + 1);
// `cleanUp` is called when the component is unmounted, see ReactJS doc.
return function cleanUp() {
waku.relay.deleteObserver(processIncomingMessage, [ContentTopic]);
};
}, [waku, wakuStatus, processIncomingMessage]);
return (
<div className="App">
<header className="App-header">
<p>{wakuStatus}</p>
<button onClick={sendMessageOnClick} disabled={wakuStatus !== "Ready"}>
Send Message
</button>
<ul>
{messages.map((msg) => {
return (
<li key={msg.timestamp.valueOf()}>
<p>
{msg.timestamp.toString()}: {msg.text}
</p>
</li>
);
})}
</ul>
</header>
</div>
const sendMessageOnClick = () => {
// Check Waku is started and connected first.
if (wakuStatus !== "Ready") return;
sendMessage(`Here is message #${sendCounter}`, waku, new Date()).then(() =>
console.log("Message sent")
);
// For demonstration purposes.
setSendCounter(sendCounter + 1);
};
return (
<div className="App">
<header className="App-header">
<p>{wakuStatus}</p>
<button onClick={sendMessageOnClick} disabled={wakuStatus !== "Ready"}>
Send Message
</button>
<ul>
{messages.map((msg) => {
return (
<li key={msg.timestamp.valueOf()}>
<p>
{msg.timestamp.toString()}: {msg.text}
</p>
</li>
);
})}
</ul>
</header>
</div>
);
}
function sendMessage(message, waku, timestamp) {
const time = timestamp.getTime();
const time = timestamp.getTime();
// Encode to protobuf
const protoMsg = SimpleChatMessage.create({
timestamp: time,
text: message,
});
const payload = SimpleChatMessage.encode(protoMsg).finish();
// Encode to protobuf
const protoMsg = SimpleChatMessage.create({
timestamp: time,
text: message,
});
const payload = SimpleChatMessage.encode(protoMsg).finish();
// Wrap in a Waku Message
return WakuMessage.fromBytes(payload, ContentTopic).then((wakuMessage) =>
// Send over Waku Relay
waku.relay.send(wakuMessage)
);
// Wrap in a Waku Message
return WakuMessage.fromBytes(payload, ContentTopic).then((wakuMessage) =>
// Send over Waku Relay
waku.relay.send(wakuMessage)
);
}
export default App;

View File

@ -15,13 +15,13 @@
<script type='module'>
import {
Protocols
} from 'https://unpkg.com/js-waku@0.26.0/bundle/index.js';
} from 'https://unpkg.com/js-waku@0.27.0/bundle/index.js';
import {
createWaku
} from 'https://unpkg.com/js-waku@0.26.0/bundle/lib/create_waku.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/create_waku.js'
import {
waitForRemotePeer
} from 'https://unpkg.com/js-waku@0.26.0/bundle/lib/wait_for_remote_peer.js'
} from 'https://unpkg.com/js-waku@0.27.0/bundle/lib/wait_for_remote_peer.js'
/**
* This example demonstrates how to use the js-waku minified bundle

View File

@ -7,7 +7,7 @@
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/user-event": "^14.1.1",
"js-waku": "0.24.0-e3bef47",
"js-waku": "0.27.0",
"protobufjs": "^7.1.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",

View File

@ -5,7 +5,7 @@ specifiers:
'@testing-library/jest-dom': ^5.16.4
'@testing-library/react': ^13.2.0
'@testing-library/user-event': ^14.1.1
js-waku: 0.24.0-e3bef47
js-waku: 0.27.0
protobufjs: ^7.1.0
react: ^18.1.0
react-dom: ^18.1.0
@ -17,7 +17,7 @@ dependencies:
'@testing-library/jest-dom': 5.16.5
'@testing-library/react': 13.3.0_biqbaboplfbrettd7655fr4n2y
'@testing-library/user-event': 14.4.2_znfriv3ismgf3ybh2woqwlpfea
js-waku: 0.24.0-e3bef47_typescript@4.7.4
js-waku: 0.27.0
protobufjs: 7.1.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@ -1450,21 +1450,21 @@ packages:
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
dev: false
/@chainsafe/libp2p-gossipsub/3.5.1_typescript@4.7.4:
resolution: {integrity: sha512-nPK0XHVQPpTUxox9vz4kGbYTNYZXl7Nu8E7riNvITvWjYDAV/8BEj0+Yu8aToCgVCz3aiUqzeLZ5lURViHefmw==}
/@chainsafe/libp2p-gossipsub/4.1.1:
resolution: {integrity: sha512-W3z52uTVm48qvwTAcE+tz6ML2CPWA4ErmuL2aCWAW8S7ce6iH8anqo+xI9rcedyIOChWMWLLD4Gtaj4TMrWacw==}
engines: {npm: '>=8.7.0'}
dependencies:
'@libp2p/components': 2.0.4
'@libp2p/crypto': 1.0.4
'@libp2p/interface-connection': 2.1.1
'@libp2p/interface-connection': 3.0.1
'@libp2p/interface-keys': 1.0.3
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-pubsub': 1.0.4
'@libp2p/interface-registrar': 2.0.2
'@libp2p/interface-pubsub': 2.0.1
'@libp2p/interface-registrar': 2.0.3
'@libp2p/interfaces': 3.0.3
'@libp2p/logger': 2.0.1
'@libp2p/peer-id': 1.1.15
'@libp2p/peer-record': 2.0.0_typescript@4.7.4
'@libp2p/peer-record': 4.0.2
'@libp2p/pubsub': 3.1.2
'@libp2p/topology': 3.0.0
abortable-iterator: 4.0.2
@ -1478,25 +1478,19 @@ packages:
uint8arraylist: 2.3.2
uint8arrays: 3.1.0
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- '@types/node'
- mocha
- supports-color
- typescript
- undici
dev: false
/@chainsafe/libp2p-noise/7.0.3:
resolution: {integrity: sha512-kr68a6zEC2y1sp9O1i8MlPu7LgC4U1sLciG/SF9Hvo0kOdDa5a13l3Il9R3rTIqaL9DoVfmQhfpOR/cxY2PWUw==}
/@chainsafe/libp2p-noise/8.0.1:
resolution: {integrity: sha512-mr1/CMTBIfraqTY4OWBdmJ2v+0+D89vbIp1nJTHz64oDPRgU0Ah8wb7K5hgs0erU8aYMkgMtbhXeouhJK3A7wA==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/crypto': 1.0.4
'@libp2p/interface-connection-encrypter': 1.0.3
'@libp2p/interface-connection-encrypter': 2.0.1
'@libp2p/interface-keys': 1.0.3
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/logger': 2.0.1
'@libp2p/peer-collections': 2.0.0
'@libp2p/peer-id': 1.1.15
'@stablelib/chacha20poly1305': 1.0.1
'@stablelib/hkdf': 1.0.1
@ -1507,20 +1501,13 @@ packages:
it-pb-stream: 2.0.2
it-pipe: 2.0.4
it-stream-types: 1.0.4
protons-runtime: 2.0.2
protons-runtime: 3.1.0
uint8arraylist: 2.3.2
uint8arrays: 3.1.0
transitivePeerDependencies:
- supports-color
dev: false
/@cspotcode/source-map-support/0.8.1:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/trace-mapping': 0.3.9
dev: false
/@csstools/normalize.css/12.0.0:
resolution: {integrity: sha512-M0qqxAcwCsIVfpFQSlGN5XjXWu8l5JDZN+fPt1LeW5SZexQTgnaEvgXAY+CeygRw0EeppWHi12JxESWiWrB0Sg==}
dev: false
@ -2006,13 +1993,6 @@ packages:
'@jridgewell/sourcemap-codec': 1.4.14
dev: false
/@jridgewell/trace-mapping/0.3.9:
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
dependencies:
'@jridgewell/resolve-uri': 3.1.0
'@jridgewell/sourcemap-codec': 1.4.14
dev: false
/@leichtgewicht/base64-codec/1.0.0:
resolution: {integrity: sha512-0cgP4lRBzh3F4tlpTfs7F+PJyBN8j5yUC9KrQFWp/bREswgzZVHE8T1rNyRDWgvALwwpPtnJDQfqWUmxI33Epg==}
dev: false
@ -2072,7 +2052,7 @@ packages:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interfaces': 3.0.3
'@libp2p/logger': 2.0.1
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
err-code: 3.0.1
transitivePeerDependencies:
- supports-color
@ -2098,20 +2078,12 @@ packages:
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interfaces': 3.0.3
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interface-connection-encrypter/1.0.3:
resolution: {integrity: sha512-3HNg52HmanRuV2rbQRMFUVTPceSqoC1+ifK9Jkqw3mbiTXXf1mdsv5uKbqts6QvNY5ABZeQWuqJb2QqibaI0mw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
it-stream-types: 1.0.4
dev: false
/@libp2p/interface-connection-encrypter/2.0.1:
resolution: {integrity: sha512-GtqsNJuL1q7LWX3z41t9eFFFrlLSmMH92E0rupoXeFx1dJ8Gs/Zy8b6lZro96Ld6rjU1CeZa87SmYeqQQeHRmw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2133,26 +2105,13 @@ packages:
- undici
dev: false
/@libp2p/interface-connection/2.1.1:
resolution: {integrity: sha512-gjugaMsZvfo3r4tCc/yPifVQsfLogmEmJtW+eXMNiNDna3ZfmwWD9Z+KyEwuVsXKs0C4GESXei2y4SJSCEfkbA==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interfaces': 3.0.3
'@multiformats/multiaddr': 10.3.3
it-stream-types: 1.0.4
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interface-connection/3.0.1:
resolution: {integrity: sha512-x+Ws74EhxvSym2fTQMP8/xpV3p8A3ar8yOq4dq/44HSvEMMKcuQvEq2jShVK0aXEpg1ce/KHY83FgY1zToFM2A==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interfaces': 3.0.3
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
it-stream-types: 1.0.4
uint8arraylist: 2.3.2
transitivePeerDependencies:
@ -2222,7 +2181,7 @@ packages:
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
transitivePeerDependencies:
- supports-color
- undici
@ -2248,20 +2207,7 @@ packages:
'@libp2p/interface-peer-info': 1.0.2
'@libp2p/interface-record': 2.0.1
'@libp2p/interfaces': 3.0.3
'@multiformats/multiaddr': 10.3.3
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interface-pubsub/1.0.4:
resolution: {integrity: sha512-BSkt0h4fbBBHcr3LCF7fTtAoCdQBjKbTGxCa4tIJpI3m5suxC5h6OrLC2rmrexOxR9aZRkr9da4VShRyOfRLag==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-connection': 2.1.1
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interfaces': 3.0.3
it-pushable: 3.1.0
'@multiformats/multiaddr': 10.4.3
transitivePeerDependencies:
- supports-color
- undici
@ -2281,13 +2227,6 @@ packages:
- undici
dev: false
/@libp2p/interface-record/1.0.2:
resolution: {integrity: sha512-bYNxKtsUOsNucHeAXCZbAQxFXwR7JvoOmodwEByriMvTWYRbd6d8rm8VHZ/17QgdRFlIwNnpIPuoyyLQ8Wn1rQ==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
dev: false
/@libp2p/interface-record/2.0.1:
resolution: {integrity: sha512-RqF5jKukI8v3Q8MZb4d8/UVjg0OXbl0R8ErWi/LKf+uklA8kTA7rT4FQXFUBycxrkFmEu/tJnW+R1/4fwRwZVg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2296,17 +2235,6 @@ packages:
uint8arraylist: 2.3.2
dev: false
/@libp2p/interface-registrar/2.0.2:
resolution: {integrity: sha512-HqDQua9J6T9KzrdYA9EhYsI0oc4CeSR1sfi0qdk073/IB3SlP+XtD7RzzVuGeyXjssqZtqf3RwjV7C+zOlHYlw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-connection': 2.1.1
'@libp2p/interface-peer-id': 1.0.4
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interface-registrar/2.0.3:
resolution: {integrity: sha512-YA/A+o+166/+noXxMFXvZdg9soZSZX2EPOlUwnGXZWR7J5B2sxyP76QxHWXL5npsEMj7suP+Rjb/GJYGz7rDyg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2336,46 +2264,18 @@ packages:
dependencies:
'@libp2p/interface-connection': 3.0.1
'@libp2p/interfaces': 3.0.3
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
it-stream-types: 1.0.4
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interfaces/2.0.4:
resolution: {integrity: sha512-MfwkTFyHJtvwNxkjOjzkXyIVvKFtEW2Q3IGRJPyPQMrtB6ll0rGMTlyJ3BQS1bcD0YkNhggFm+8XiU2/0LCBhQ==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@multiformats/multiaddr': 10.3.3
err-code: 3.0.1
interface-datastore: 6.1.1
it-pushable: 2.0.2
it-stream-types: 1.0.4
multiformats: 9.7.1
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/interfaces/3.0.3:
resolution: {integrity: sha512-8IIxw7TKpaYTtVfZN3jePLlm/E/VzqPpqerN+jhA+1s86akRSeyxVBYi3W9SWDSf0oIauHJSDE8KNxLceAfeag==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dev: false
/@libp2p/logger/1.1.6:
resolution: {integrity: sha512-ZKoRUt7cyHlbxHYDZ1Fn3A+ByqGABdmd4z07+1TfVvpEQSpn2IVcV0mt6ff5kUUtGuVeSrqK1/ZDzWqhgg56vg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interfaces': 2.0.4
debug: 4.3.4
interface-datastore: 6.1.1
multiformats: 9.7.1
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@libp2p/logger/2.0.1:
resolution: {integrity: sha512-Mtj7ImjRYbaANuT53QRqc7ooBYpWieLo7KbqYYGas5O2AWQeOu/zyGBMM35WbWIo7sMuhCas9XBPJdFOR7A05w==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2388,12 +2288,12 @@ packages:
- supports-color
dev: false
/@libp2p/mplex/4.0.3:
resolution: {integrity: sha512-G55n6bC4N7Biy4C6KaAlBfaOAgPFeKEspfQqKVHaUfeE4rmS156hiWCcy1YBZsGHvO7XFCt8IddCkzShStS+6w==}
/@libp2p/mplex/5.2.2:
resolution: {integrity: sha512-e0EVsOYMiXGiOkLVsGkhg9J/7SWVWMGHhCBvEH4N+s07UEBH/fl+8wgNFyMb8SrdAD2CUP4yaULAMRgUqY4j4Q==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/components': 2.0.4
'@libp2p/interface-connection': 2.1.1
'@libp2p/interface-connection': 3.0.1
'@libp2p/interface-stream-muxer': 2.0.2
'@libp2p/logger': 2.0.1
'@libp2p/tracked-map': 2.0.2
@ -2403,6 +2303,7 @@ packages:
it-pipe: 2.0.4
it-pushable: 3.1.0
it-stream-types: 1.0.4
rate-limiter-flexible: 2.3.10
uint8arraylist: 2.3.2
uint8arrays: 3.1.0
varint: 6.0.0
@ -2465,38 +2366,6 @@ packages:
uint8arrays: 3.1.0
dev: false
/@libp2p/peer-record/2.0.0_typescript@4.7.4:
resolution: {integrity: sha512-MHo626kUS54fcA1z6ZimBwvISoLkcZqg1RHxGWgs8x4a9G01VX2QgqD/5oBMzlTrDi0OKuClu3oHdqoFzH5x3Q==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/crypto': 1.0.4
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-record': 1.0.2
'@libp2p/logger': 1.1.6
'@libp2p/peer-id': 1.1.15
'@libp2p/utils': 1.0.10_typescript@4.7.4
'@multiformats/multiaddr': 10.3.3
err-code: 3.0.1
interface-datastore: 6.1.1
it-all: 1.0.6
it-filter: 1.0.3
it-foreach: 0.1.1
it-map: 1.0.6
it-pipe: 2.0.4
multiformats: 9.7.1
protons-runtime: 1.0.4
uint8arrays: 3.1.0
varint: 6.0.0
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- '@types/node'
- mocha
- supports-color
- typescript
- undici
dev: false
/@libp2p/peer-record/4.0.2:
resolution: {integrity: sha512-r1arc73ADcLd9sESNy7bDHPAsv3JYvIV7kXjB13wQJAQ1oeu9e0I6f1MAIWt4ZukNAiRD8gdlrRvNG63AAZfOg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2507,7 +2376,7 @@ packages:
'@libp2p/logger': 2.0.1
'@libp2p/peer-id': 1.1.15
'@libp2p/utils': 3.0.1
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
err-code: 3.0.1
interface-datastore: 7.0.0
it-all: 1.0.6
@ -2539,7 +2408,7 @@ packages:
'@libp2p/logger': 2.0.1
'@libp2p/peer-id': 1.1.15
'@libp2p/peer-record': 4.0.2
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
err-code: 3.0.1
interface-datastore: 7.0.0
it-all: 1.0.6
@ -2566,13 +2435,13 @@ packages:
'@libp2p/interface-connection': 3.0.1
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-pubsub': 2.0.1
'@libp2p/interface-registrar': 2.0.2
'@libp2p/interface-registrar': 2.0.3
'@libp2p/interfaces': 3.0.3
'@libp2p/logger': 2.0.1
'@libp2p/peer-collections': 2.0.0
'@libp2p/peer-id': 1.1.15
'@libp2p/topology': 3.0.0
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
abortable-iterator: 4.0.2
err-code: 3.0.1
it-length-prefixed: 8.0.2
@ -2592,9 +2461,9 @@ packages:
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-registrar': 2.0.2
'@libp2p/interface-registrar': 2.0.3
'@libp2p/logger': 2.0.1
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
err-code: 3.0.1
it-all: 1.0.6
transitivePeerDependencies:
@ -2609,30 +2478,6 @@ packages:
'@libp2p/interface-metrics': 3.0.0
dev: false
/@libp2p/utils/1.0.10_typescript@4.7.4:
resolution: {integrity: sha512-jlVLfac1IoBlgXL8V+XZYxNw0SOAkKweiLhXWolUbKOgRtMDquJzbwG1n8y9GtdiFKPlkiBwOB7l9xighcOR6w==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@achingbrain/ip-address': 8.1.0
'@libp2p/logger': 1.1.6
'@multiformats/multiaddr': 10.3.3
abortable-iterator: 4.0.2
err-code: 3.0.1
is-loopback-addr: 2.0.1
it-stream-types: 1.0.4
private-ip: 2.3.3
ts-mocha: 9.0.2
ts-node: 10.9.1_typescript@4.7.4
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- '@types/node'
- mocha
- supports-color
- typescript
- undici
dev: false
/@libp2p/utils/3.0.1:
resolution: {integrity: sha512-qc1zGBb6Yrl/ihux8qmy+T3H9BymVGiZeam8b/Dr4jpHxV4mfYwySYXUxa6LZqhDp0WS2Es9B1v1UtsNRY5YxA==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -2641,7 +2486,7 @@ packages:
'@libp2p/interface-connection': 3.0.1
'@libp2p/interface-peer-store': 1.2.1
'@libp2p/logger': 2.0.1
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
abortable-iterator: 4.0.2
err-code: 3.0.1
is-loopback-addr: 2.0.1
@ -2653,8 +2498,8 @@ packages:
- undici
dev: false
/@libp2p/websockets/3.0.2:
resolution: {integrity: sha512-hC8sNK7A8EkCkUaDMf56idAadoN1lteFpSsZo4GUKeYmClBpPf116tntIR4HN8SgnQ4ssPG6y9zkqGFcOtviCg==}
/@libp2p/websockets/3.0.3:
resolution: {integrity: sha512-fGbXpbyJaToA3Opc/lyw3C2xGlhDiabwQeQE6bTNTCpCFsBwOq8DwE4J++lkxnvJzKu0D4oC1c7oQrQ+4oq1Fw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@libp2p/interface-connection': 3.0.1
@ -2663,14 +2508,14 @@ packages:
'@libp2p/logger': 2.0.1
'@libp2p/utils': 3.0.1
'@multiformats/mafmt': 11.0.2
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
'@multiformats/multiaddr-to-uri': 9.0.1
abortable-iterator: 4.0.2
err-code: 3.0.1
it-ws: 5.0.2
p-defer: 4.0.0
p-timeout: 6.0.0
wherearewe: 1.0.2
wherearewe: 2.0.1
transitivePeerDependencies:
- bufferutil
- supports-color
@ -2681,7 +2526,7 @@ packages:
/@multiformats/mafmt/11.0.2:
resolution: {integrity: sha512-KesMM4fSEpMz1kZPzlvdwYNYrq5iH38S5EDKLu5qsGG4NT94UaruTjase9osaDW+CcDfshK9uZUD9lzpXJGreA==}
dependencies:
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
transitivePeerDependencies:
- supports-color
- undici
@ -2690,19 +2535,19 @@ packages:
/@multiformats/multiaddr-to-uri/9.0.1:
resolution: {integrity: sha512-kSyHZ2lKjoEzHu/TM4ZVwFj4AWV1B9qFBFJjYb/fK1NqrnrNb/M3uhoyckJvP7WZvpDsnEc7fUCpmPipDY6LMw==}
dependencies:
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
transitivePeerDependencies:
- supports-color
- undici
dev: false
/@multiformats/multiaddr/10.3.3:
resolution: {integrity: sha512-+LX9RovG7DJsANb+U6VchV/tApcdJzeafbi5+MPUam90oL91BbEh6ozNZOz4Qf5ZEeilexc12oomatmODJh1/w==}
/@multiformats/multiaddr/10.4.3:
resolution: {integrity: sha512-yHhYKOnzvjxyF5xMwbHFI9hBi0xQIa6y0dnTlOUs+CKsJCn8NfwznCjXmW7HH0IIiFobJGgs3UNY0bWLWIrqWw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
dns-over-http-resolver: 2.1.0
err-code: 3.0.1
is-ip: 4.0.0
is-ip: 5.0.0
multiformats: 9.7.1
uint8arrays: 3.1.0
varint: 6.0.0
@ -3176,22 +3021,6 @@ packages:
engines: {node: '>=10.13.0'}
dev: false
/@tsconfig/node10/1.0.9:
resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
dev: false
/@tsconfig/node12/1.0.11:
resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
dev: false
/@tsconfig/node14/1.0.3:
resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
dev: false
/@tsconfig/node16/1.0.3:
resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==}
dev: false
/@types/aria-query/4.2.2:
resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==}
@ -3771,11 +3600,6 @@ packages:
engines: {node: '>=0.4.0'}
dev: false
/acorn-walk/8.2.0:
resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
engines: {node: '>=0.4.0'}
dev: false
/acorn/7.4.1:
resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
engines: {node: '>=0.4.0'}
@ -3904,10 +3728,6 @@ packages:
picomatch: 2.3.1
dev: false
/arg/4.1.3:
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
dev: false
/arg/5.0.2:
resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
dev: false
@ -3989,11 +3809,6 @@ packages:
is-string: 1.0.7
dev: false
/arrify/1.0.1:
resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==}
engines: {node: '>=0.10.0'}
dev: false
/asap/2.0.6:
resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
dev: false
@ -4482,6 +4297,13 @@ packages:
wrap-ansi: 7.0.0
dev: false
/clone-regexp/3.0.0:
resolution: {integrity: sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==}
engines: {node: '>=12'}
dependencies:
is-regexp: 3.1.0
dev: false
/co/4.6.0:
resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==}
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
@ -4606,6 +4428,11 @@ packages:
engines: {node: '>= 0.6'}
dev: false
/convert-hrtime/5.0.0:
resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==}
engines: {node: '>=12'}
dev: false
/convert-source-map/1.8.0:
resolution: {integrity: sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==}
dependencies:
@ -4664,10 +4491,6 @@ packages:
yaml: 1.10.2
dev: false
/create-require/1.1.1:
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
dev: false
/cross-spawn/7.0.3:
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
engines: {node: '>= 8'}
@ -5093,16 +4916,6 @@ packages:
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
dev: false
/diff/3.5.0:
resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==}
engines: {node: '>=0.3.1'}
dev: false
/diff/4.0.2:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
dev: false
/dir-glob/3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
@ -6098,6 +5911,11 @@ packages:
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
dev: false
/function-timeout/0.1.1:
resolution: {integrity: sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==}
engines: {node: '>=14.16'}
dev: false
/function.prototype.name/1.1.5:
resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==}
engines: {node: '>= 0.4'}
@ -6542,14 +6360,6 @@ packages:
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
dev: false
/interface-datastore/6.1.1:
resolution: {integrity: sha512-AmCS+9CT34pp2u0QQVXjKztkuq3y5T+BIciuiHDDtDZucZD8VudosnSdUyXJV6IsRkN5jc4RFDhCk1O6Q3Gxjg==}
dependencies:
interface-store: 2.0.2
nanoid: 3.3.4
uint8arrays: 3.1.0
dev: false
/interface-datastore/7.0.0:
resolution: {integrity: sha512-q9OveOhexQ3Fx8h4YbuR4mZtUHwvlOynKnIwTm6x8oBTWfIyAKtlYtrOYdlHfqQztbYpdzRFcapopNJBMx36NQ==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -6559,10 +6369,6 @@ packages:
uint8arrays: 3.1.0
dev: false
/interface-store/2.0.2:
resolution: {integrity: sha512-rScRlhDcz6k199EkHqT8NpM87ebN89ICOzILoBHgaG36/WX50N32BnU/kpZgCGPLhARRAWUUX5/cyaIjt7Kipg==}
dev: false
/interface-store/3.0.0:
resolution: {integrity: sha512-IBJn3hE6hYutwdDcStR76mcwfV98vZc49LkEN9ANHHpsxcm6YbGMJxowO2G3FITU4U5ZH4KJPlHOT6Oe2vzTWA==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -6679,11 +6485,12 @@ packages:
ip-regex: 4.3.0
dev: false
/is-ip/4.0.0:
resolution: {integrity: sha512-4B4XA2HEIm/PY+OSpeMBXr8pGWBYbXuHgjMAqrwbLO3CPTCAd9ArEJzBUKGZtk9viY6+aSfadGnWyjY3ydYZkw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
/is-ip/5.0.0:
resolution: {integrity: sha512-uhmKwcdWJ1nTmBdoBxdHilfJs4qdLBIvVHKRels2+UCZmfcfefuQWziadaYLpN7t/bUrJOjJHv+R1di1q7Q1HQ==}
engines: {node: '>=14.16'}
dependencies:
ip-regex: 5.0.0
super-regex: 0.2.0
dev: false
/is-loopback-addr/2.0.1:
@ -6743,6 +6550,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: false
/is-regexp/3.1.0:
resolution: {integrity: sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==}
engines: {node: '>=12'}
dev: false
/is-root/2.1.0:
resolution: {integrity: sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==}
engines: {node: '>=6'}
@ -6880,16 +6692,6 @@ packages:
uint8arraylist: 2.3.2
dev: false
/it-length-prefixed/7.0.1:
resolution: {integrity: sha512-UozKoT0zZPUa0LO9OSq5KaLKPn83U7Vsy/BNAN0TUXfTI/pKrOz6RuyTSOok6NDad12FZsShBGnl9DKlfDT95g==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
err-code: 3.0.1
it-stream-types: 1.0.4
uint8arraylist: 1.6.0
varint: 6.0.0
dev: false
/it-length-prefixed/8.0.2:
resolution: {integrity: sha512-qYCGZ6lTaI6lcuTXUrJmVpE6clq63ULrkq1FGTxHrzexjB2cCrS/CZ5HCRDZ5IRPw33tSDUDK91S7X5S64dPyQ==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -6944,10 +6746,6 @@ packages:
fast-fifo: 1.1.0
dev: false
/it-pushable/2.0.2:
resolution: {integrity: sha512-f/n6HqXGDbHvuMR/3UN+S6W4y/bS1Pxg6Lb0oVc5dbflxy5f3NKkizKs86B8vzqHnB9hm1YpE0pgcEvI3FKDQw==}
dev: false
/it-pushable/3.1.0:
resolution: {integrity: sha512-sEAdT86u6aIWvLkH4hlOmgvHpRyUOUG22HD365H+Dh67zYpaPdILmT4Om7Wjdb+m/SjEB81z3nYCoIrgVYpOFA==}
dev: false
@ -7577,12 +7375,12 @@ packages:
/js-tokens/4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
/js-waku/0.24.0-e3bef47_typescript@4.7.4:
resolution: {integrity: sha512-TWZvQJuVBVDlBJfbyXBQGj5TyIXgPN3liM3PD8xDmMy9p8Fdn7KFpdjGdUho3ANLXRiOEpwCSGjO7OvFPH/87A==}
/js-waku/0.27.0:
resolution: {integrity: sha512-uIh1h2Gu+aEyrGb4qmyk2Sc91in3fMfOil0kdtrps9HnA7ESbC5c6d148LeJaxqH5rfOkrfXXIhw1zwA3hlauw==}
engines: {node: '>=16'}
dependencies:
'@chainsafe/libp2p-gossipsub': 3.5.1_typescript@4.7.4
'@chainsafe/libp2p-noise': 7.0.3
'@chainsafe/libp2p-gossipsub': 4.1.1
'@chainsafe/libp2p-noise': 8.0.1
'@ethersproject/rlp': 5.6.1
'@libp2p/crypto': 1.0.4
'@libp2p/interface-connection': 3.0.1
@ -7590,32 +7388,29 @@ packages:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-peer-info': 1.0.2
'@libp2p/interface-peer-store': 1.2.1
'@libp2p/interface-pubsub': 2.0.1
'@libp2p/interfaces': 3.0.3
'@libp2p/mplex': 4.0.3
'@libp2p/mplex': 5.2.2
'@libp2p/peer-id': 1.1.15
'@libp2p/websockets': 3.0.2
'@multiformats/multiaddr': 10.3.3
'@libp2p/websockets': 3.0.3
'@multiformats/multiaddr': 10.4.3
'@noble/secp256k1': 1.6.3
debug: 4.3.4
dns-query: 0.11.2
hi-base32: 0.5.1
it-all: 1.0.6
it-length-prefixed: 7.0.1
it-length-prefixed: 8.0.2
it-pipe: 2.0.4
js-sha3: 0.8.0
libp2p: 0.38.0-0e7096d
libp2p: 0.38.0
p-event: 5.0.1
protons-runtime: 1.0.4
protons-runtime: 3.1.0
uint8arraylist: 2.3.2
uint8arrays: 3.1.0
uuid: 8.3.2
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- '@types/node'
- bufferutil
- mocha
- supports-color
- typescript
- undici
- utf-8-validate
dev: false
@ -7792,8 +7587,8 @@ packages:
type-check: 0.4.0
dev: false
/libp2p/0.38.0-0e7096d:
resolution: {integrity: sha512-OrdnREspiwmgFdd2WagZcwZsRnks/EwWOTOql2Kg5cmpdbrGP/SEElbC/kUiYIQVVj8PjA4HQhxyD0q8wFGm9w==}
/libp2p/0.38.0:
resolution: {integrity: sha512-Wi/ptR69M5LuOrH8hwno98Dg/YeaDXmsyN2cd3vx/yuaEdcgz1RPdGtxxpyVP6J63eZbH07MYTvQcQHH5VhTkA==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
'@achingbrain/nat-port-mapper': 1.0.7
@ -7826,7 +7621,7 @@ packages:
'@libp2p/tracked-map': 2.0.2
'@libp2p/utils': 3.0.1
'@multiformats/mafmt': 11.0.2
'@multiformats/multiaddr': 10.3.3
'@multiformats/multiaddr': 10.4.3
abortable-iterator: 4.0.2
any-signal: 3.0.1
datastore-core: 8.0.1
@ -8004,10 +7799,6 @@ packages:
semver: 6.3.0
dev: false
/make-error/1.3.6:
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
dev: false
/makeerror/1.0.12:
resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==}
dependencies:
@ -9548,25 +9339,6 @@ packages:
long: 5.2.0
dev: false
/protons-runtime/1.0.4:
resolution: {integrity: sha512-DSKWjAgwaXhtYO5Jo/MrU8n/75I/P2IhxU0Fk/lSrXx6Gxl5DH+I6cHcbGAYFmAlOBmU4QRa0mvVme8VXlDeUg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
uint8arraylist: 1.6.0
uint8arrays: 3.1.0
dev: false
/protons-runtime/2.0.2:
resolution: {integrity: sha512-6aBGGn4scICr82Emc6+rS1qhxp9I5YUdfaR4lR10BJ6skyQxbh1vEHkrzGqQrawogwbChDrjLG8H6dI+PLh2tg==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
byte-access: 1.0.1
longbits: 1.1.0
uint8-varint: 1.0.3
uint8arraylist: 2.3.2
uint8arrays: 3.1.0
dev: false
/protons-runtime/3.1.0:
resolution: {integrity: sha512-S1iSPQC0McdHKJRi0XcATBkWgwWPx46UDfrnshYDXBvGHSYqkFtn4MQ8Gatf67w7FzFtHivA+Hb0ZPq56upG8w==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -9630,6 +9402,10 @@ packages:
engines: {node: '>= 0.6'}
dev: false
/rate-limiter-flexible/2.3.10:
resolution: {integrity: sha512-bXqRBBb85WmnJemw9+xLdA7ezLXwZ+hXcOD8ZzfGMhbus4jHRrjTMXZ1kJqpKnpGu34scZc6f0qYNSxBwO7yrg==}
dev: false
/raw-body/2.5.1:
resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==}
engines: {node: '>= 0.8'}
@ -10583,6 +10359,15 @@ packages:
postcss-selector-parser: 6.0.10
dev: false
/super-regex/0.2.0:
resolution: {integrity: sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==}
engines: {node: '>=14.16'}
dependencies:
clone-regexp: 3.0.0
function-timeout: 0.1.1
time-span: 5.1.0
dev: false
/supports-color/5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'}
@ -10778,6 +10563,13 @@ packages:
resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==}
dev: false
/time-span/5.1.0:
resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==}
engines: {node: '>=12'}
dependencies:
convert-hrtime: 5.0.0
dev: false
/timeout-abort-controller/3.0.0:
resolution: {integrity: sha512-O3e+2B8BKrQxU2YRyEjC/2yFdb33slI22WRdUaDx6rvysfi9anloNZyR2q0l6LnePo5qH7gSM7uZtvvwZbc2yA==}
dependencies:
@ -10837,63 +10629,6 @@ packages:
resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==}
dev: false
/ts-mocha/9.0.2:
resolution: {integrity: sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw==}
engines: {node: '>= 6.X.X'}
hasBin: true
peerDependencies:
mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X
dependencies:
ts-node: 7.0.1
optionalDependencies:
tsconfig-paths: 3.14.1
dev: false
/ts-node/10.9.1_typescript@4.7.4:
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.3
acorn: 8.8.0
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 4.7.4
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: false
/ts-node/7.0.1:
resolution: {integrity: sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==}
engines: {node: '>=4.2.0'}
hasBin: true
dependencies:
arrify: 1.0.1
buffer-from: 1.1.2
diff: 3.5.0
make-error: 1.3.6
minimist: 1.2.6
mkdirp: 0.5.6
source-map-support: 0.5.21
yn: 2.0.0
dev: false
/tsconfig-paths/3.14.1:
resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==}
dependencies:
@ -10984,13 +10719,6 @@ packages:
uint8arrays: 3.1.0
dev: false
/uint8arraylist/1.6.0:
resolution: {integrity: sha512-QOh6SQJQj/eEqQ6NJ8SI9LH875uI2ShcOtWE3Yupci0RaHsZm4oP+mUCJzBzKkp+8gCK7M4l+6Ubvlaimt7CSw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
uint8arrays: 3.1.0
dev: false
/uint8arraylist/2.3.2:
resolution: {integrity: sha512-4ybc/jixmtGhUrebJ0bzB95TjEbskWxBKBRrAozw7P6WcAcZdPMYSLdDuNoEEGo/Cwe+0TNic9CXzWUWzy1quw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -11131,10 +10859,6 @@ packages:
hasBin: true
dev: false
/v8-compile-cache-lib/3.0.1:
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
dev: false
/v8-compile-cache/2.3.0:
resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
dev: false
@ -11386,13 +11110,6 @@ packages:
webidl-conversions: 6.1.0
dev: false
/wherearewe/1.0.2:
resolution: {integrity: sha512-HyLZ7n1Yox+w1qWaFEgP/sMs5D7ka2UXmoVNaY0XzbEHLGljo4ScBchYm6cWRYNO33tmFX3Mgg4BiZkDOjihyw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
dependencies:
is-electron: 2.2.1
dev: false
/wherearewe/2.0.1:
resolution: {integrity: sha512-XUguZbDxCA2wBn2LoFtcEhXL6AXo+hVjGonwhSTTTU9SzbWG8Xu3onNIpzf9j/mYUcJQ0f+m37SzG77G851uFw==}
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
@ -11703,16 +11420,6 @@ packages:
yargs-parser: 20.2.9
dev: false
/yn/2.0.0:
resolution: {integrity: sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==}
engines: {node: '>=4'}
dev: false
/yn/3.1.1:
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
engines: {node: '>=6'}
dev: false
/yocto-queue/0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}

View File

@ -1,12 +1,13 @@
import { waitForRemotePeer, utils } from "js-waku";
import { utils } from "js-waku";
import * as React from "react";
import protobuf from "protobufjs";
import { createWaku } from "js-waku/lib/create_waku";
import { createLightNode } from "js-waku/lib/create_waku";
import {
Fleet,
getPredefinedBootstrapNodes,
} from "js-waku/lib/predefined_bootstrap_nodes";
import { PeerDiscoveryStaticPeers } from "js-waku/lib/peer_discovery_static_list";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
const ContentTopic = "/toy-chat/2/huilong/proto";
@ -25,7 +26,7 @@ function App() {
setWakuStatus("Starting");
createWaku({
createLightNode({
libp2p: {
peerDiscovery: [
new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes(Fleet.Test)),

View File

@ -6,7 +6,7 @@
"dependencies": {
"@livechat/ui-kit": "^0.5.0-20",
"@multiformats/multiaddr": "^10.4.0",
"js-waku": "0.26.0",
"js-waku": "0.27.0",
"process": "^0.11.10",
"protons-runtime": "^3.1.0",
"react": "^17.0.2",

View File

@ -9,7 +9,7 @@ specifiers:
'@types/react-dom': ^17.0.11
cspell: ^6.0.0
gh-pages: ^4.0.0
js-waku: 0.26.0
js-waku: 0.27.0
npm-run-all: ^4.1.5
prettier: ^2.6.2
process: ^0.11.10
@ -26,7 +26,7 @@ specifiers:
dependencies:
'@livechat/ui-kit': 0.5.0-20_ibvs32p3vr2bbtbo3dwziny444
'@multiformats/multiaddr': 10.4.0
js-waku: 0.26.0
js-waku: 0.27.0
process: 0.11.10
protons-runtime: 3.1.0_uint8arraylist@2.3.2
react: 17.0.2
@ -8382,8 +8382,8 @@ packages:
/js-tokens/4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
/js-waku/0.26.0:
resolution: {integrity: sha512-BcgMeYj9wYGNt4fs3lFUSLpFqQttpju4FAmVbB19oYK1IWR8nGKu52eLAFBrh0uH3r73Ud9PXG3I1099THqlOQ==}
/js-waku/0.27.0:
resolution: {integrity: sha512-uIh1h2Gu+aEyrGb4qmyk2Sc91in3fMfOil0kdtrps9HnA7ESbC5c6d148LeJaxqH5rfOkrfXXIhw1zwA3hlauw==}
engines: {node: '>=16'}
dependencies:
'@chainsafe/libp2p-gossipsub': 4.1.1
@ -8395,6 +8395,7 @@ packages:
'@libp2p/interface-peer-id': 1.0.4
'@libp2p/interface-peer-info': 1.0.2
'@libp2p/interface-peer-store': 1.2.1
'@libp2p/interface-pubsub': 2.0.1
'@libp2p/interfaces': 3.0.3
'@libp2p/mplex': 5.1.1
'@libp2p/peer-id': 1.1.15

View File

@ -1,15 +1,6 @@
import { useEffect, useReducer, useState } from "react";
import "./App.css";
import {
PageDirection,
Protocols,
Waku,
WakuFilter,
WakuLightPush,
WakuMessage,
WakuRelay,
WakuStore,
} from "js-waku";
import { PageDirection, Protocols, WakuMessage } from "js-waku";
import handleCommand from "./command";
import Room from "./Room";
import { WakuContext } from "./WakuContext";
@ -22,8 +13,9 @@ import {
} from "js-waku/lib/predefined_bootstrap_nodes";
import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer";
import { PeerDiscoveryStaticPeers } from "js-waku/lib/peer_discovery_static_list";
import { defaultLibp2p } from "js-waku/lib/create_waku";
import type { WakuLight } from "js-waku/lib/interfaces";
import process from "process";
import { createLightNode } from "js-waku/lib/create_waku";
const themes = {
AuthorName: {
@ -57,7 +49,7 @@ const themes = {
export const ChatContentTopic = "/toy-chat/2/huilong/proto";
async function retrieveStoreMessages(
waku: Waku,
waku: WakuLight,
setArchivedMessages: (value: Message[]) => void
): Promise<number> {
const callback = (wakuMessages: WakuMessage[]): void => {
@ -98,7 +90,7 @@ async function retrieveStoreMessages(
export default function App() {
const [messages, dispatchMessages] = useReducer(reduceMessages, []);
const [waku, setWaku] = useState<Waku | undefined>(undefined);
const [waku, setWaku] = useState<WakuLight | undefined>(undefined);
const [nick, setNick] = useState<string>(() => {
const persistedNick = window.localStorage.getItem("nick");
return persistedNick !== null ? persistedNick : generate();
@ -204,24 +196,17 @@ export default function App() {
);
}
async function initWaku(setter: (waku: Waku) => void) {
async function initWaku(setter: (waku: WakuLight) => void) {
try {
// TODO: Remove this declaration once there are optional in js-waku
const wakuRelay = new WakuRelay({ emitSelf: true });
const libp2p = await defaultLibp2p(wakuRelay, {
peerDiscovery: [
new PeerDiscoveryStaticPeers(
getPredefinedBootstrapNodes(selectFleetEnv())
),
],
const waku = await createLightNode({
libp2p: {
peerDiscovery: [
new PeerDiscoveryStaticPeers(
getPredefinedBootstrapNodes(selectFleetEnv())
),
],
},
});
const wakuStore = new WakuStore(libp2p);
const wakuLightPush = new WakuLightPush(libp2p);
const wakuFilter = new WakuFilter(libp2p);
const waku = new Waku({}, libp2p, wakuStore, wakuLightPush, wakuFilter);
await waku.start();
setter(waku);

View File

@ -1,8 +1,8 @@
import { createContext, useContext } from "react";
import { Waku } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
export type WakuContextType = {
waku?: Waku;
waku?: WakuLight;
};
export const WakuContext = createContext<WakuContextType>({ waku: undefined });

View File

@ -1,5 +1,5 @@
import { multiaddr } from "@multiformats/multiaddr";
import { Waku } from "js-waku";
import type { WakuLight } from "js-waku/lib/interfaces";
function help(): string[] {
return [
@ -21,14 +21,17 @@ function nick(
return [`New nick: ${nick}`];
}
function info(waku: Waku | undefined): string[] {
function info(waku: WakuLight | undefined): string[] {
if (!waku) {
return ["Waku node is starting"];
}
return [`PeerId: ${waku.libp2p.peerId.toString()}`];
}
function connect(peer: string | undefined, waku: Waku | undefined): string[] {
function connect(
peer: string | undefined,
waku: WakuLight | undefined
): string[] {
if (!waku) {
return ["Waku node is starting"];
}
@ -50,7 +53,7 @@ function connect(peer: string | undefined, waku: Waku | undefined): string[] {
}
}
async function peers(waku: Waku | undefined): Promise<string[]> {
async function peers(waku: WakuLight | undefined): Promise<string[]> {
if (!waku) {
return ["Waku node is starting"];
}
@ -77,7 +80,7 @@ async function peers(waku: Waku | undefined): Promise<string[]> {
return response;
}
function connections(waku: Waku | undefined): string[] {
function connections(waku: WakuLight | undefined): string[] {
if (!waku) {
return ["Waku node is starting"];
}
@ -98,7 +101,7 @@ function connections(waku: Waku | undefined): string[] {
export default async function handleCommand(
input: string,
waku: Waku | undefined,
waku: WakuLight | undefined,
setNick: (nick: string) => void
): Promise<{ command: string; response: string[] }> {
let response: string[] = [];