Merge pull request #267 from waku-org/chore/upgrade-waku-dep

This commit is contained in:
Danish Arora 2023-09-12 08:20:36 +08:00 committed by GitHub
commit 0b494e4069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1099 additions and 1586 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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";
});

View File

@ -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),
});
};

View File

@ -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}>