From b558fbd4f96be15ce04ca7c319c555e89f751804 Mon Sep 17 00:00:00 2001 From: morkeltry Date: Sun, 13 Oct 2024 16:02:04 +0100 Subject: [PATCH] use getBlock or alchemy as RPC --- packages/hardhat/hardhat.config.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/hardhat/hardhat.config.ts b/packages/hardhat/hardhat.config.ts index 296fd11..fd49fa5 100644 --- a/packages/hardhat/hardhat.config.ts +++ b/packages/hardhat/hardhat.config.ts @@ -10,9 +10,12 @@ import "@nomicfoundation/hardhat-verify"; import "hardhat-deploy"; import "hardhat-deploy-ethers"; -// If not set, it uses ours Alchemy's default API key. -// You can get your own at https://dashboard.alchemyapi.io -const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF"; +const providerRpcUrl = process.env.PROVIDER_RPC; +const providerApiKey = process.env.GETBLOCK_API_KEY; + +// If not set, it uses ours Alchemy's default API key, which doesn't work (gives ProviderError: The team owning this app is inactive. Please contact support at https://dashboard.alchemyapi.io/support) +// You can get your own at https://dashboard.alchemyapi.io. +// const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr29-IqbuF"; // If not set, it uses the hardhat account 0 private key. const { MNEMONIC } = process.env; @@ -21,6 +24,11 @@ const deployerPrivateKey = // If not set, it uses ours Etherscan default API key. const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; +console.log({ + providerRpcUrl, + providerApiKey, +}); + const config: HardhatUserConfig = { solidity: { compilers: [ @@ -57,7 +65,7 @@ const config: HardhatUserConfig = { accounts: [deployerPrivateKey], }, sepolia: { - url: `https://eth-sepolia.g.alchemy.com/v2/${providerApiKey}`, + url: `${providerRpcUrl || "https://eth-sepolia.g.alchemy.com/v2/"}${providerApiKey}`, accounts: [deployerPrivateKey], }, arbitrum: {