Contract-Deployment

Truffle 遷移部署:交易未在 50 個區塊內開採

  • June 18, 2020

我正在執行我自己的乙太坊客戶端節點(打開乙太坊 3.0.1)。我正在使用 Truffle migrate 將我的智能合約部署到 MainNet。但是,合約部署耗時太長。遷移命令的結果如下:

kevins-mbp:AuthentoFile_Repo kevinm$ truffle migrate --network mainnet --reset

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.


Migrations dry-run (simulation)
===============================
> Network name:    'mainnet-fork'
> Network id:      1
> Block gas limit: 9990236 (0x98705c)

1_initial_migration.js
======================

  Deploying 'Migrations'
  ----------------------
  > block number:        10288818
  > block timestamp:     1592471208
  > account:             0xaAF66209133056F1f7285D6cDb61Cf21D135f300
  > balance:             0.1797474439
  > gas used:            210237 (0x3353d)
  > gas price:           2 gwei
  > value sent:          0 ETH
  > total cost:          0.000420474 ETH

  -------------------------------------
  > Total cost:         0.000420474 ETH

2_deploy_contracts.js
=====================

  Deploying 'AuthentoFile'
  ------------------------
  > block number:        10288820
  > block timestamp:     1592471211
  > account:             0xaAF66209133056F1f7285D6cDb61Cf21D135f300
  > balance:             0.1769681859
  > gas used:            1362266 (0x14c95a)
  > gas price:           2 gwei
  > value sent:          0 ETH
  > total cost:          0.002724532 ETH

  -------------------------------------
  > Total cost:         0.002724532 ETH

Summary
=======
> Total deployments:   2
> Final cost:          0.003145006 ETH


Starting migrations...
======================
> Network name:    'mainnet'
> Network id:      1
> Block gas limit: 9990236 (0x98705c)


1_initial_migration.js
======================

  Deploying 'Migrations'
  ----------------------
  > transaction hash:    0x77eac6bee9baeb315e7e52d31d13a9ab4241676c2ec2b4a5e7cf2071281ffe1a


Error:  *** Deployment Failed ***

"Migrations" -- Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!.

   at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:364:1
   at runMicrotasks (<anonymous>)
   at processTicksAndRejections (internal/process/task_queues.js:85:5)

如您所見,合約部署尚未完成。我執行了 2 次,所以現在我有以下待處理的交易(至少 8 小時以上)。這些待處理 tx 的 tx 雜湊是:

  • 0xc0a28527f1fcebc0bdf9ae18479831eaf026b350420a3134bcd14b44f520b812
  • 0x77eac6bee9baeb315e7e52d31d13a9ab4241676c2ec2b4a5e7cf2071281ffe1a

這些交易會被探勘嗎?在我的乙太坊節點上,我將這些視為待處理交易。我的乙太坊客戶端未配置為進行任何探勘,所以我假設網路上的礦工最終會嘗試探勘這些交易?

任何幫助/見解將不勝感激。

這是一個天然氣價格問題。

根據您正在使用的 EtherScan:

0.00000002 Ether (20 Gwei)

根據 EthGasStation.info,目前低於安全低點:

在此處輸入圖像描述

除非你想參與取消舊交易的困難遊戲,否則我建議你創建一個新的乙太坊賬戶並嘗試從那里以更高的 gas 價格部署合約。

好吧,那怎麼樣!我的乙太坊主網合約部署完成!開採需要10多個小時。我想這都是關於 GasPrice 的。

https://etherscan.io/tx/0xc0a28527f1fcebc0bdf9ae18479831eaf026b350420a3134bcd14b44f520b812

引用自:https://ethereum.stackexchange.com/questions/84365