0

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 !

  • Can you share your migrations scripts? – Ismael Apr 24 at 13:27
0

Got the same problem, it seems to arise with Node 14. I dont get the error with Node v13

| improve this answer | |
0

I had the same issue, after asking a around and searching around a bit, here is the quick solution and reason.

My setting is: Truffle v5.1.31 node v14.4.0 Solidity v0.5.0

  1. downgrade the ndoe to 12, which is not I want, so i found way 2
  2. run "truffle migrate --network ropsten --skipDryRun"
    (https://github.com/trufflesuite/truffle/issues/3008)

Because the ganache-cli's internal core is not yet node 14 compatible, so sky dry run as explained by Cruz Molina from the previous issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.