Getting an error while I'm trying to deploy a smart contract to Goerli testnet. The error:
Error HH8: There's one or more errors in your config file:
* Invalid account: #0 for network: goerli - private key too long, expected 32 bytes
To learn more about Hardhat's configuration, please go to https://hardhat.org/config/
For more info go to https://hardhat.org/HH8 or run Hardhat with --show-stack-traces
Here is my hardhat.config.js file:
/** @type import('hardhat/config').HardhatUserConfig */
require("@nomiclabs/hardhat-waffle");
const ALCHEMY_API_KEY = "API_KEY";
const GOERLI_PRIVATE_KEY = "PRV_KEY";
module.exports = {
solidity: "0.8.17",
networks: {
goerli: {
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [GOERLI_PRIVATE_KEY],
},
},
};
I was on the same directory (The scripts directory). Also I copied the private key from Metamask of my Goerli account. I searched on google but found nothing helpful.