gpt4 book ai didi

blockchain - 迁移耗尽气体

转载 作者:行者123 更新时间:2023-12-05 03:58:58 28 4
gpt4 key购买 nike

您好,我正在使用 Geth,我尝试使用 truffle migrate,但它会出错。truffle-config.js 如下:

development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "4", //rinkeby id
from:"my address",
gas: 1000
}

当我使用命令 -truffle migrate 执行 truffle migrate 时,出现此错误。

 Error: Error: Error:  *** Deployment Failed ***
"Migrations" ran out of gas (using a value you set in your network
config or deployment parameters.)
* Block limit: 0x50e7c
* Gas sent: 1000

at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:92:1)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

你能帮帮我吗?

最佳答案

我通过将这段代码添加到 truffle 配置文件中解决了这个错误。

   compilers: {
solc: {
version: "0.5.16",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000, // Default: 200
},
},
},
},

关于blockchain - 迁移耗尽气体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57534021/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com