From 7193aa7cec736fce29de4ce089b9b550dfb10054 Mon Sep 17 00:00:00 2001 From: rrozek Date: Fri, 11 Oct 2024 15:15:28 +0200 Subject: [PATCH 1/2] rpc endpoints from envs --- .../dapp-analytics.controller.ts | 2 ++ src/components/node-api/chainstate.ts | 23 +++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/dapp-analytics/dapp-analytics.controller.ts b/src/components/dapp-analytics/dapp-analytics.controller.ts index 89fd442..fcfa6e4 100644 --- a/src/components/dapp-analytics/dapp-analytics.controller.ts +++ b/src/components/dapp-analytics/dapp-analytics.controller.ts @@ -477,6 +477,8 @@ export async function fetchDappById(id) { const response = await axios.get( `${API_BASE_URL}/dapp-analytics/dapp/${id}`, ); + logger.info(response.data); + // const blockchainData = await if (response.status === 200) { return { data: response.data, error: null }; } diff --git a/src/components/node-api/chainstate.ts b/src/components/node-api/chainstate.ts index e97287b..1a34eb8 100644 --- a/src/components/node-api/chainstate.ts +++ b/src/components/node-api/chainstate.ts @@ -2,15 +2,20 @@ import { ApiPromise, WsProvider } from '@polkadot/api'; import { ethers } from 'ethers'; const rpcEndpoints: { [key: string]: string } = { - polkadot: 'wss://rpc.polkadot.io', - kusama: 'wss://kusama-rpc.polkadot.io', - 'aleph-zero': 'wss://rpc.azero.dev', - moonbeam: 'wss://moonbeam.api.onfinality.io/public-ws', - 'arbitrum-one': 'https://arb1.arbitrum.io/rpc', - 'arbitrum-nova': 'https://nova.arbitrum.io/rpc', - optimism: 'https://optimism.api.onfinality.io/public', - bifrost: 'wss://bifrost-rpc.dwellir.com', - hydration: 'wss://hydradx-rpc.dwellir.com', + polkadot: process.env.WSS_POLKADOT || 'wss://rpc.polkadot.io', + kusama: process.env.WSS_KUSAMA || 'wss://kusama-rpc.polkadot.io', + 'aleph-zero': process.env.WSS_ALEPH_ZERO || 'wss://rpc.azero.dev', + moonbeam: + process.env.WSS_MOONBEAM || 'wss://moonbeam.api.onfinality.io/public-ws', + 'arbitrum-one': + process.env.RPC_ARBITRUM_ONE || 'https://arb1.arbitrum.io/rpc', + 'arbitrum-nova': + process.env.RPC_ARBITRUM_NOVA || 'https://nova.arbitrum.io/rpc', + ethereum: process.env.RPC_ETHEREUM || 'https://eth.api.onfinality.io/public', + optimism: + process.env.RPC_OPTIMISM || 'https://optimism.api.onfinality.io/public', + bifrost: process.env.WSS_BIFROST || 'wss://bifrost-rpc.dwellir.com', + hydration: process.env.WSS_HYDRATION || 'wss://hydradx-rpc.dwellir.com', }; export async function getCurrentBlock(chain: string): Promise { From 80f94097656dbe9fa47ddc8cc1c9c155872ef6fa Mon Sep 17 00:00:00 2001 From: rrozek Date: Fri, 11 Oct 2024 15:44:36 +0200 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8748f2..45671b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dashboard-creator-server", "private": false, - "version": "3.3.0", + "version": "3.3.1", "license": "MIT", "main": "src/server.ts", "engines": {