mirror of https://github.com/waku-org/waku-lab.git
chore: display peer ID in dogfooding app (#94)
This commit is contained in:
parent
eb13f3ebea
commit
5f4b912b4c
|
@ -26,8 +26,8 @@
|
|||
<div>
|
||||
<h3>Waku Dogfooding App</h3>
|
||||
<div id="runningScreen" style="display: none">
|
||||
<label for="wallet">Wallet Address:</label>
|
||||
<span id="wallet"></span>
|
||||
<label for="peerID">Your peer ID:</label>
|
||||
<span id="peerID"></span>
|
||||
<br />
|
||||
<label for="numSent">Messages Sent:</label>
|
||||
<span id="numSent">0</span>
|
||||
|
|
|
@ -58,6 +58,8 @@ const wakuNode = async (): Promise<LightNode> => {
|
|||
export async function app(telemetryClient: TelemetryClient) {
|
||||
const node = await wakuNode();
|
||||
(window as any).waku = node;
|
||||
|
||||
console.log("DEBUG: your peer ID is:", node.libp2p.peerId.toString());
|
||||
|
||||
await node.start();
|
||||
await waitForRemotePeer(node);
|
||||
|
@ -324,10 +326,13 @@ export async function app(telemetryClient: TelemetryClient) {
|
|||
|
||||
(async () => {
|
||||
const telemetryClient = new TelemetryClient(TELEMETRY_URL, 5000);
|
||||
const { startLightPushSequence, startFilterSubscription } = await app(
|
||||
const { node, startLightPushSequence, startFilterSubscription } = await app(
|
||||
telemetryClient
|
||||
);
|
||||
|
||||
const peerIDBlock = document.getElementById("peerID");
|
||||
peerIDBlock.innerText = node.libp2p.peerId.toString();
|
||||
|
||||
const runningScreen = document.getElementById("runningScreen");
|
||||
runningScreen.style.display = "block";
|
||||
|
||||
|
|
Loading…
Reference in New Issue