I am tring to deploy our ERC20 token in main net it gives an error Error: exceeds block gas limit. First I download or sync whole blockchain using geth command ( geth --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=1024 --rpcport 8546 --rpcaddr --rpccorsdomain "*" )

Then I create a new account using web3.personal.newAccount('password')

Then I am send 0.01 ether this account but when Y trying get balance using web3.eth.getBalance('address') it shows 0 ether I trying this also web3.fromWei(web3.eth.getBalance('0x537eda319150390c2daf11d09d5840cf3bf06344'), 'ether').toNumber(10)

Then I trying to deploy using truffle migrate --reset --network live it gives an Error: exceeds block gas limit.

  • 2
    Why are you using the main-net? first try it on test net and if it works there then try it on main. I will suggest you to use www.remix.ethereum.org over truffle. – user19060 Jun 25 '18 at 11:33
  • i successfully test on rinkeby network its works fine. but i'm trying to deploy in main network it gives an error rinkeby.etherscan.io/token/… – Rohit Sahu Jun 25 '18 at 11:53

take a closer look at the gas default in the truffle migration script for your contract and increase the gas limit ie (number)_contract.js

// Set a maximum amount of gas and from address for the deployment deployer.deploy(A, {gas: 4612388, from: "0x...."}); call to the deployer.deply API

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.