List relay and light push peers numbers instead of any peer

This commit is contained in:
Franck Royer 2021-07-12 17:13:28 +10:00
parent 7a0b947553
commit 4ca440d27e
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 3 deletions

View File

@ -161,9 +161,11 @@ function App() {
};
}, [waku, address, ethDmKeyPair]);
let peers = 0;
let relayPeers = 0;
let lightPushPeers = 0;
if (waku) {
peers = waku.libp2p.connectionManager.connections.size;
relayPeers = waku.relay.getPeers().size;
lightPushPeers = waku.lightPush.peers.length;
}
let addressDisplay = '';
@ -188,7 +190,7 @@ function App() {
/>
</IconButton>
<Typography className={classes.peers} aria-label="connected-peers">
{peers} peer{peers && peers > 1 ? 's' : ''}
Peers: {relayPeers} relay, {lightPushPeers} light push
</Typography>
<Typography variant="h6" className={classes.title}>
Ethereum Direct Message