feat(browser-test): match nwaku-logs for light push

This commit is contained in:
Arseniy Klempner 2025-09-05 15:46:56 -07:00
parent bc901369ac
commit 74796c3591
No known key found for this signature in database
GPG Key ID: 51653F18863BD24B
2 changed files with 13 additions and 0 deletions

View File

@ -55,6 +55,15 @@ router.post("/lightpush/v3/message", createEndpointHandler({
transformResult: (result) => {
if (result && result.successes && result.successes.length > 0) {
console.log("[Server] Message successfully sent via v3 lightpush!");
const sentTime = Date.now();
const msgHash = '0x' + sentTime.toString(16).substring(-8).padStart(8, '0');
const myPeerId = result.myPeerId || 'unknown';
result.successes.forEach((peerId: string) => {
console.log(`publishWithConn my_peer_id=${myPeerId} peer_id=${peerId} msg_hash=${msgHash} sentTime=${sentTime}`);
});
return {
success: true,
result

View File

@ -14,6 +14,7 @@ export interface SerializableSDKProtocolResult {
error: string;
peerId?: string;
}>;
myPeerId?: string;
[key: string]: any;
}
@ -228,6 +229,9 @@ export class WakuHeadless {
}
const serializableResult = makeSerializable(result);
// Add node's peer ID for monitoring logs
serializableResult.myPeerId = this.waku.libp2p.peerId.toString();
return serializableResult;
} catch (error) {