Skip to content

Commit

Permalink
Display # of connections
Browse files Browse the repository at this point in the history
  • Loading branch information
D4nte committed Jul 1, 2021
1 parent 378336c commit 9db6f22
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/eth-dm/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ function App() {
.then((address) => setAddress(address));
});

let peers;
if (waku) {
peers = waku.libp2p.connectionManager.connections.size;
}

return (
<ThemeProvider theme={theme}>
<div className={classes.root}>
Expand All @@ -99,6 +104,7 @@ function App() {
style={waku ? { color: green[500] } : {}}
/>
</IconButton>
<Typography>{peers}</Typography>
</Toolbar>
</AppBar>

Expand Down

0 comments on commit 9db6f22

Please sign in to comment.