0

I am trying to send a signed transaction using web3.eth.sendSignedTransaction(). Everything seems to be working ok for my other web3 methods, but I am having trouble setting the gas for this. When calling it I get the message:

"Error: Returned error: Transaction cost exceeds current gas limit. Limit: 5000, got: 47100. Try decreasing supplied gas."

So I try setting it to 5000 then get the following error:

"Error: Returned error: Transaction gas is too low. There is not enough gas to cover minimal cost of the transaction (minimal: 53400, got: 5000). Try increasing supplied gas."

What could I doing wrong here?

0

It seems you are in a private testnet you need to increment the block gas limit, currently is set to 5000 and you need at least 47100.

How to set the block gas limit depends on the client you are using.

  • Geth has a --targetgaslimit XXX.

  • Ganache has a --gasLimit XXX.

  • Parity has --gas-floor-target=XXX.

In Ethereum the block gas limit can change only 10% per block. If you want to jump from 5k to 50k you have to generate around 8 blocks until the new limit is reached. If you a private testnet you can edit your genesis file and recreate the blockchain to not have to wait until enough block has been mined, but you will lose old transactions.

  • I'm facing a similar issue on Rinkeby network. Getting either "insufficient funds for gas * price + value" or "exceeds block gas limit" Any suggestions? – Anistark Dec 4 '18 at 9:03
  • Either you do not have enough ether to pay for the deployment, or your contract deployment gas is too high. For the first you have to request more ether from a faucet, for the second you have to slim down your contract (remove some functionality, use other contracts or a library). – Ismael Dec 4 '18 at 14:29
  • Gas Estimate shows: 32872 Balance on the account: 1100000 Gwei gas using: 187200 I think that should be more than enough. – Anistark Dec 5 '18 at 5:17
  • @Anistark It is better if you create a new question. – Ismael Dec 5 '18 at 5:58

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.