diff --git a/src/components/app-body/nostr/content-creators/content-creators-list.js b/src/components/app-body/nostr/content-creators/content-creators-list.js index 2895b3b..0593e07 100644 --- a/src/components/app-body/nostr/content-creators/content-creators-list.js +++ b/src/components/app-body/nostr/content-creators/content-creators-list.js @@ -2,8 +2,8 @@ import React, { useState, useEffect, useCallback } from 'react' import { Container, Spinner, Dropdown } from 'react-bootstrap' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faFilter } from '@fortawesome/free-solid-svg-icons' - import axios from 'axios' + // Local libraries import config from '../../../../config' import ContentCard from './content-card' @@ -23,9 +23,8 @@ function ContentCreators (props) { const list = await new Promise((resolve, reject) => { let list = [] const { nostrKeyPair } = appData.bchWalletState - const psf = 'wss://nostr-relay.psfoundation.info' - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 1, kinds: [3], authors: [nostrKeyPair.pubHex] }) }) @@ -52,9 +51,7 @@ function ContentCreators (props) { const loadProfile = useCallback(async (pubKey) => { return new Promise((resolve) => { - const psf = 'wss://nostr-relay.psfoundation.info' - - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 5, kinds: [0], authors: [pubKey] }) }) diff --git a/src/components/app-body/nostr/feeds/following.js b/src/components/app-body/nostr/feeds/following.js index 78dffb1..621e65a 100644 --- a/src/components/app-body/nostr/feeds/following.js +++ b/src/components/app-body/nostr/feeds/following.js @@ -4,9 +4,10 @@ // Global npm libraries import React, { useEffect, useState } from 'react' import { Container, Spinner } from 'react-bootstrap' - import { RelayPool } from 'nostr' +// Local libraries +import config from '../../../../config' import FeedCard from './feed-card' function Following (props) { @@ -19,9 +20,8 @@ function Following (props) { const followingList = await new Promise((resolve, reject) => { let list = [] const { nostrKeyPair } = appData.bchWalletState - const psf = 'wss://nostr-relay.psfoundation.info' - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 1, kinds: [3], authors: [nostrKeyPair.pubHex] }) }) diff --git a/src/components/app-body/nostr/feeds/index.js b/src/components/app-body/nostr/feeds/index.js index e01c6dc..13d68b9 100644 --- a/src/components/app-body/nostr/feeds/index.js +++ b/src/components/app-body/nostr/feeds/index.js @@ -10,6 +10,7 @@ import { RelayPool } from 'nostr' // Local libraries import Feed from './feed' import Following from './following' +import config from '../../../../config' function Feeds (props) { const { appData } = props @@ -30,9 +31,7 @@ function Feeds (props) { return currentProfiles }) - const psf = 'wss://nostr-relay.psfoundation.info' - - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 5, kinds: [0], authors: [pubkey] }) }) @@ -72,9 +71,7 @@ function Feeds (props) { // Get global feed posts useEffect(() => { const start = () => { - const psf = 'wss://nostr-relay.psfoundation.info' - - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('REQ', { limit: 10, kinds: [1], '#t': ['slpdex-socialmedia'] }) }) diff --git a/src/components/app-body/nostr/profile/profile-read.js b/src/components/app-body/nostr/profile/profile-read.js index d8d2466..b879649 100644 --- a/src/components/app-body/nostr/profile/profile-read.js +++ b/src/components/app-body/nostr/profile/profile-read.js @@ -7,9 +7,12 @@ import { Container, Button } from 'react-bootstrap' import CopyOnClick from '../../bch-wallet/copy-on-click.js' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faUser, faGlobe } from '@fortawesome/free-solid-svg-icons' +import * as nip19 from 'nostr-tools/nip19' + +// Local libraries +import config from '../../../../config' import NostrFormat from '../nostr-format' import { RelayPool } from 'nostr' -import * as nip19 from 'nostr-tools/nip19' function ProfileRead (props) { const { npub } = props @@ -22,9 +25,8 @@ function ProfileRead (props) { const start = () => { const pubHexData = nip19.decode(npub) const pubHex = pubHexData.data - const psf = 'wss://nostr-relay.psfoundation.info' - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 5, kinds: [0], authors: [pubHex] }) setLoaded(true) diff --git a/src/components/app-body/nostr/profile/public-read.js b/src/components/app-body/nostr/profile/public-read.js index 7b134f5..e17a1d5 100644 --- a/src/components/app-body/nostr/profile/public-read.js +++ b/src/components/app-body/nostr/profile/public-read.js @@ -6,10 +6,13 @@ import React, { useEffect, useState } from 'react' import { Container, Card, Spinner } from 'react-bootstrap' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faUser } from '@fortawesome/free-solid-svg-icons' -import NostrFormat from '../nostr-format' import { RelayPool } from 'nostr' import * as nip19 from 'nostr-tools/nip19' +// Local libraries +import config from '../../../../config' +import NostrFormat from '../nostr-format' + function PublicRead (props) { const { npub } = props const { bchWalletState } = props.appData @@ -22,9 +25,8 @@ function PublicRead (props) { const pubHexData = nip19.decode(npub) const pubHex = pubHexData.data console.log('pubhex', pubHex) - const psf = 'wss://nostr-relay.psfoundation.info' - const pool = RelayPool([psf]) + const pool = RelayPool(config.nostrRelays) pool.on('open', relay => { relay.subscribe('subid', { limit: 5, kinds: [1], authors: [pubHex] }) setLoaded(true)