chore: display peer ID in dogfooding app (#94)

This commit is contained in:
Sasha 2024-10-01 10:42:48 +02:00 committed by GitHub
parent eb13f3ebea
commit 5f4b912b4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

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

View File

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