"Migrations" exceeded the block limit (with a gas value you set).

0 votes

Please help me solve this error while migrating truffle:

1_initial_migration.js
======================
   Deploying 'Migrations'
   ----------------------
Error:  *** Deployment Failed ***
"Migrations" exceeded the block limit (with a gas value you set).
   * Block limit:  2582365
   * Gas sent:     20000000
   * Try:
      + Sending less gas.
      + Setting a higher network block limit if you are on a
        private network or test client (like ganache).
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.0.2 (core: 5.0.2)
Jan 17 in Blockchain by slayer
• 29,170 points
792 views
I am also getting this error.

1 answer to this question.

0 votes

In the error you have posted, in this part:

 * Block limit:  2582365
 * Gas sent:     20000000

you can see that gas is more than block limit. To solve this, you have to reduce the gas in truffle.js file.

answered Jan 17 by Omkar
• 67,660 points
How to go about this?

Like I mentioned in the answer,open your truffle.js file with a text editor and decrease the gas value.

Block Limit is changing on every migration. that's why I can't fix the gas accordingly.
Did you try setting gas to a lower value? Until and unless gas is less than block limit, I think it should be fine.

Related Questions In Blockchain

0 votes
1 answer

In a Blockchain, how difficult is it to modify the third to last block?

Technically, it's not difficult at all, all ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,790 points
79 views
0 votes
1 answer

Is it that new bitcoins gets created with the every block mined??

Bitcoin mining means validation of a block ...READ MORE

answered Apr 20, 2018 in Blockchain by Perry
• 17,020 points
39 views
0 votes
1 answer

What if Gas required in my program exceeds the limit of 3000000?

Going through your code, I noticed that  you ...READ MORE

answered May 29, 2018 in Blockchain by Perry
• 17,020 points
78 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
169 views
0 votes
1 answer
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 67,660 points
103 views
0 votes
1 answer
0 votes
1 answer

Transfer the gas value of contract to my own address

Works fine for me: pragma solidity ^0.4.0; contract Test ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 67,660 points
32 views