Lesson 6 deploying error : Expected a value of type HttpNetworkConfig #5387
-
trying to deploy to sepolia network. but i cant get it to work. This is my deploy.js file require("dotenv").config();
const SEPOLIA_RPC_URL = process.env.SEPOLIA_RPC_URL;
const SEPOLIA_PVT_KEY = process.env.SEPOLIA_PVT_KEY;
const SEPOLIA_CHAIN_ID = process.env.SEPOLIA_CHAIN_ID;
module.exports = {
defaultNetwork: "hardhat",
networks: {
Sepolia: {
url: SEPOLIA_RPC_URL,
accounts: SEPOLIA_PVT_KEY,
chainId: SEPOLIA_CHAIN_ID,
},
},
solidity: "0.8.18",
};
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
}); this is the error i am getting
please help- search in google and discussions didnt help |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
accounts: [PRIVATE_KEY], |
Beta Was this translation helpful? Give feedback.
-
@rainbowginger update it; networks: {
sepolia: {
url: SEPOLIA_RPC_URL,
accounts: [SEPOLIA_PVT_KEY],
chainId: SEPOLIA_CHAIN_ID,
},
}, and make sure these variables are not undefined. |
Beta Was this translation helpful? Give feedback.
-
I am able to print the variables using
require("dotenv").config();
function main() {
console.log(process.env.SEPOLIA_RPC_URL);
}
main(); but cant print in bash using echo
|
Beta Was this translation helpful? Give feedback.
@rainbowginger Please do not create duplicate discussions.
For others: this discussion is answered here #5395
closing #5387