Giter Site home page Giter Site logo

Comments (4)

blakejakopovic avatar blakejakopovic commented on August 18, 2024 1

I'm not against it. I was thinking more modular + composable, and how perhaps just piping to | sort -u is good enough? Perhaps there are more complex de-duping or sorting use-cases that involve parsing the JSON events, which currently isn't done. I don't know how consistent nostr server's output the JSON keys (or perhaps drop keys, like special tags) for example - maybe this cannot be relied upon long term. Thoughts?

In testing, for example, it was nice to know that I actually received 30 events across servers (without --unique, however it was 12 events with, and some servers returned the exact same as they must be replicating). Maybe not useful for others, outside of testing/debugging, but setting it as the default would kill that ability to compare.

from nostcat.

blakejakopovic avatar blakejakopovic commented on August 18, 2024

Now supported in v0.3.0. Updated examples in the README.md

Sort and unique results with multiple servers (dedupe)

$ echo '["REQ", "RAND", {"kinds": [1], "limit": 8}]' |
  nostcat --unique wss://relay.damus.io wss://nostr.ono.re

Pipe events from one server to another (currently limited to 1 event at a time)

echo '["REQ", "CID", {"limit": 1}]' | nostcat wss://relay.damus.io |
  jq -c 'del(.[1])' |
  wss://nostr.ono.re

Let me know how it goes :) I am aware of a bad/failed to connect hang issue where there isn't a connection timeout for servers yet - but likely my next focus.

from nostcat.

jb55 avatar jb55 commented on August 18, 2024

should unique be the default? I can't imagine not using that flag.

from nostcat.

jb55 avatar jb55 commented on August 18, 2024

from nostcat.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.