I want to use private key to access my address, and I tried but It always return the address which is not mine.
var HDWalletProvider = require("truffle-hdwallet-provider");
var privateKey = process.env.KEY;
var infuraApiKey = process.env.INFURA;
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
mainnet: {
provider: function () {
return new HDWalletProvider(
privateKey,
"https://mainnet.infura.io/v3/" + infuraApiKey
);
},
network_id: 1,
gas: 2000000,
gasPrice: 8000000000 // 8 Gwei
}
}
};
The "KEY" is definitely correct, because I can access my address through MyEtherWallet using this pricateKEY.
And also I'm so sure that this KEY is pure nondecrypted strings which consists 64 characters.
I'm stuck two days, but I can get no answer. I think this code is correct, so I can't find out what is the cause.
Thanks in advance...
I want to use private key to access my address, and I tried but It always return the address which is not mine.
The "KEY" is definitely correct, because I can access my address through MyEtherWallet using this pricateKEY. And also I'm so sure that this KEY is pure nondecrypted strings which consists 64 characters.
I'm stuck two days, but I can get no answer. I think this code is correct, so I can't find out what is the cause. Thanks in advance...