From 704f6ca0dc82295b4fe9d6b506089aea8498d5bf Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:17:34 +0300 Subject: [PATCH] Hmm how can i get publickey of the user sending info and not just peers who connected? --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index b17b0cd..5e95740 100644 --- a/app.js +++ b/app.js @@ -296,13 +296,15 @@ function sendMessage(e) { onMessageAdded(config.userName, message, config.userAvatar); + console.log(swarm.keyPair); + console.log("swarm:", swarm); const messageObj = JSON.stringify({ type: 'message', name: config.userName, message, avatar: config.userAvatar, topic: b4a.toString(currentRoom.topic, 'hex'), - peers: [...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')).push(swarm.publicKey.toString('hex')), + peers: [...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')), timestamp: Date.now(), readableTimestamp: new Date().toLocaleString(), // Added human-readable timestamp });