diff --git a/apps/explorer-e2e/.env.testnet b/apps/explorer-e2e/.env.testnet index f4e9db066..1dac2f427 100644 --- a/apps/explorer-e2e/.env.testnet +++ b/apps/explorer-e2e/.env.testnet @@ -1,6 +1,6 @@ # App configuration variables NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api -NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz/tm +NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql NX_VEGA_ENV=TESTNET diff --git a/apps/explorer/.env b/apps/explorer/.env index 1f3fc8951..939f68973 100644 --- a/apps/explorer/.env +++ b/apps/explorer/.env @@ -1,14 +1,7 @@ -NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api -NX_TENDERMINT_URL=http://localhost:26617 -NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket -NX_VEGA_URL=http://localhost:3028/query -NX_VEGA_ENV=CUSTOM - NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json -NX_VEGA_URL=https://api.n01.stagnet3.vega.xyz/graphql NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV=STAGNET3 NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions diff --git a/apps/explorer/.env.testnet b/apps/explorer/.env.testnet index 3ad86f521..e90d0804c 100644 --- a/apps/explorer/.env.testnet +++ b/apps/explorer/.env.testnet @@ -1,9 +1,8 @@ # App configuration variables NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api -NX_TENDERMINT_URL=https://tm.n06.testnet.vega.xyz -NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n06.testnet.vega.xyz/websocket +NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz +NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n07.testnet.vega.xyz/websocket NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/testnet-network.json -NX_VEGA_URL=https://api.n09.testnet.vega.xyz/graphql NX_VEGA_NETWORKS='{"TESTNET":"https://explorer.fairground.wtf","MAINNET":"https://explorer.vega.xyz"}' NX_VEGA_ENV=TESTNET NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions diff --git a/apps/explorer/src/app/routes/pending/index.tsx b/apps/explorer/src/app/routes/pending/index.tsx index 88dcf5800..cc4a7fc7a 100644 --- a/apps/explorer/src/app/routes/pending/index.tsx +++ b/apps/explorer/src/app/routes/pending/index.tsx @@ -17,7 +17,6 @@ const PendingTxs = () => { {t('Unconfirmed transactions')} - https://tm.n06.testnet.vega.xyz/tm/unconfirmed_txs
{t(`Number: ${unconfirmedTransactions?.result?.n_txs || 0}`)}

diff --git a/libs/environment/src/hooks/use-config.spec.tsx b/libs/environment/src/hooks/use-config.spec.tsx index a747ac219..5f4179b00 100644 --- a/libs/environment/src/hooks/use-config.spec.tsx +++ b/libs/environment/src/hooks/use-config.spec.tsx @@ -87,24 +87,6 @@ describe('useConfig hook', () => { }); }); - it('caches the configuration', async () => { - const { result: firstResult } = renderHook(() => - useConfig({ environment: mockEnvironment }, onError) - ); - - await waitFor(() => { - expect(fetch).toHaveBeenCalledTimes(1); - expect(firstResult.current.config).toEqual(mockConfig); - }); - - const { result: secondResult } = renderHook(() => - useConfig({ environment: mockEnvironment }, onError) - ); - - expect(fetch).toHaveBeenCalledTimes(1); - expect(secondResult.current.config).toEqual(mockConfig); - }); - it('executes the error callback when the config endpoint fails', async () => { // @ts-ignore typescript doesn't recognise the mocked instance global.fetch.mockImplementation(() => Promise.reject()); diff --git a/libs/environment/src/hooks/use-config.tsx b/libs/environment/src/hooks/use-config.tsx index 7ed2cbd58..bc1ee1277 100644 --- a/libs/environment/src/hooks/use-config.tsx +++ b/libs/environment/src/hooks/use-config.tsx @@ -1,11 +1,8 @@ import { useState, useEffect } from 'react'; -import { LocalStorage } from '@vegaprotocol/react-helpers'; import { ErrorType } from '../types'; -import type { Environment, Configuration, Networks } from '../types'; +import type { Environment, Configuration } from '../types'; import { validateConfiguration } from '../utils/validate-configuration'; -export const LOCAL_STORAGE_NETWORK_KEY = 'vegaNetworkConfig'; - export type EnvironmentWithOptionalUrl = Partial & Omit; @@ -16,36 +13,6 @@ const compileHosts = (hosts: string[], envUrl?: string) => { return hosts; }; -const getCacheKey = (env: Networks) => `${LOCAL_STORAGE_NETWORK_KEY}-${env}`; - -const getCachedConfig = (env: Networks, envUrl?: string) => { - const cacheKey = getCacheKey(env); - const value = LocalStorage.getItem(cacheKey); - - if (value) { - try { - const config = JSON.parse(value) as Configuration; - const hasError = validateConfiguration(config); - - if (hasError) { - throw new Error('Invalid configuration found in the storage.'); - } - - return { - ...config, - hosts: compileHosts(config.hosts, envUrl), - }; - } catch (err) { - LocalStorage.removeItem(cacheKey); - console.warn( - 'Malformed data found for network configuration. Removed cached configuration, continuing...' - ); - } - } - - return undefined; -}; - type UseConfigOptions = { environment: EnvironmentWithOptionalUrl; defaultConfig?: Configuration; @@ -57,7 +24,7 @@ export const useConfig = ( ) => { const [loading, setLoading] = useState(false); const [config, setConfig] = useState( - defaultConfig ?? getCachedConfig(environment.VEGA_ENV, environment.VEGA_URL) + defaultConfig ); useEffect(() => { @@ -78,10 +45,6 @@ export const useConfig = ( const hosts = compileHosts(configData.hosts, environment.VEGA_URL); isMounted && setConfig({ hosts }); - LocalStorage.setItem( - getCacheKey(environment.VEGA_ENV), - JSON.stringify({ hosts }) - ); isMounted && setLoading(false); } catch (err) { if (isMounted) {