From a498e394c4536d6af800be7c3973567ccd50f776 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 28 Nov 2023 15:11:59 -0800 Subject: return all nostr pubkeys --- routes/nostr.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/routes/nostr.js b/routes/nostr.js index d0b54f1f..a843501e 100644 --- a/routes/nostr.js +++ b/routes/nostr.js @@ -185,15 +185,14 @@ export default { }, async identities(req, res) { - res.send({ - names: { - coinos: - "ba80990666ef0b6f4ba5059347beb13242921e54669e680064ca755256a1e3a6", - adam: - "566c166f3adab0c8fba5da015b0b3bcc8eb3696b455f2a1d43bfbd97059646a8", - asoltys: - "566c166f3adab0c8fba5da015b0b3bcc8eb3696b455f2a1d43bfbd97059646a8" - } - }); + let names = {}; + for await (let k of db.scanIterator({ MATCH: "user:*" })) { + let u = await g(k); + console.log("U", u) + if (typeof u === "string") u = await g(`user:${u}`); + if (u && u.username && u.pubkey) names[u.username] = u.pubkey; + } + + res.send({ names }); } }; -- cgit v1.2.3