From 5f4b912b4c8552f8e552e7a3b493ccd124b1e9d0 Mon Sep 17 00:00:00 2001
From: Sasha <118575614+weboko@users.noreply.github.com>
Date: Tue, 1 Oct 2024 10:42:48 +0200
Subject: [PATCH] chore: display peer ID in dogfooding app (#94)
---
examples/dogfooding/index.html | 4 ++--
examples/dogfooding/src/index.ts | 7 ++++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/examples/dogfooding/index.html b/examples/dogfooding/index.html
index 4e86cc3..4ca2627 100644
--- a/examples/dogfooding/index.html
+++ b/examples/dogfooding/index.html
@@ -26,8 +26,8 @@
Waku Dogfooding App
-
-
+
+
0
diff --git a/examples/dogfooding/src/index.ts b/examples/dogfooding/src/index.ts
index 4aa6d2c..4c79de9 100644
--- a/examples/dogfooding/src/index.ts
+++ b/examples/dogfooding/src/index.ts
@@ -58,6 +58,8 @@ const wakuNode = async (): Promise => {
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";