无法运行 truffle@2.1.2 migrate --network live。“超出区块气体限制”

Kno*_*lor 5 ethereum truffle consensys-truffle parity-io

我正在使用 truffle@2.1.2 针对 rpc 部署智能合约,使用已在 geth 控制台上localhost:8545 geth@1.5.9-stable解锁的 Ether 资助的帐户。personal.unlockAccount

\n\n

我还通过 RPC 对远程 Parity 节点进行了相同的尝试,但这是我相当坚持的最新版本。

\n\n

松露.js

\n\n
module.exports = {\n  build: {\n    "index.html": "index.html",\n    "app.js": [\n      "javascripts/app.js"\n    ],\n    "app.css": [\n      "stylesheets/app.css"\n    ],\n    "images/": "images/"\n  },\n  rpc: {\n    host: "localhost",\n    port: 8545\n  },\n  networks: {\n    "ropsten": {\n      network_id: 3,\n      port: 8548, // ssh tunnelled to AWS geth/parity node localhost:8545\n      from: "0x4f000Bcf4641E2fDcE85BF26A694b053996850D4"\n    },\n    "live": {\n      network_id: 1,\n      port: 8545,\n      from: "0x00269400181f1B379784BD8cDF786bb20e91Bdef",\n      gas: 4612388,\n      gasPrice: 2776297000 // taken from Parity startup log message "Updated conversion rate to \xce\x9e1 = US$42.88 (2776297000 wei/gas)"\n    }\n  }\n};\n
Run Code Online (Sandbox Code Playgroud)\n\n

松露迁移——网络直播

\n\n
Running migration: 1_initial_migration.js\n  Deploying Migrations...\nError encountered, bailing. Network state unknown. Review successful transactions manually.\nError: Exceeds block gas limit\n    at Object.module.exports.InvalidResponse (/home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/web3/lib/web3/errors.js:35:16)\n    at /home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/web3/lib/web3/requestmanager.js:86:36\n    at request.onreadystatechange (/home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:114:13)\n    at dispatchEvent (/home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)\n    at setState (/home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)\n    at IncomingMessage.<anonymous> (/home/ubuntu/.nvm/versions/node/v6.2.1/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)\n    at emitNone (events.js:91:20)\n    at IncomingMessage.emit (events.js:185:7)\n    at endReadableNT (_stream_readable.js:926:12)\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\n    at process._tickDomainCallback (internal/process/next_tick.js:122:9)\n
Run Code Online (Sandbox Code Playgroud)\n\n

我尝试过调整gas和gasPrice,但无法找到有任何影响的值。

\n\n

我该如何解决这个问题,或者我应该研究其他的合同部署方法吗?

\n\n

亲切的问候。

\n

Kno*_*lor 4

gas: 3000000我只需在网络配置中设置即可解决此问题。

"live": {
  network_id: 1,
  port: 8545,
  from: "0x00269400181f1B379784BD8cDF786bb20e91Bdef",
  gas: 3000000
}
Run Code Online (Sandbox Code Playgroud)

运行迁移的成本约为 0.5 ETH,并且需要几分钟时间。