diff --git a/.changeset/polite-cycles-bow.md b/.changeset/polite-cycles-bow.md new file mode 100644 index 0000000..9f1a94c --- /dev/null +++ b/.changeset/polite-cycles-bow.md @@ -0,0 +1,5 @@ +--- +'@rosen-bridge/rosenet-node': minor +--- + +Add info APIs diff --git a/packages/rosenet-node/lib/createRoseNetNode.ts b/packages/rosenet-node/lib/createRoseNetNode.ts index 038fc51..65310a1 100644 --- a/packages/rosenet-node/lib/createRoseNetNode.ts +++ b/packages/rosenet-node/lib/createRoseNetNode.ts @@ -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()), + }, }; };