mirror of
https://github.com/status-im/js-waku-examples.git
synced 2025-01-29 00:06:48 +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",
|
||||
"dependencies": {
|
||||
"@libp2p/bootstrap": "^8.0.0",
|
||||
"@waku/react": "^0.0.4-fe5b4c4",
|
||||
"@waku/dns-discovery": "^0.0.15",
|
||||
"@waku/interfaces": "^0.0.17",
|
||||
"@waku/peer-exchange": "^0.0.15",
|
||||
"@waku/react": "^0.0.5-effaf55",
|
||||
"@waku/interfaces": "^0.0.18",
|
||||
"@livechat/ui-kit": "^0.5.0-24",
|
||||
"@multiformats/multiaddr": "12.1.5",
|
||||
"@waku/sdk": "^0.0.18",
|
||||
"@waku/sdk": "^0.0.19",
|
||||
"process": "^0.11.10",
|
||||
"protons-runtime": "^4.0.1",
|
||||
"react": "^17.0.2",
|
||||
|
@ -90,7 +90,13 @@ function connections(waku: LightNode | undefined): string[] {
|
||||
let strConnections = " connections: \n";
|
||||
waku.libp2p.getConnections().forEach((connection) => {
|
||||
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 += "\n";
|
||||
});
|
||||
|
@ -188,7 +188,7 @@ export const usePeers = (params: UsePeersParams): UsePeersResults => {
|
||||
setPeers({
|
||||
allConnected: peers.map((p) => p.id),
|
||||
storePeers: peers
|
||||
.filter((p) => p.protocols.includes(waku.StoreCodec))
|
||||
.filter((p) => p.protocols.includes(waku.waku_store.StoreCodec))
|
||||
.map((p) => p.id),
|
||||
//TODO: use from import
|
||||
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
|
||||
lightPushPeers: peers
|
||||
.filter((p) => p.protocols.includes(waku.LightPushCodec))
|
||||
.filter((p) => p.protocols.includes(waku.waku_store.StoreCodec))
|
||||
.map((p) => p.id),
|
||||
});
|
||||
};
|
||||
|
@ -1,31 +1,16 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { LightNodeProvider, ContentPairProvider } from "@waku/react";
|
||||
import { wakuDnsDiscovery, enrTree } from "@waku/dns-discovery";
|
||||
import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange";
|
||||
import "./index.css";
|
||||
|
||||
import App from "./App";
|
||||
import { CONTENT_TOPIC } from "./config";
|
||||
import { Protocols } from "@waku/interfaces";
|
||||
|
||||
const NODE_OPTIONS = {
|
||||
libp2p: {
|
||||
peerDiscovery: [
|
||||
wakuDnsDiscovery([enrTree.PROD], {
|
||||
store: 1,
|
||||
filter: 2,
|
||||
lightPush: 2,
|
||||
}),
|
||||
wakuPeerExchangeDiscovery(),
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<LightNodeProvider
|
||||
options={NODE_OPTIONS}
|
||||
options={{ defaultBootstrap: true }}
|
||||
protocols={[Protocols.Store, Protocols.Filter, Protocols.LightPush]}
|
||||
>
|
||||
<ContentPairProvider contentTopic={CONTENT_TOPIC}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user