GN.*_*GN. 5 ethereum smartcontracts truffle consensys-truffle
为什么使用 Truffle 部署到主网如此困难?
这是尝试部署到主网的概述......
110000000000 wei让我们插上它..
mainnet: {
provider: () =>
new HDWalletProvider({
mnemonic: { phrase: process.env.MNEMONIC },
providerOrUrl: process.env.RPC_URL_1_WSS,
}),
network_id: 1,
from: process.env.DEPLOYERS_ADDRESS,
gasPrice: 110000000000, /* GAS PRICE!! */
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: false, public nets )
},
},
Run Code Online (Sandbox Code Playgroud)
gas参数中设置truffle-config。NODE_ENV=production truffle migrate --network mainnet --dry-run
Summary
=======
> Total deployments: 2
> Final cost: 0.001403824 ETH
Run Code Online (Sandbox Code Playgroud)
0.001403824 ETH 是 2.04 美元。
所以这很可能是错误的。
??失败??
gas留空并尝试仅使用gasPrice.结果在..
Message: insufficient funds for gas * price + value
??失败??
dry-run没有对部署的合同成本给出有用的估计,我只是根据其他合同进行猜测。将在gas这里添加参数。mainnet: {
provider: () =>
new HDWalletProvider({
mnemonic: { phrase: process.env.MNEMONIC },
providerOrUrl: process.env.RPC_URL_1_WSS,
}),
network_id: 1,
from: process.env.DEPLOYERS_ADDRESS,
gasPrice: 110000000000, /* GAS PRICE!! */
gas: 140000000000000000, / That's about $200 in Wei/
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: false, public nets )
},
},
Run Code Online (Sandbox Code Playgroud)
RuntimeError: abort(Error: Assertion failed). Build with -s ASSERTIONS=1 for more info..
??再次失败??
gas和gasPrice空白..Block timesout in 750 seconds.
??失败??
尝试混音..
这很棒,但现在我没有使用 Truffle 的迁移,并且将 Remix ABI 与 Truffle 一起使用也不是那么容易。
我真的很喜欢松露只是工作。
为什么 Truffle 在部署到主网时很难使用?无法部署到主网。