From f029c4df92e7669b351b848e785681d4ab7a2c8d Mon Sep 17 00:00:00 2001 From: Trung-Tin Pham <60747384+AtelyPham@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:22:39 +0700 Subject: [PATCH] Update testnet RPC endpoints and opt out data cache (#1940) --- .../RankingTableSection/fetchLeaderboardData.ts | 3 ++- libs/dapp-config/src/chains/evm/index.tsx | 10 ++++++++-- libs/dapp-config/src/chains/substrate/index.tsx | 12 +++++++++--- libs/webb-ui-components/src/constants/index.ts | 8 ++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/apps/testnet-leaderboard/components/RankingTableSection/fetchLeaderboardData.ts b/apps/testnet-leaderboard/components/RankingTableSection/fetchLeaderboardData.ts index 119850577e..9f1c8fc0e5 100644 --- a/apps/testnet-leaderboard/components/RankingTableSection/fetchLeaderboardData.ts +++ b/apps/testnet-leaderboard/components/RankingTableSection/fetchLeaderboardData.ts @@ -17,7 +17,8 @@ const fetchLeaderboardData = async ( } const response = await fetch( - `${BACKEND_URL}/leaderboard?${searchParams.toString()}` + `${BACKEND_URL}/leaderboard?${searchParams.toString()}`, + { next: { revalidate: 60 } } // seconds ); const data = await response.json(); diff --git a/libs/dapp-config/src/chains/evm/index.tsx b/libs/dapp-config/src/chains/evm/index.tsx index b477dd8a5a..2f0ed11387 100644 --- a/libs/dapp-config/src/chains/evm/index.tsx +++ b/libs/dapp-config/src/chains/evm/index.tsx @@ -325,12 +325,18 @@ export const chainsConfig: Record = { default: { http: process.env['USING_LOCAL_TANGLE'] ? ['http://localhost:9944'] - : ['https://rpc-archive.tangle.tools', 'https://rpc.tangle.tools'], + : [ + 'https://testnet-rpc-archive.tangle.tools', + 'https://testnet-rpc.tangle.tools', + ], }, public: { http: process.env['USING_LOCAL_TANGLE'] ? ['http://localhost:9944'] - : ['https://rpc-archive.tangle.tools', 'https://rpc.tangle.tools'], + : [ + 'https://testnet-rpc-archive.tangle.tools', + 'https://testnet-rpc.tangle.tools', + ], }, }, contracts: hostedOrbitMulticall3Address diff --git a/libs/dapp-config/src/chains/substrate/index.tsx b/libs/dapp-config/src/chains/substrate/index.tsx index bb58ff166f..355590f8c6 100644 --- a/libs/dapp-config/src/chains/substrate/index.tsx +++ b/libs/dapp-config/src/chains/substrate/index.tsx @@ -62,7 +62,7 @@ export const chainsConfig: Record = { name: 'Tangle Explorer', url: process.env['USING_LOCAL_TANGLE'] ? populateBlockExplorerStub('ws://127.0.0.1:9944') - : populateBlockExplorerStub('wss://rpc-archive.tangle.tools'), + : populateBlockExplorerStub('wss://testnet-rpc-archive.tangle.tools'), }, }, rpcUrls: { @@ -70,13 +70,19 @@ export const chainsConfig: Record = { http: [], webSocket: process.env['USING_LOCAL_TANGLE'] ? ['ws://127.0.0.1:9944'] - : ['wss://rpc-archive.tangle.tools', 'wss://rpc.tangle.tools'], + : [ + 'wss://testnet-rpc-archive.tangle.tools', + 'wss://testnet-rpc.tangle.tools', + ], }, public: { http: [], webSocket: process.env['USING_LOCAL_TANGLE'] ? ['ws://127.0.0.1:9944'] - : ['wss://rpc-archive.tangle.tools', 'wss://rpc.tangle.tools'], + : [ + 'wss://testnet-rpc-archive.tangle.tools', + 'wss://testnet-rpc.tangle.tools', + ], }, }, env: ['development'], diff --git a/libs/webb-ui-components/src/constants/index.ts b/libs/webb-ui-components/src/constants/index.ts index 6547ab40e1..f3ee90dbdb 100644 --- a/libs/webb-ui-components/src/constants/index.ts +++ b/libs/webb-ui-components/src/constants/index.ts @@ -72,7 +72,7 @@ export const WEBB_CAREERS_URL = 'https://wellfound.com/company/webb-4/jobs'; export const TANGLE_TESTNET_EXPLORER_URL = 'https://explorer.tangle.tools'; export const TANGLE_STANDALONE_EXPLORER_URL = - 'https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-archive.tangle.tools#/explorer'; + 'https://cloudflare-ipfs.com/ipns/dotapps.io/?rpc=wss%3A%2F%2Ftestnet-rpc-archive.tangle.tools#/explorer'; export const WEBB_DAPP_NEW_ISSUE_URL = 'https://github.com/webb-tools/webb-dapp/issues/new/choose'; @@ -85,7 +85,7 @@ export const GITHUB_BUG_REPORT_URL = 'https://github.com/webb-tools/webb-dapp/issues/new?assignees=&labels=bug+%F0%9F%AA%B2&projects=&template=bug_report.md&title=%5BBUG%5D+'; export const POLKADOT_EXPLORER_URL = - 'https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc-archive.tangle.tools#/explorer/query'; + 'https://cloudflare-ipfs.com/ipns/dotapps.io/?rpc=wss%3A%2F%2Ftestnet-rpc-archive.tangle.tools#/explorer/query'; export const FOLLOW_WEBB_TWITTER_URL = 'https://twitter.com/intent/follow?screen_name=webbprotocol'; @@ -94,12 +94,12 @@ export const DKG_STATS_KEYS_URL = `${DKG_STATS_URL}/#/keys`; export const DKG_STATS_AUTHORITIES_URL = `${DKG_STATS_URL}/#/authorities`; export const DKG_STATS_PROPOSALS_URL = `${DKG_STATS_URL}/#/proposals`; -export const TANGLE_RPC_ENDPOINT = 'wss://rpc-archive.tangle.tools'; +export const TANGLE_RPC_ENDPOINT = 'wss://testnet-rpc-archive.tangle.tools'; export const SUBQUERY_ENDPOINT = 'https://standalone-subql.tangle.tools/graphql'; export const TANGLE_STAKING_URL = - 'https://polkadot.js.org/apps/?rpc=wss://rpc-archive.tangle.tools#/staking'; + 'https://cloudflare-ipfs.com/ipns/dotapps.io/?rpc=wss%3A%2F%2Ftestnet-rpc-archive.tangle.tools#/staking'; export const STAKING_PRECOMPILE_LINK = 'https://github.com/webb-tools/tangle/blob/main/precompiles/staking/StakingInterface.sol';