Skip to content

Commit

Permalink
add subscribing to different custom groups and broadcast messages
Browse files Browse the repository at this point in the history
  • Loading branch information
d-roak committed Jun 21, 2024
1 parent e760802 commit b5aa723
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ export class TopologyNode {
);
}

addCustomGroup(group: string) {
this._networkNode.subscribe(group);
}

sendGroupMessage(group: string, message: Uint8Array) {
this._networkNode.broadcastMessage(group, message);
}

addCustomGroupMessageHandler(
handler: EventHandler<CustomEvent<GossipsubMessage>>,
) {
Expand Down

0 comments on commit b5aa723

Please sign in to comment.