Skip to content

Commit 6488649

Browse files
committed
feat(browser-tests): use nwaku-style format for light push log
1 parent 7dacb7e commit 6488649

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/browser-tests/src/routes/waku.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ router.post(
5959
transformResult: (result) => {
6060
if (result && result.successes && result.successes.length > 0) {
6161
console.log("[Server] Message successfully sent via v3 lightpush!");
62+
63+
const sentTime = Date.now();
64+
const msgHash = '0x' + sentTime.toString(16).substring(-8).padStart(8, '0');
65+
66+
const myPeerId = result.myPeerId || 'unknown';
67+
result.successes.forEach((peerId: string) => {
68+
console.log(`publishWithConn my_peer_id=${myPeerId} peer_id=${peerId} msg_hash=${msgHash} sentTime=${sentTime}`);
69+
});
70+
6271
return {
6372
success: true,
6473
result,

packages/browser-tests/web/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ export class WakuHeadless {
244244

245245
const serializableResult = makeSerializable(result);
246246

247+
serializableResult.myPeerId = this.waku.libp2p.peerId.toString();
248+
247249
return serializableResult;
248250
} catch (error) {
249251
console.error("Error sending message via v3 lightpush:", error);

0 commit comments

Comments
 (0)