mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-02 12:53:08 +00:00
Merge pull request #267 from waku-org/chore/upgrade-waku-dep
This commit is contained in:
commit
0b494e4069
2648
examples/web-chat/package-lock.json
generated
2648
examples/web-chat/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,13 +5,11 @@
|
|||||||
"homepage": "/web-chat",
|
"homepage": "/web-chat",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@libp2p/bootstrap": "^8.0.0",
|
"@libp2p/bootstrap": "^8.0.0",
|
||||||
"@waku/react": "^0.0.4-fe5b4c4",
|
"@waku/react": "^0.0.5-effaf55",
|
||||||
"@waku/dns-discovery": "^0.0.15",
|
"@waku/interfaces": "^0.0.18",
|
||||||
"@waku/interfaces": "^0.0.17",
|
|
||||||
"@waku/peer-exchange": "^0.0.15",
|
|
||||||
"@livechat/ui-kit": "^0.5.0-24",
|
"@livechat/ui-kit": "^0.5.0-24",
|
||||||
"@multiformats/multiaddr": "12.1.5",
|
"@multiformats/multiaddr": "12.1.5",
|
||||||
"@waku/sdk": "^0.0.18",
|
"@waku/sdk": "^0.0.19",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"protons-runtime": "^4.0.1",
|
"protons-runtime": "^4.0.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
|||||||
@ -90,7 +90,13 @@ function connections(waku: LightNode | undefined): string[] {
|
|||||||
let strConnections = " connections: \n";
|
let strConnections = " connections: \n";
|
||||||
waku.libp2p.getConnections().forEach((connection) => {
|
waku.libp2p.getConnections().forEach((connection) => {
|
||||||
strConnections += connection.remotePeer.toString() + ", ";
|
strConnections += connection.remotePeer.toString() + ", ";
|
||||||
strConnections += JSON.stringify(connection.stat);
|
strConnections += JSON.stringify({
|
||||||
|
direction: connection.direction,
|
||||||
|
timeline: connection.timeline,
|
||||||
|
multiplexer: connection.multiplexer,
|
||||||
|
encryption: connection.encryption,
|
||||||
|
status: connection.status,
|
||||||
|
});
|
||||||
strConnections += "; " + JSON.stringify(connection.streams);
|
strConnections += "; " + JSON.stringify(connection.streams);
|
||||||
strConnections += "\n";
|
strConnections += "\n";
|
||||||
});
|
});
|
||||||
|
|||||||
@ -188,7 +188,7 @@ export const usePeers = (params: UsePeersParams): UsePeersResults => {
|
|||||||
setPeers({
|
setPeers({
|
||||||
allConnected: peers.map((p) => p.id),
|
allConnected: peers.map((p) => p.id),
|
||||||
storePeers: peers
|
storePeers: peers
|
||||||
.filter((p) => p.protocols.includes(waku.StoreCodec))
|
.filter((p) => p.protocols.includes(waku.waku_store.StoreCodec))
|
||||||
.map((p) => p.id),
|
.map((p) => p.id),
|
||||||
//TODO: use from import
|
//TODO: use from import
|
||||||
filterPeers: peers
|
filterPeers: peers
|
||||||
@ -197,7 +197,7 @@ export const usePeers = (params: UsePeersParams): UsePeersResults => {
|
|||||||
)
|
)
|
||||||
.map((p) => p.id), // hardcoding codec since we don't export it currently
|
.map((p) => p.id), // hardcoding codec since we don't export it currently
|
||||||
lightPushPeers: peers
|
lightPushPeers: peers
|
||||||
.filter((p) => p.protocols.includes(waku.LightPushCodec))
|
.filter((p) => p.protocols.includes(waku.waku_store.StoreCodec))
|
||||||
.map((p) => p.id),
|
.map((p) => p.id),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,31 +1,16 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
import { LightNodeProvider, ContentPairProvider } from "@waku/react";
|
import { LightNodeProvider, ContentPairProvider } from "@waku/react";
|
||||||
import { wakuDnsDiscovery, enrTree } from "@waku/dns-discovery";
|
|
||||||
import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange";
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import { CONTENT_TOPIC } from "./config";
|
import { CONTENT_TOPIC } from "./config";
|
||||||
import { Protocols } from "@waku/interfaces";
|
import { Protocols } from "@waku/interfaces";
|
||||||
|
|
||||||
const NODE_OPTIONS = {
|
|
||||||
libp2p: {
|
|
||||||
peerDiscovery: [
|
|
||||||
wakuDnsDiscovery([enrTree.PROD], {
|
|
||||||
store: 1,
|
|
||||||
filter: 2,
|
|
||||||
lightPush: 2,
|
|
||||||
}),
|
|
||||||
wakuPeerExchangeDiscovery(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<LightNodeProvider
|
<LightNodeProvider
|
||||||
options={NODE_OPTIONS}
|
options={{ defaultBootstrap: true }}
|
||||||
protocols={[Protocols.Store, Protocols.Filter, Protocols.LightPush]}
|
protocols={[Protocols.Store, Protocols.Filter, Protocols.LightPush]}
|
||||||
>
|
>
|
||||||
<ContentPairProvider contentTopic={CONTENT_TOPIC}>
|
<ContentPairProvider contentTopic={CONTENT_TOPIC}>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user