Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: display peer ID in dogfooding app #94

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/dogfooding/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion examples/dogfooding/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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";

Expand Down
Loading