feat(Relays): added logic to manage relays #63

Closed
y wants to merge 8 commits from relays-management into main
Owner

Issue

Closes #38

Intent

  • Add a Relays page in order to manage user's relays.

Implementation

  • Added relays page to src/pages/relays/index.tsx.
  • Added relays state to src/store/relays.
  • Improved authAndGetMetadataAndRelaysMap method of AuthController to also get relay map.
  • Added getRelayMap and publishRelayMap methods to NostrController.
  • Added useAppDispatch and useAppSelector hooks to src/hooks/store.ts.
  • Added compareObjects utility to src/utils/utils.ts.
## Issue Closes #38 ## Intent - Add a `Relays` page in order to manage user's relays. ## Implementation - Added relays page to `src/pages/relays/index.tsx`. - Added relays state to `src/store/relays`. - Improved `authAndGetMetadataAndRelaysMap` method of `AuthController` to also get relay map. - Added `getRelayMap` and `publishRelayMap` methods to `NostrController`. - Added `useAppDispatch` and `useAppSelector` hooks to `src/hooks/store.ts`. - Added `compareObjects` utility to `src/utils/utils.ts`.
y added 1 commit 2024-05-21 05:21:11 +00:00
s approved these changes 2024-05-21 06:20:41 +00:00
m approved these changes 2024-05-21 06:38:26 +00:00
@ -377,0 +391,4 @@
npub: string
): Promise<{ map: RelayMap; mapUpdated: number }> => {
const mostPopularRelays = import.meta.env.VITE_MOST_POPULAR_RELAYS
const hardcodedPopularRelays = (mostPopularRelays || '').split(' ')
Owner

Does this mean we will not use a https://stats.nostr.band/stats_api?method=stats service to fetch most popular relays?

Does this mean we will not use a https://stats.nostr.band/stats_api?method=stats service to fetch most popular relays?
Author
Owner

do we already use such an approach to fetch relays?
In the MetadataController we also use env.

do we already use such an approach to fetch relays? In the `MetadataController` we also use env.
Owner

We do have in the other project, sending you link in the DM

We do have in the other project, sending you link in the DM
@ -0,0 +205,4 @@
<Box className={styles.relaysContainer}>
{Object.keys(relayMap).map((relay, i) => (
<Box className={styles.relay} key={`relay_${i}`}>
<List>
Owner

I suggest implementing an indication (green/red dot) if the relay actually works. Because relay can be:

  • Unreachable (down)
  • Requiring payment

image example

I suggest implementing an indication (green/red dot) if the relay actually works. Because relay can be: - Unreachable (down) - Requiring payment ![image example](https://paste.4gl.io/?b27a689748f5d0e4#FPrJLQbXDrKv3CAZ7iaYEma4cKgTNGihXEpWprFdWvhw)
Author
Owner

Good suggestion!
I think we should implement this feature later as it feels like nice to have, but is not crucial.

Good suggestion! I think we should implement this feature later as it feels like nice to have, but is not crucial.
y added 6 commits 2024-05-24 12:57:10 +00:00
y added 1 commit 2024-05-24 13:05:57 +00:00
y closed this pull request 2024-05-24 13:13:52 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
s
m
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#63
No description provided.