Reputation: 31
I'm beginner to blockchain development, and I have a question in the polygon documentation in order to make a deployment using hradhat, you need to pass account: process.env.PRIVATE_KEY, but how do I get the user's private key when logging in to the metamask on the site?
require('dotenv').config();
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
module.exports = {
defaultNetwork: "matic",
networks: {
hardhat: {
},
matic: {
url: "https://rpc-mumbai.maticvigil.com",
accounts: [process.env.PRIVATE_KEY]
}
},
etherscan: {
apiKey: process.env.POLYGONSCAN_API_KEY
},
solidity: {
version: "0.7.0",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
}
Upvotes: 2
Views: 6616
Reputation: 11
Yes, you can get the MetaMask Private key through Google Chrome Extension.
Make sure you do not share this with anyone this address have a all your assets stored.
Upvotes: 1
Reputation: 418
In MetaMask's "Account details" there is an "export private key" option
Upvotes: 2