Skip to content

Commit

Permalink
feat(rosenet-node): add info APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed Oct 6, 2024
1 parent b8338df commit a4896e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-cycles-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-bridge/rosenet-node': minor
---

Add info APIs
4 changes: 4 additions & 0 deletions packages/rosenet-node/lib/createRoseNetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const createRoseNetNode = async ({
handleIncomingMessage: handleIncomingMessageFactory(node),
publish: publishFactory(node),
subscribe: subscribeFactory(node),
info: {
getPeerId: () => node.peerId.toString(),
getConnectedPeers: () => node.getPeers().map((peer) => peer.toString()),
},
};
};

Expand Down

0 comments on commit a4896e5

Please sign in to comment.