Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Implement Relay-Map feature #99

Open
Saundr21 wants to merge 4 commits intomasterfrom
relay-map
Open

Implement Relay-Map feature #99
Saundr21 wants to merge 4 commits intomasterfrom
relay-map

Conversation

@Saundr21
Copy link

Summary

This PR adds in a new page to display a map with location of all relays using MapBoxGL. Both themes are compatible with the map (light and dark mode)

@@ -1,3 +1,5 @@
@import 'https://api.mapbox.com/mapbox-gl-js/v2.6.1/mapbox-gl.css';
Copy link
Contributor

@jim-toth jim-toth Sep 18, 2023

Choose a reason for hiding this comment

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

  1. This introduces a new, centralized, third-party dependency. Instead, you could just copy the contents of this css file and add it as its own file under assets/styles. Of course, you will have to ensure the license of the css file allows such a thing.
  2. This css file version mis-matches the installed package (v2.15.0).

"ardb": "^1.1.10",
"arweave": "^1.13.7",
"ethers": "^6.1.0",
"ip-geolocation-api-javascript-sdk": "^1.0.9",
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. On the surface this seems like a very sketchy package to install seeing as it has ~100 downloads per week on npm. It's very small and after further inspection it's just an http wrapper around the Geolocation API Service...
  2. ...which you're not even using 😄 so you should remove this dependency entirely.


const getLatLonFromIPs = async (ips: string[]): Promise<any[]> => {
try {
const response = await $fetch('https://api.ipgeolocation.io/ipgeo-bulk?apiKey=cc09f9516dea4a9e804f6885921f231f', {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. This introduces a new, centralized, third-party data source where previously the dashboard does not have any. All data sources for the dashboard are decentralized from blockchain data providers (arweave gateways, warp DRE nodes, eth jsonrpc, etc.). If this service were to disappear overnight, this feature of the dashboard would break.
  2. This also may not scale if hundreds of users are requesting simultaneously. This also exposes user IP addresses to this, imo, sketchy IP resolution service.
  3. The work to resolve lat/long from ip should not be taking place on the client. Instead, this could be regularly calculated by the validator and published to Arweave as another metrics entity type.
  4. IP resolution isn't that difficult and shouldn't necessarily rely on a third party service of questionable reputation.


try {
const responseData: any = await $fetch(
"https://onionoo.torproject.org/details"
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Similar to the comment above, this introduces a new, centralized, third-party dependency directly to the dashboard. Yes, technically the validator currently looks at Onionoo, but this may not always be the case. This also may not scale if hundreds of users are requesting simultaneously. This also exposes user IP addresses to Onionoo.
  2. Again, similar to the comment above, this could be part of the validator and published as a new metrics entity type.

useDistribution,
useFacilitator,
useRelayRegistry
} from '~/composables'
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically a correct improvement but please do try to keep unrelated changes separate 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we even need Mapbox or if there is some other open source map project that doesn't rely on a third party API and access tokens. I'm not really sure the point of the API or what it's actually doing other than gating what could be entirely client-side features.

Essentially, given a list of lat/long coords, put them on a map. The earth doesn't change much 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Just using this comment to provide some positive feedback: kudos on the quick pickup of both vue and nuxt 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments