0

When starting local ganache blockchain I am able to specify block gasLimit for the network.

Example:

 ganache-cli --gasLimit=60000000

I tired to do same with hardhat node

npx hardhat node --gasLimit==60000000

But that doesn't seem to work, so I hope someone here knows the way around this.

3
  • npx hardhat node --gasLimit==60000000 why == ?
    – Majd TL
    Oct 19, 2022 at 8:42
  • I haven't seen any example where you can give args to "npx hardhat node"
    – Majd TL
    Oct 19, 2022 at 8:51
  • I just started using it, so I was experimenting. As far as I can see, I need to go to hardhat.config.js and set the block gasLimit there
    – Sky
    Oct 19, 2022 at 8:55

1 Answer 1

1

I managed to do it by setting the blockGasLimit value inside hardhat.config.js

require("hardhat-tracer");
require("@nomiclabs/hardhat-waffle");


/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {

  defaultNetwork: "hardhat",
  networks: {
      hardhat: {
          blockGasLimit: 60000000 // Network block gasLimit
      },
  },

  solidity: {
    version: "0.8.3",
    settings: {
      optimizer: {
        enabled: true,
        runs: 2**32-1,     // Optimized for SmartContract usage, not deployment cost.
      },
    },
  },

};
1
  • 👍🏻good idea ……
    – Majd TL
    Oct 19, 2022 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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