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

Add external coordinator #1297

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

KoalaSat
Copy link
Member

@KoalaSat KoalaSat commented May 17, 2024

What does this PR do?

Adds the option of including an external coordinator

image

Can be easily tested in local by removing an existing coordinator form frontend/static/federation.json and try to add it as external.

WARNING: This PR touches all important models so it requires good testing

Checklist before merging

  • Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

@KoalaSat KoalaSat force-pushed the add-external-coordinator branch from 79b84f1 to dcf7b12 Compare May 17, 2024 14:41
Copy link
Collaborator

@Reckless-Satoshi Reckless-Satoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great Koala!

I am having a couple issues.

On localhost (127.0.0.1:8000) this PR makes the list of coordinators look like this (some are missing, including "Local dev" and should show only under this host):
image

Adding coordinators this way will only work on Tor Browser and Android. However, this will not work on the selfHosted app (because for it to work, a new socat bridge is needed on the node to expose that coordinator's Onion locally). Maybe we can write a condition to hide those UI elements in the selfHosted app?

I think I need to test this further before we merge :D

@@ -76,7 +77,8 @@ const FederationTable = ({
>
<Grid item>
<RobotAvatar
shortAlias={params.row.shortAlias}
shortAlias={federated ? params.row.shortAlias : undefined}
hashId={federated ? undefined : params.row.shortAlias}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: for external coordinators we could use their mainnet.url instead of the shortAlias for the hashId. This way we ensure that the avatar generated matches the URL (permanent) instead of the alias (user dependentant) therefore the avatar will always be the same for everyone who adds this coordinator.

@KoalaSat
Copy link
Member Author

KoalaSat commented Jun 3, 2024

@Reckless-Satoshi All changes done

@KoalaSat KoalaSat requested a review from Reckless-Satoshi June 3, 2024 13:16
@@ -83,7 +79,8 @@ const SelectCoordinator: React.FC<SelectCoordinatorProps> = ({
>
<Grid item>
<RobotAvatar
shortAlias={coordinatorAlias}
shortAlias={coordinator?.federated ? coordinator.shortAlias : undefined}
hashId={coordinator?.federated ? undefined : coordinator.shortAlias}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything changed, thank you for noticing!

@KoalaSat KoalaSat force-pushed the add-external-coordinator branch 2 times, most recently from bba2ddf to 25bd312 Compare June 16, 2024 22:58
@KoalaSat KoalaSat force-pushed the add-external-coordinator branch from 25bd312 to 08e2633 Compare June 16, 2024 22:59
Copy link
Collaborator

@Reckless-Satoshi Reckless-Satoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not test once again, but I'm gonna trust it just works as intended looking at the code! 😄 🚀

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

Successfully merging this pull request may close these issues.

2 participants