0

I am running a local ganache-cli node on my machine and would like to have zero transaction fees. For this reason I am starting the node using

ganache-cli -g 0

which sets the gas price to zero. My initial migration file of truffle looks like this:

var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations, {
      gas: 0
  });
};

Upon running

truffle migrate

I get an error saying: base fee exceeds gas limit

What could be the problem? Thanks!

  • You can use zero gas price instead of gas. Zero gas will fail tx but zero gas won't if you are on the private net. – Prashant Prabhakar Singh Sep 19 at 2:47
0

The gas property is the maximum of gas you want to provide to the transaction, not the gas that will be used. The contract deployment is, depending on the contract, kind of a very expensive transaction. Concerning the command you launch, you set gas price to 0, but you still require gas even if it is worth nothing. I recommand you put the maximum gas of a block (arround 4m) or that you estimate the gas required for the deployment (with remix or deploying on a test chain like rinkeby).

For 0 fee transaction, it is not possible unless you change the source code of your private chain. Transaction fees are used to reward miners. Would you like to work for free?

  • In my opinion having zero-fee transactions on a private network makes perfect sense. My question is on how to achieve this using ganache. – jgulacsy Jul 17 '18 at 11:25
  • I think you are looking for the wrong thing. If you don't want transaction fees, why did you chose a POW chain? – Florian Castelain Jul 20 '18 at 6:50

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.