GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Alex Gleason (alex@gleasonator.com)'s status on Sunday, 17-Dec-2023 02:49:45 JST Alex Gleason Alex Gleason
    I'm building a class in TypeScript that manages hundreds of WebSocket connections. Those sockets are Nostr relays.

    Most existing Nostr pool libraries are based around finding messages from across all relays in the pool. This library does not do that, and instead focuses on the capabilities of each relay in order to avoid being rate-limited and to optimize network usage.

    It is based around the lifecycle of Subscription objects. When a socket dies, it only reopens if a subscription is active. But the lifecycle of the socket itself is separate from the subscription, and a new subscription will not interrupt the state of a socket, eg if it's in exponential backoff. They merely overlap (check each other's state at key moments).

    The whole thing is built on web standards. The subscription is an EventTarget, and the system makes heavy use of AbortSignal from top to bottom, greatly simplifying the codebase.

    To avoid rate-limiting, it uses semaphores to limit access to each relay, so no one relay is overwhelmed by too many subscriptions. Relays can be individually configured, and it supports loading a giant config map so you can sync with a database to have granular control over relays.

    Finally, it is low-level enough to build things on top of it. It requires you to provide explicit relays for each query, and it returns all messages from all relays without any signature verification or validation. Those things, while required for a functioning software, are done outside of the pool for maximum flexibility. It's a feature not a bug.

    In conclusion I am building a big Nostr thing that I really need, that nobody has done before in TypeScript. You can see my progress here: https://gitlab.com/soapbox-pub/nostr-machina/-/merge_requests/1
    In conversation Sunday, 17-Dec-2023 02:49:45 JST from gleasonator.com permalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: gitlab.com
      Draft: Add a RelayPool module (!1) · Merge requests · Soapbox / nostr-machina · GitLab
      The idea is that you can have a pool, whose sole purpose it to maintain connections to the specified relays, and then pass the pool instance around to...
    • Embed this notice
      Alex Gleason (alex@gleasonator.com)'s status on Sunday, 17-Dec-2023 02:58:14 JST Alex Gleason Alex Gleason
      in reply to
      • PABLOF7z
      @fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52 might be interested in this. The main thing missing is a piece on top that selects the best relays for filters, which is something maybe NDK can do. I'm interested in sharing code somehow.
      In conversation Sunday, 17-Dec-2023 02:58:14 JST permalink
    • Embed this notice
      Alex Gleason (alex@gleasonator.com)'s status on Sunday, 17-Dec-2023 05:21:46 JST Alex Gleason Alex Gleason
      in reply to
      • Kieran
      @63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed Been looking at it about an hour. Looks awesome and robust, but I don't understand all the different abstractions. Can I use it to replace the firehose (pool.subscribe) at the bottom? I need to pass a list of relays for the REQ.
      In conversation Sunday, 17-Dec-2023 05:21:46 JST permalink

      Attachments


      1. https://media.gleasonator.com/10364036546f0109bcca163cf734d0ff00cc9d0ee504b4e2fcad7009c90f06d4.png
    • Embed this notice
      Kieran (63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed@mostr.pub)'s status on Sunday, 17-Dec-2023 05:21:47 JST Kieran Kieran
      in reply to
      This is how @snort/system works
      In conversation Sunday, 17-Dec-2023 05:21:47 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.