简体   繁体   中英

Intrinsic gas too low and exceeds block limit

I am trying to create and broadcast a raw transaction on the ethereum testnet network as this would allow for a more lightweight application that can run without a full node. I am trying to broadcast a raw transaction but it is not working because of the issues specified in the title. I have altered the gas price and limit but it makes the same issues.

function createRawTransacton(){
var privateKey = new Buffer('d3780dd620ef80b3918dfcdb9105f76147fc55a3775ff71805ccec09a89063ed', 'hex')
var rawTx = {
   nonce: 'CX350',
   gasPrice: 'C350',
   gasLimit: '0x09184e72a000',
   to: '0xc5622be5861b7200cbace14e28b98c4ab77bd9b4',
   value: 'CX350',
   data: '0x19dacbf83c5de6658e14cbf7bcae5c15eca2eedecf1c66fbca928e4d351bea0f'
}
var tx = new Tx(rawTx)
tx.sign(privateKey)
var serializedTx = tx.serialize()
console.log(serializedTx.toString('hex'))
broadCastTx(serializedTx.toString('hex'))
}

If anyone also has information on executing contract functions with this raw transaction than that would also be great. Thank you.

If you are talking about the public testnet (morden), the default block gas limit is 4,712,388 (4.7 million).

Your raw transaction is set to limit:

gasLimit: '0x09184e72a000',

Which is 10^13 (10 trillion). That's why you get 'Exceeds block gas limit'. Try to set your gas limit to 4 million:

gasLimit: '0x3d0900',

See also this question on Ethereum Stack Exchange .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM