Skip to content

Commit

Permalink
use getBlock or alchemy as RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
morkeltry committed Oct 13, 2024
1 parent 99d5733 commit b558fbd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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: [
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit b558fbd

Please sign in to comment.