-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat!: frontend should handle peer discovery #550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes seem good to me!
@@ -25,10 +25,10 @@ export const ERR_DUPLICATE = 'Duplicate connection' | |||
*/ | |||
export class LocalDiscovery extends TypedEmitter { | |||
#identityKeypair | |||
#name = randomBytes(8).toString('hex') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do you think it will it ever be useful to provide a custom name? can consider a constructor opt for this if so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be useful in future but not at present, so I'm going to skip it for now.
See also: digidem/comapeo-mobile#245.
I recommend reviewing this one commit at a time.
Our peer discovery system is unreliable on some networks. We'd like to replace it with a native local service discovery system.
To do this, the frontend needs to tell the backend about peers it finds. In other words, we need to "invert" peer discovery.
Here's pseudocode for what the frontend needs to do:
This implements that by removing our mDNS system and replacing it with these public APIs.
Closes #474.