Skip to content

feat(browser-tests): add nwaku-style logs for browser simulations #2521

@adklempner

Description

@adklempner

Description

Vac-DST's Waku simulations are instrumented to detect certain events by parsing log lines from the nwaku container:

Relay received log line:
'received relay message.*?my_peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?from_peer_id=([\w*]+).*?receivedTime=(\d+)'
Relay sent log line:
sent relay message.*?my_peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?to_peer_id=([\w*]+).*?sentTime=(\d+)
Filter client received log line: 'handling lightpush request.*?my_peer_id=([\w*]+).*?peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?receivedTime=(\d+)'
Lightpush client sent log line:
'publishWithConn.*?my_peer_id=([\w*]+).*?peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?sentTime=(\d+)'

We want to generate symmetrical log lines to detect corresponding events when running js-waku nodes in the simulation.

User Story

  • As a developer, I want to run the Docker image for a js-waku node in a headless browser and detect logs for every message sent with Lightpush or received with Filter

Proposed Solution / Feature Design

  1. In the headless api server, collect all light push sent and filter received logs directly from the js-waku logger
  2. Map to format that matches the following regex:
    Filter client received log line: 'handling lightpush request.*?my_peer_id=([\w*]+).*?peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?receivedTime=(\d+)'
    Lightpush client sent log line:
    'publishWithConn.*?my_peer_id=([\w*]+).*?peer_id=([\w*]+).*?msg_hash=(0x[\da-f]+).*?sentTime=(\d+)'
  3. Log in the server such that it shows up in Docker logs

Optional: Diagram or Draft of Design

Notes

Metadata

Metadata

Assignees

Labels

effort/daysRoughly 1–2 working days (~6–16h).maintenanceMarks maintenance type of tasks.

Type

No type

Projects

Status

Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions