[Ethereum] Error: exceeds block gas limit

go-ethereumtruffle

geth comand

geth --rpc --rpcapi db,eth,net,web3,personal

Truffle.js

module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
live: {
network_id: 1,
host: "127.0.0.1",
port: 8545, // Different than the default below
from: "address",
gas: 4612388
}
}
};

Truffle MIgration:

truffle migrate --network live
Using network 'live'.

Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: exceeds block gas limit
at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/cli.bundled.js:43303:16)
at /usr/lib/node_modules/truffle/build/cli.bundled.js:331156:36
at /usr/lib/node_modules/truffle/build/cli.bundled.js:175492:11
at /usr/lib/node_modules/truffle/build/cli.bundled.js:314196:9
at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:315621:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:70159:18)
at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:70449:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:70604:12)
at IncomingMessage. (/usr/lib/node_modules/truffle/build/cli.bundled.js:70564:24)
at emitNone (events.js:91:20)

OS: Ubuntu 16.04
Node: 6.2
npm: 3.10
Contract is being deployed easily on testrpc and rinkeby only problem is publishing it on live network.
git hub error link.
https://github.com/trufflesuite/truffle/issues/773

Best Answer

See Ankush answer: https://ethereum.stackexchange.com/a/6310/44800

with command eth.getBlock("latest") you get your gas limit maximum. I have similar problem, and with this info it works when I set my gas (limit) for this maximum. At my case it was 5000000 (higher than truffle default 4712388)

Another way is to reset node gas limit: see: How to increase gas limit in block using geth?

Related Topic