Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding more nip-86 apis. #39

Open
kehiy opened this issue Jan 29, 2025 · 2 comments
Open

adding more nip-86 apis. #39

kehiy opened this issue Jan 29, 2025 · 2 comments

Comments

@kehiy
Copy link
Contributor

kehiy commented Jan 29, 2025

here is my suggestion:

  1. liveconnections
  2. uptime
  3. totalevents
  4. total | receives an input which is a filter.
  5. delete | removes an event. (im not sure if the banevent command dose the same?)
  6. updatenip11 | instead of passing keys one by one, inputs a whole json object and replace non-null ones with current document + add new ones. if it was present and set to null, it would remove it. this is the current model in immortal which reduces number of apis. (but nip-86 incompatible)
  7. add/removeadmin | inputs a pubkey to grant premissons to them, a list of command names may be present to limit access level.

all would be supported in mangostr.

@mikedilger
Copy link
Owner

Ok I would maybe rename or tweak these a little. We already merged the first one but still I would change it.

banevent deletes an event and prevents it from reappearing which is essentially the same as any delete would do.

  • numconnections:
    • params: []
    • result: <number>
  • uptime:
    • params: []
    • result: <number-of-seconds>
  • bandwithstats:
    • params: []
    • result: ["bytes_received": <number>, "bytes_sent": <number>]
  • storagestats:
    • params: []
    • result: ["num_events": <number>, "event_bytes": <number>, "num_files": <number>, "file_bytes": <number>]
    • Note fields may not be present if the data is not available
  • grantadmin:
    • params: [<32-byte-hex-public-key>]
    • result: true
  • revokeadmin:
    • params: [<32-byte-hex-public-key>]
    • result: true

You can add updatenip11 but chorus can't easily support it (the NIP-11 is hard coded)

Chorus really needs the allowevent and allowpubkey functionality. Events which don't pass a test have to go through an approval process to become publicly readable at which point either one of those can make it readable.

@kehiy
Copy link
Contributor Author

kehiy commented Jan 30, 2025

i agree with your changes. im going to implement them.
what about total event counts and stuff like this? i can call the relay publicly using COUNT as well, but not sure which is better.

about nip11 we can discuss in more details, maybe keeping both, idk really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants