oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.73k stars 220 forks source link

Lokinet Service Registry #144

Open neuroscr opened 5 years ago

neuroscr commented 5 years ago

Purpose: Service Nodes are by definition to provide services to various users. We need to make a way for our Loki services to be discoverable across the lokinet.

Goals/Values to keep in mind: When possible, we want to leverage existing network technologies instead of reinventing our own. While the querying service registries are quite popular (zeroconf/avahi/mdns/upnp to name a few), a standard for actually setting them isn't as standard.

The current proposal:

To register the service: Each loki service will send a heartbeat JSONRPC call to an endpoint in lokinet to confirm that it's online and what port it's currently being run on. We can easily expire records incase the service daemon dies on us but the lokinet is left running and have relatively recent information about the state we're broadcasting.

To query the service: We'll use SRV record of the lokinet DNS resolver. This can easily and quickly look up in it's locally service registry and answer where things are running to any query on lokinet. So if I want to connect to service ABC on XYZ, I can ask for the SRV record on XYZ for ABC (nslookup SRV ABC XYZ) and it'll return the correct port. This integrates with the OS nicely: http://XYZ:ABC/ if ABC was an HTTP service, the OS should automatically get the correct port.

michael-loki commented 5 years ago

It's likely the completely wrong level of abstraction, but leveraging something like envoy to do service discovery/registration would be kinda cool - https://www.envoyproxy.io/

majestrate commented 5 years ago

On Thu, Dec 13, 2018 at 02:50:47AM -0800, michael-loki wrote:

It's likely the completely wrong level of abstraction, but leveraging something like envoy to do service discovery/registration would be kinda cool - https://www.envoyproxy.io/ how do you see service discovery working at l3/l4 working? it seems like SRV records are a fine interface for service discovery since things like XMPP and SMTP use such techniques.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/loki-project/loki-network/issues/144#issuecomment-446925439

neuroscr commented 5 years ago

@michael-loki not sure how a proxy helps service discovery

Also envoy is a product not a standard.