mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-02 13:53:12 +00:00
feat(browser-test): match nwaku-logs for light push
This commit is contained in:
parent
bc901369ac
commit
74796c3591
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user