fiatjaf / relay29

NIP-29 relay
MIT License
13 stars 4 forks source link

Unable to Create Group After Latest Update #4

Open water783 opened 2 months ago

water783 commented 2 months ago

Hi, sir.

Another issue, after the latest update, I am unable to create a group. I suspect that during the group creation process, specifically when calling AddEvent, the normalEventQuery is invoked, which then calls GetAuthed returns nil.

Do I need to connect to the relay before creating a group?

fiatjaf commented 2 months ago

Sorry, that requires changes in khatru and go-nostr. I'll push the respective updates soon.

fiatjaf commented 2 months ago

Should be working now (maybe), but please delete your database and create a new one.

water783 commented 2 months ago

Thank you for the update. The permissions in the 39001 event are now returning. However, there are still a few issues:

  1. After creating a group, the created_at field for both the 39001 and 39002 events is still set to 0.
  2. The 39001 and 39002 events return both the server's pubkey and the creator's pubkey. The events should not include the server's pubkey i believe.
  3. How can we set the role-name? There doesn't seem to be a place to set it.
fiatjaf commented 2 months ago

First of all, I just turned this entire repo into a library that you can use to make your own NIP-29 relay with your custom rules. Please take a look. Nothing was thoroughly tested, so please be patient with the bugs.

  1. Thank you. I will fix that.
  2. This is because of the way the group is created in this specific relay. In other relays that would not be necessary if you're taking a signed kind 9007 from the user and using that to create the group (see https://github.com/nostr-protocol/nips/pull/1344). This is supported by default when using the library, but on my example relay it that is blocked and users must use the webpage to create groups and the groups are all co-owned by the relay private key, but this doesn't have to be the case for other relays.
  3. This is true. It's a cool feature that was forgotten in the spec. We need to add a tag (or a new event kind? I don't know) for specifying it. Please come up with a reasonable idea and add it to https://github.com/nostr-protocol/nips/blob/master/29.md with a pull request and then I'll implement it.
fiatjaf commented 2 months ago

Also please join the temporary group https://t.me/nip29_temp

water783 commented 2 months ago

First of all, I just turned this entire repo into a library that you can use to make your own NIP-29 relay with your custom rules. Please take a look. Nothing was thoroughly tested, so please be patient with the bugs.

Got it, sir. I'm patient on it. I'm not familiar with Go, but I will try to contribute to this library :)

Please come up with a reasonable idea and add it to https://github.com/nostr-protocol/nips/blob/master/29.md with a pull request and then I'll implement it.

Will do it