Avatar
franzap
726a1e261cc6474674e8285e3951b3bb139be9a773d1acf49dc868db861a1c11
Building nostr:npub10r8xl2njyepcw2zwv3a6dyufj4e4ajx86hz6v4ehu4gnpupxxp7stjt2p8 and #purplestack | BA 🇦🇷
Replying to Avatar fiatjaf

https://github.com/fiatjaf/nak now accepts human-readable date inputs to --ts, --since and --until:

~> nak event -ts 'two weeks ago' -c 'I bet Trump will dodge a bullet one of these days'

~> nak req -k 1 --since 'a month ago' --until 'July 1st'

Also it will automatically use a private key from NOSTR_PRIVATE_KEY if that is available in your environment, thanks to nostr:npub10npj3gydmv40m70ehemmal6vsdyfl7tewgvz043g54p0x23y0s8qzztl5h and nostr:npub1937vv2nf06360qn9y8el6d8sevnndy7tuh5nzre4gj05xc32tnwqauhaj6.

nak is really useful

I guess the spec is not very clear as it mentions "errors" only on NOTICE, maybe that's why most relay implementations do it that way

Oh ok got it. So errors then should be sent with CLOSED, rather than NOTICE + EOSE.

Yes, I'm writing a test and used an invalid hex for the error case. Did a little workaround to associate the NOTICEs to the EOSE. Nevermind! I was just saying I find it a bit odd not to follow the same pattern as EVENT, EOSE, etc

[

"NOTICE",

"ERROR: bad req: unexpected character in from_hex: 109"

]

No worries. Implementing a part of the Dart client test and wanted to assert the error came from a specific sub. I wonder why there is no ["ERROR", , "error message"]; seems pretty logical to me

Unfortunately relay implementations don't do that. Trying to process the error in the client

NIP-01 makes EVENT, EOSE and CLOSED send back the requested subscription ID, but not NOTICE. When you get an error you can't know which subscription it's from

Sure, I'm talking about the present moment. Unlikely though, as much as I despise Google

To whomever built that app: if you're going to fork Amethyst at least please use your own app identifier and a different icon. It takes no effort. It's otherwise confusing to users, zapstore was showing it as an update to Amethyst

maybe or maybe not, i'm talking about an insurance market developing, risk has a price

Insurance market for ecash mints

Dart > Javascript/Typescript

NIP-189 SQL queries

A new `sql` field is introduced for `REQ` messages from clients...

jk 😅

Man, I'm all for fiddling around and learning. But should we limit nostr's capabilities because some people might want to fiddle building a relay without using a database? With all the stuff in the world you can fiddle with? I think we're trying to solve a different problem

I also don't know, but anyone making a relay implementation very easily = basically implies using an existing database (of which SQL is probably a majority).

The person who creates their own indices manually is an expert, and they probably should be using a proven product instead of fiddling around, no?

Maybe we should define "ultra-flexible" but having a powerful querying language encourages bad behaviors in developers...why? what do you mean by that?

Limited querying language is wasteful because we need to make multiple queries vs one, download tonnes of events when a few would suffice, make client side operations that should not happen, etc

Too fancy why?

Again my point about waste.

I think we could find the minimum common ground from a variety of query languages (sql, nosql, graphql), primitives that have emerged for most use cases. I'm not advocating for anything too sophisticated

The relay I wrote runs SQLite on Bun.js, it's crazy fast to the point that calls are non-blocking and all that on a $20 VPS.

If slight more complexity makes it bad for huge relays, then that's also a good thing

That's a great question, I am not sure. Maybe there are other ways of doing it without joins. Anything in that direction would help, queries on nostr are very primitive - so clients implement workarounds that are wasteful anyway, like data duplication and lots of extra queries that add processing and bandwidth