geth comand

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


module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
live: {
network_id: 1,
host: "",
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


in your migrations you have to specify the gas amount


You're probably overlooking the need to unlock and fund the account you're deploying from.

Have a look over here: truffle deploy: Network state unknown when geth is synced

Hope it helps.

  • i have tried that but it didn't work actually. – Inzmam ul Hassan Apr 18 '18 at 15:04

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?


This might be the indication of some mistake in a smart contract that you are trying to deploy. Can you share a code of smart contract that you are trying to deploy? You might need to debug the code line by line to understand the cause of this exception.

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.