LoginSignup
3
1

More than 5 years have passed since last update.

プライベートEthereum ネットワークにでっかいTransactionを流したらエラー

Last updated at Posted at 2017-06-20

原因

でかいトランザクションをながしたら、ガスが足りない。

Error: Intrinsic gas too low at Object.module.exports.InvalidResponse (/root/ethereum_util/commentoken/node_modules/web3/lib/web3/errors.js:38:16) at RequestManager.send (/root/ethereum_util/commentoken/node_modules/web3/lib/web3/requestmanager.js:61:22) at Eth.send as sendTransaction at SolidityFunction.sendTransaction (/root/ethereum_util/commentoken/node_modules/web3/lib/web3/function.js:167:26) at SolidityFunction.execute (/root/ethereum_util/commentoken/node_modules/web3/lib/web3/function.js:253:37) at Object. (/root/ethereum_util/commentoken/commentoken.js:23:13) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)

解決方法

単純にリクエストを送る時に十分なガス量を指定していなかったことが原因でした。
(実際にはcommentに大サイズのオブジェクトを渡してます。)

app.js(error)
// Construct a query request
contract.sendCoin("0xd47adfb65b14a24781bdef68e60011c6e7ac4b5c", amount, comment});
fix_app.js
// Construct a query request
contract.sendCoin("0xd47adfb65b14a24781bdef68e60011c6e7ac4b5c", amount, comment, { gas: 400000000 });

試したこと

  • genesis.jsonでgaslimitを大きくした。 /ダメ
  • genesis.jsonでトランザクションを実行するアカウントに多額の初期etherを与えた。 /ダメ
genesis.json
{
    "nonce": "0x0000000000000042",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x400000",
    "alloc": {
        "0x008ef4688faefa1caaf9397fb4f31bed5665033b": { "balance": "100000000000000000000000000000000000000" }
    },
    "coinbase": "0x0000000000000000000000000000000000000000",
    "timestamp": "0x00",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "Custem Ethereum Genesis Block",
    "gasLimit": "0xffffffff"
}

些細なことでした。

3
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1