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

Public Relay API gets empty page #678

Open
0ceanSlim opened this issue Aug 10, 2024 · 1 comment
Open

Public Relay API gets empty page #678

0ceanSlim opened this issue Aug 10, 2024 · 1 comment
Labels
bug Something isn't working legacy for legacy issues wontfix This will not be worked on

Comments

@0ceanSlim
Copy link

Describe the bug
https://api.nostr.watch/v1/public isn't giving me back any result

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://api.nostr.watch/v1/public
  2. See nothing

Expected behavior
see a list of public relays

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Windows]
  • Browser [edge]
  • Version [127.0.2651.86]

Additional context
The rest of the api calls seem to work

@0ceanSlim 0ceanSlim added the bug Something isn't working label Aug 10, 2024
@dskvr dskvr added legacy for legacy issues wontfix This will not be worked on labels Aug 17, 2024
@dskvr
Copy link
Collaborator

dskvr commented Aug 17, 2024

Thanks for your report. The V1 API is legacy and I do not have the bandwidth to maintain it. Please use NIP-66 or wait for the V2.

NIP-66 Relays

wss://relay.nostr.watch
wss://relaypag.es
wss://history.nostr.watch

NIP-66 Filters for online public relays (example in js)

{
"authors" : ["9bbbb845e5b6c831c29789900769843ab43bb5047abe697870cb50b6fc9bf923"],
"kinds": [30166],
"#R": ["!payment"],
"since": Math.round(Date.now()/1000)-60*60*1.5
}

The relay url is on the d tag

About since
The JS returns a timestamp that is "1.5 hours ago" from when subscription is opened ... this monitor publishes every hour, so 1.5 hours provides a buffer for false negatives and gives time for a few retries. If the subscription remains open, then any new events (relays) are implicitly online.

NIP-66 Demo

Smaller events
The monitor I provided publishes pretty large events, if you want smaller events (you don't require any of the data in those events), there are 6 other monitors from vairous regions that publish compact events containing only round-trip times. You can find them with the following relays and filters (Note: Not all monitor registration events returned will be from active monitors!)

wss://relay.nostr.watch
wss://relaypag.es
wss://history.nostr.watch

Filters

{
"kinds": [10166]
}

These events, "Monitor Registration" events, contain the parameters you should use for liveness determinations (namely frequency)

I have removed the public/paid/offline endpoints from the API documentation to mitigate confusion. I apologize for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working legacy for legacy issues wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants