460 Commits

Author SHA1 Message Date
fiatjaf
70f719ea31 IsValidPublicKey() and IsValid32ByteHex() replacing IsValidPublicKeyHex() 2024-01-18 16:27:56 -03:00
fiatjaf
1a7b8991a3 pool: deduplicate relay urls list. 2024-01-18 11:49:16 -03:00
fiatjaf
4dc6e21f60 nip29: join request. 2024-01-18 11:48:43 -03:00
fiatjaf
1ff7f826c2 nip11: url normalization improvement and Fetch test. 2024-01-13 12:46:59 -03:00
fiatjaf
fed7e4c3f2 add nip53. v0.28.0 2024-01-10 12:10:53 -03:00
fiatjaf
88bb00604c nip52: add image. 2024-01-10 12:07:23 -03:00
fiatjaf
1800f2e590 add nip31, nip52, nip94. 2024-01-10 10:09:17 -03:00
fiatjaf
7b292775c0 migrate to xsync/v3
closes https://github.com/nbd-wtf/go-nostr/issues/117
2024-01-10 06:54:53 -03:00
fiatjaf
fd8b2b22b2 nip-46 dynamic and static signers. 2024-01-09 17:20:14 -03:00
fiatjaf
ce424619f4 nip05: add nip46 field. 2024-01-06 08:07:28 -03:00
fiatjaf
8da32e6dfc nip29: NewGroup() doesn't set timestamps to now. 2024-01-04 21:46:10 -03:00
fiatjaf
48db1df66c nip29: refine group-events relationships and write some tests. 2024-01-04 15:01:29 -03:00
fiatjaf
ed3642f112 nip29: move some things back from nip29/relay to nip29 2024-01-04 15:01:26 -03:00
fiatjaf
3fecd03ed4 nip29: move relay-specific stuff to nip29/relay 2024-01-04 11:33:36 -03:00
fiatjaf
e4b4654e66 nip29: bring in helpers for managing groups to be used on the relay side. 2024-01-04 11:33:33 -03:00
fiatjaf
f1c71134e3 experimental nip29 support. 2024-01-02 17:23:34 -03:00
fiatjaf
5938a71146 replace close() with actually sending a value to .EndOfStoredEvents and .Closed channels.
I thought `close()` would be nice because it would be cheap and not lock the goroutine while waiting for the receiver to acknowledge the thing, but turns out it introduces the serious risk of users putting <- sub.EndOfStoredEvents in the same for { select {} } statement as sub.Events, for example, and they they get into an infinite loop.

we had this same problem here inside this same library, and what is fixed in 242af0bf76 by @mattn.
2024-01-01 10:18:16 -03:00
fiatjaf
3afa6fc5f6 update reflect/unsafe.String thing. 2024-01-01 10:15:06 -03:00
fiatjaf
7692f1c148 go mod tidy v0.27.5 2023-12-29 18:16:58 -03:00
fiatjaf
45bdd193c5 Tags.GetD() 2023-12-29 18:10:56 -03:00
Yasuhiro Matsumoto
8b1839bfc1 remove dependency for github.com/dgraph-io/ristretto/z
dgraph-io/ristretto use google/glog. glog rewrites flags on its own, which
causes unexpected behaviour.
2023-12-29 18:10:31 -03:00
fiatjaf
781aecc6ac binary/hybrid Marshal() fails if event has any items over the limits. v0.27.3 2023-12-22 19:33:30 -03:00
fiatjaf
f1980e8b7a expose max limits allowed for binary format event fields. 2023-12-22 18:18:44 -03:00
fiatjaf
2f514d5026 remove unnecessary mutex. 2023-12-15 14:15:37 -03:00
Yasuhiro Matsumoto
f60b70eb5e update go version v0.27.2 2023-12-14 16:07:46 -03:00
Yasuhiro Matsumoto
242af0bf76 fix heavy loop 2023-12-14 16:07:46 -03:00
fiatjaf
c55b509653 binary: fix encoding, was using uint8 for tags length, which was obviously not working. v0.27.1 2023-12-10 21:13:34 -03:00
fiatjaf
7ecbc0a7cf binary: move benchmarks to different test file. 2023-12-10 21:12:54 -03:00
fiatjaf
e73b784501 update example in README. 2023-12-09 14:40:39 -03:00
fiatjaf
fabd5160a8 fix sign in relay test just recently updated. v0.27.0 2023-12-09 13:26:50 -03:00
fiatjaf
3e1749a01d fix OK handling. 2023-12-09 13:21:35 -03:00
fiatjaf
1bccebbf2a fix ParseMessage() so it works with CLOSED and improve tests. 2023-12-09 11:29:14 -03:00
fiatjaf
64eb395dc1 fix tests that relied on the defunct PublishStatus enum. 2023-12-07 21:39:43 -03:00
fiatjaf
b2170efb5a support performing AUTH in the middle of SimplePool's subMany* 2023-12-07 21:37:41 -03:00
fiatjaf
f8fa490293 get rid of PublishStatus and always expect relays to answer with an OK for both AUTH and EvENT publishes. 2023-12-07 21:31:40 -03:00
fiatjaf
f9f3a34ccc nip46: fix variable name (was using the shared key as the secret key.) v0.26.4 2023-12-02 15:31:26 -03:00
fiatjaf
15f026d2c5 exponential backoff on SimplePool reconnections and only update since once. 2023-12-02 15:12:45 -03:00
fiatjaf
0e0ecb2412 refactor SimplePool automatic reconnection. 2023-12-02 14:59:16 -03:00
fiatjaf
a65bd94a00 minor. v0.26.3 2023-12-02 14:38:18 -03:00
fiatjaf
32c1969397 simplify pre-eose cleanup in pool.subMany() 2023-12-02 14:37:32 -03:00
Yasuhiro Matsumoto
cb8b40bd00 reconnect 2023-12-02 14:36:16 -03:00
fiatjaf
a9972245f3 nip04: augment tests with cross-compatibility vectors. 2023-12-02 13:13:32 -03:00
fiatjaf
2b9b4dfa2f nip46: rename Pool to Signer. v0.26.2 2023-12-01 20:50:00 -03:00
fiatjaf
c606a43c07 fix atrocious bug on pool.subMany(): we were missing events because of a badly designed select{} 2023-12-01 20:49:45 -03:00
fiatjaf
2969449fb3 nip46: make everything strings because pablo did it like that. 2023-12-01 17:23:59 -03:00
fiatjaf
277cdd8df8 nip46: improvements. 2023-12-01 17:20:29 -03:00
fiatjaf
73d5e943e2 nip-46 signer flow helpers. 2023-12-01 16:15:24 -03:00
fiatjaf
711db062a1 primitive support for CLOSED in SimplePool. 2023-12-01 13:37:24 -03:00
fiatjaf
775821f4e5 fix CLOSED->CLOSE marshaling on CloseEnvelope. v0.26.1 2023-12-01 12:57:18 -03:00
fiatjaf
3adb1cde3c only store the last AUTH challenge and allow user to perform auth only whenever they want instead of automatically. v0.26.0 2023-11-28 22:30:16 -03:00