I am trying to deploy a token smart contract to Ropsten test network with Infura, but I am always getting an error as I am using
truffle migrate --reset --network ropsten_infura
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358
callback(err);
^
Error: Callback was already called.
at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:1
at WriteStream.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:1)
at WriteStream.emit (events.js:315:20)
at WriteStream.destroy (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/level-ws/level-ws.js:140:1)
at finish (_stream_writable.js:681:14)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Here are my truffle-config.js config file :
const path = require("path");
require("dotenv").config({path: "./.env"});
const HDWalletProvider = require("@truffle/hdwallet-provider");
const AccountIndex = 0;
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
development: {
port: 7545,
host: "127.0.0.1",
network_id: 5777
},
ganache_local: {
provider: function() {
return new HDWalletProvider(process.env.MNEMONIC , "http://127.0.0.1:7545", AccountIndex)
},
network_id: 5777
},
goerli_infura: {
provider: function() {
return new HDWalletProvider(process.env.MNEMONIC, "https://goerli.infura.io/v3/INFURAKEY", AccountIndex);
},
network_id: 5
},
ropsten_infura: {
provider: function() {
return new HDWalletProvider(process.env.MNEMONIC, "https://ropsten.infura.io/v3/INFURAKEY", AccountIndex);
},
network_id: 3
}
},
compilers: {
solc: {
version: "0.6.1"
}
}
};
I am using:
- truffle 5.1.23
- npm 6.14.4
- node 14.0.0
- truffle-hdwallet-provider 1.0.34
Thank you in advance for your help !