nips icon indicating copy to clipboard operation
nips copied to clipboard

Local Relay list

Open vitorpamplona opened this issue 1 year ago • 9 comments

Adds a local relay list anchored by the device ID from each OS. Ideally, all apps installed on the same device/user can access that relay.

vitorpamplona avatar May 30 '24 14:05 vitorpamplona

I could use some help on this. I don't know how to get a Device ID from the browser for Clients running in JavaScript. :(

vitorpamplona avatar May 30 '24 15:05 vitorpamplona

Why would we need support in the protocol for this? Wouldn't this list only be relevant to the device the user is currently using?

staab avatar May 30 '24 15:05 staab

Wouldn't this list only be relevant to the device the user is currently using?

Yep, it's only for the device, but for all apps running in that device.

vitorpamplona avatar May 30 '24 15:05 vitorpamplona

For instance, People are using Citrine on Android as a local relay. All clients running on Android should enable that relay when using that phone. The idea is to avoid having to set up the relay separately in each client.

vitorpamplona avatar May 30 '24 15:05 vitorpamplona

So you would send your device id hash to public relays, so all your local apps can connect to the same local relay? Seems circuitous, is there no way to advertise locally running services on a device? Maybe using nostr.local or something like that?

staab avatar May 30 '24 15:05 staab

is there no way to advertise locally running services on a device?

There is on Android and I guess we can use local files on UNIX systems to do so. I have no idea how iOS, Web or Windows Apps will access those files, though. We might need to create a different way to advertise a local relay for each OS. I was trying to just normalize it all in one event.

vitorpamplona avatar May 30 '24 15:05 vitorpamplona

Can't you just check for a relay running on localhost:4869? That's the port both Citrine and https://github.com/CodyTseng/nostr-relay-tray run on.

DanConwayDev avatar Jun 10 '24 14:06 DanConwayDev

What happens if the user installs two local relay apps? Or Citrine + Umbrel?

vitorpamplona avatar Jun 10 '24 15:06 vitorpamplona

the one on 4869 would be the primary local relay but apps could support a custom local relay and store this as a local setting in the app.

DanConwayDev avatar Jun 10 '24 16:06 DanConwayDev