From b46c0794a9a2cd5afa120dba91a8e5e15d2337d8 Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Thu, 20 Feb 2025 17:17:01 +0100 Subject: [PATCH] feat: add holesky as supported network --- .env.template | 3 +++ config.testnet.json | 2 +- ...thereum-network-configuration.provider.tsx | 22 +++++++++++++++++++ src/shared/constants/ethereum.constants.ts | 2 ++ src/shared/models/configuration.ts | 2 ++ src/shared/models/ethereum-models.ts | 3 ++- vite.config.ts | 3 +++ 7 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.env.template b/.env.template index f70609e0..d1210857 100644 --- a/.env.template +++ b/.env.template @@ -34,6 +34,9 @@ VITE_ETHEREUM_DEPLOYMENT_BRANCH= # Ethereum Network Endpoint VITE_L1_OBSERVER_NODE= +# Holesky Network Endpoint +VITE_HOLESKY_OBSERVER_NODE= + # Arbitrum Network Endpoint VITE_ARBITRUM_OBSERVER_NODE= diff --git a/config.testnet.json b/config.testnet.json index 81e9b7cb..b785a2eb 100644 --- a/config.testnet.json +++ b/config.testnet.json @@ -2,7 +2,7 @@ "appEnvironment": "testnet", "coordinatorURL": "https://testnet.dlc.link/attestor-1", "attestorSharedConfigurationURL": "https://raw.githubusercontent.com/DLC-link/shared-attestor-configuration/refs/heads/main", - "enabledEthereumNetworkIDs": ["421614", "84532", "11155111"], + "enabledEthereumNetworkIDs": ["421614", "84532", "11155111", "17000"], "enabledRippleNetworkIDs": ["1"], "bitcoinNetwork": "testnet", "bitcoinNetworkIndex": 1, diff --git a/src/app/providers/ethereum-network-configuration.provider.tsx b/src/app/providers/ethereum-network-configuration.provider.tsx index 6b8a9c32..9b29a3de 100644 --- a/src/app/providers/ethereum-network-configuration.provider.tsx +++ b/src/app/providers/ethereum-network-configuration.provider.tsx @@ -17,6 +17,7 @@ import { baseSepolia, bsc, hardhat, + holesky, mainnet, sepolia, } from 'viem/chains'; @@ -211,6 +212,27 @@ function getEthereumNetworkConfiguration( ), chain: bsc, }; + case EthereumNetworkID.Holesky: + return { + ethereumExplorerAPIURL: bsc.blockExplorers.default.apiUrl, + websocketURL: appConfiguration.holeskyWebsocket, + httpURL: appConfiguration.holeskyHTTP, + ethereumAttestorChainID: 'evm-holesky', + enabledEthereumNetworks, + dlcManagerContract: getEthereumContractWithProvider( + getEthereumNetworkDeploymentPlans(holesky), + holesky, + 'DLCManager', + appConfiguration.holeskyWebsocket + ), + iBTCContract: getEthereumContractWithProvider( + getEthereumNetworkDeploymentPlans(holesky), + holesky, + 'IBTC', + appConfiguration.holeskyWebsocket + ), + chain: holesky, + }; case EthereumNetworkID.Hardhat: return { ethereumExplorerAPIURL: '', diff --git a/src/shared/constants/ethereum.constants.ts b/src/shared/constants/ethereum.constants.ts index 961fe20d..a4ebcbff 100644 --- a/src/shared/constants/ethereum.constants.ts +++ b/src/shared/constants/ethereum.constants.ts @@ -7,6 +7,7 @@ import { baseSepolia, bsc, hardhat, + holesky, mainnet, sepolia, } from 'viem/chains'; @@ -20,5 +21,6 @@ export const SUPPORTED_VIEM_CHAINS: Chain[] = [ bsc, avalanche, baseSepolia, + holesky, hardhat, ]; diff --git a/src/shared/models/configuration.ts b/src/shared/models/configuration.ts index b44ba173..2df62cf3 100644 --- a/src/shared/models/configuration.ts +++ b/src/shared/models/configuration.ts @@ -30,6 +30,8 @@ export interface Configuration { localAttestorExtendedGroupPublicKey?: string; l1Websocket: string; l1HTTP: string; + holeskyWebsocket: string; + holeskyHTTP: string; arbitrumWebsocket: string; arbitrumHTTP: string; baseWebsocket: string; diff --git a/src/shared/models/ethereum-models.ts b/src/shared/models/ethereum-models.ts index fece5920..e14dd7d7 100644 --- a/src/shared/models/ethereum-models.ts +++ b/src/shared/models/ethereum-models.ts @@ -16,7 +16,8 @@ export interface EthereumNetworkConfiguration { | 'evm-avax' | 'evm-bsc' | 'evm-hardhat-arb' - | 'evm-hardhat-eth'; + | 'evm-hardhat-eth' + | 'evm-holesky'; enabledEthereumNetworks: EthereumNetwork[]; dlcManagerContract: Contract; iBTCContract: Contract; diff --git a/vite.config.ts b/vite.config.ts index 3a985f08..000e6f6b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -66,6 +66,7 @@ export default defineConfig(async ({ mode }) => { appConfiguration.ethereumContractInformations = await fetchEthereumDeploymentPlans(environmentName, branchName, appConfiguration.enabledEthereumNetworkIDs, localDeploymentFilesURL); const arbitrumURLs: string[] = env.VITE_ARBITRUM_OBSERVER_NODE.split(','); const l1URLs: string[] = env.VITE_L1_OBSERVER_NODE.split(','); + const holeskyURLs: string[] = env.VITE_HOLESKY_OBSERVER_NODE.split(','); const baseURLs: string[] = env.VITE_BASE_OBSERVER_NODE.split(','); const avalancheURLs: string[] = env.VITE_AVALANCHE_OBSERVER_NODE.split(','); const bscURLs: string[] = env.VITE_BSC_OBSERVER_NODE.split(','); @@ -74,6 +75,8 @@ export default defineConfig(async ({ mode }) => { appConfiguration.arbitrumHTTP = arbitrumURLs[1]; appConfiguration.l1Websocket = l1URLs[0]; appConfiguration.l1HTTP = l1URLs[1]; + appConfiguration.holeskyWebsocket = holeskyURLs[0]; + appConfiguration.holeskyHTTP = holeskyURLs[1]; appConfiguration.baseWebsocket = baseURLs[0]; appConfiguration.baseHTTP = baseURLs[1]; appConfiguration.avalancheWebsocket = avalancheURLs[0];