Skip to content

feat: add standalone UDP multicast competency test script#573

Open
alibaba0010 wants to merge 2 commits intocameri:mainfrom
alibaba0010:feat/competency-test-udp-multicast
Open

feat: add standalone UDP multicast competency test script#573
alibaba0010 wants to merge 2 commits intocameri:mainfrom
alibaba0010:feat/competency-test-udp-multicast

Conversation

@alibaba0010
Copy link
Copy Markdown

This PR replaces the previous task3.js implementation with a standalone Node.js UDP multicast competency test script.

The new script:

  • uses Node’s dgram module
  • binds to a multicast group and port
  • broadcasts a dummy Nostr event as JSON over UDP
  • receives its own multicast payload (loopback enabled)
  • parses and validates the received JSON event shape
  • exits cleanly with success/failure status codes and helpful logs

Defaults are configurable via environment variables:

  • MULTICAST_GROUP (default: 239.255.0.1)
  • MULTICAST_PORT (default: 29999)
  • RECEIVE_TIMEOUT_MS (default: 5000)

Related Issue

N/A (competency test submission task)

Motivation and Context

The competency test requires a standalone script that demonstrates multicast UDP broadcast + self-receive + JSON parsing for a dummy Nostr event.
This change provides that exact behavior in a single runnable script while following repository style and validation expectations.

How Has This Been Tested?

Validated locally using project/CI-aligned checks:

  • npm run lint
  • npm run build:check
  • npm run test:unit
  • npm run knip (run from a clean temp worktree due local .nostr/data permission constraints)
  • npm run docker:test:integration (69 scenarios passed)
  • npm run docker:cover:integration
  • npm run cover:unit (run from clean temp worktree for same local permission constraint)
  • node task3.js (confirmed multicast send, self-receive, JSON parse, and success exit)

Screenshots (if appropriate):

N/A

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 25, 2026

⚠️ No Changeset found

Latest commit: 16e0552

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant