Skip to content

Commit

Permalink
Merge branch 'feat/info-apis' into 'dev'
Browse files Browse the repository at this point in the history
feat: info apis

Closes #88

See merge request ergo/rosen-bridge/rosenet!45
  • Loading branch information
vorujack committed Oct 6, 2024
2 parents a611fcd + a4896e5 commit 7cfd531
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 7cfd531

Please sign in to comment.