使用 truffle 迁移时如何禁用 750 秒超时?

How can I disable the 750 second timeout when migrating with truffle?

我正在尝试使用 truffle.js 将我的智能合约部署到以太坊主网。低 gas price 迁移时,部署合约的交易有时会超过 750 秒,导致 truffle 超时。

在将智能合约部署(迁移)到主网时,有什么方法可以禁用 750 秒超时吗?我想以低 gas 价格部署我的合约以降低成本,并且可以接受长时间等待 TX 被开采。

此外,如果超时并且 TX 稍后被开采,我是否仍可以为 TX 生成完全相同的工件文件?谢谢。

Is there some way to disable the 750 second timeout when deploying smart contracts (migrating) to the mainnet? I would like to deploy my contract with a low gas price to reduce the cost, and am ok with waiting a long time for the TX to be mined.

没有。 Truffle 使用默认等待设置为 50 个块的 web3 库。 (因此它将等待 50 个区块,以便在超时之前挖掘 tx)。您可能会通过大量增加它来实现您想要的 - 请参阅:https://www.trufflesuite.com/docs/truffle/reference/configuration

但是,当 gas 价格设置得非常低时,网络上的矿工可能永远不会捡到它。因此,如果没有超时,进程可能会永远挂起。

Also, if the timeout IS hit and the TX gets mined later, can I still generate the same exact artifact files for the TX? Thanks.

我不确定你在这里的意思。编译合约后生成工件文件。也许您指的是获取交易哈希?最好检查像 etherscan 或 trueblocks 这样的服务来了解你的交易状态。