I am getting an error for exceeding gas limit.

I checked current block gas limit by running - eth.getBlock("latest"). It is set to 5000.

I want to increase this, but I have no idea how to. I have checked this old thread: Can't send transaction -- "Exceeds block gas limit" or "Intrinsic gas too low"

It says I should edit the genesis file, but how?

  • Hi there. Just to check, are you talking about your own private network, or do you want to do this to solve a problem you're hitting on one of the public networks? Oct 26 '17 at 16:11
  • Public Network I think. Basically I am trying to to run a automated script that will send a tx every 10 minutes. All my previous interaction with Ethereum is with a GUI. So I have no idea what I am doing with geth or command line. I downloaded geth for windows 64 and ran it. Then I used command line to send a tx. But it gave me a error for exceeding gas limit. I found a thread that said I had to check my gaslimit by running - eth.getBlock("latest"). I did that and it said 5000. I think I need to change that. But no idea if editing the genesis file is correct or how to. Oct 26 '17 at 17:15
  • Okay, if it's a public network, then there's no way you can change any of the Genesis values (and this isn't necessarily the best thing to do in a testnet anyway). Do you, or someone you're working with, own the network you're testing on? How have you accessed the network so far? Through which GUI? Oct 26 '17 at 17:48
  • I think my knowledge deficit is too great for what I am trying to do. I am just using geth.exe and I typed "attached geth" in command line. I put a wallet file in the keystore folder and I want to send a real transaction through but I get that limit error. Is there another piece of software that I need in order for me to send a tx? I was under the impression that I could do everything from just geth and command line. Sorry I have no dev experience. I do not know anything about networks, all i am trying to do is send a tx using geth. Oct 26 '17 at 17:56
  • I found out that I have to sync with the network and that was my problem. Oct 26 '17 at 18:32

On geth the default gas is actually 90000 https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L47

For geth genesis.json this is set via the gasLimit option, so you can set it to the maximum: "gasLimit": "0x47e7c4"

Additionally you'll need to make sure you're sending enough gas with your transaction itself.

  • Thank you for the response. I actually do not know how to set the gaslimit option. What do I type into command line to set the "gaslimit':0x47e7c4" Apologies I am a complete newb Oct 26 '17 at 15:32
  • It's a genesis.json option, so you need to add it there. If you don't know how to, share your genesis.json here. Oct 26 '17 at 16:17

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.