Truffle

無法使用 truffle.js 將合約遷移到 Kovan(儘管 testrpc 和 dev 鏈有效)

  • September 27, 2017

我在將契約部署到 kovan 時遇到問題。我能夠部署到 testrpc 以及奇偶校驗開發鏈,但完全相同的過程在 kovan 上失敗了。契約掛在:

Running migration: 1_initial_migration.js
Deploying Migrations...

然後失敗:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
   Error: Contract transaction couldn't be found after 50 blocks

我的松露.js:

// Allows us to use ES6 in our migrations and tests.
require('babel-register')
module.exports = {
   networks: {
       kovan:{
           network_id: '*',
           host:'localhost',
           port:8545,
           from:'MY_KOVAN_CHAIN_ADDRESS'
       },
       development: {
           host: 'localhost',
           port: 8545,
           network_id: '*', // Match any network id
           from:'MY_DEV_CHAIN_ADDRESS'
       }
  }
}

我正在執行:

truffle migrate --network kovan

將奇偶校驗連接到 kovan 鏈後:

parity --geth --chain kovan --force-ui --reseal-min-period 0 --jsonrpc-cors http://localhost

相同的命令適用於開發鏈(在 truffle 命令中將 kovan 替換為 development,在 parity 命令中將 kovan 替換為 dev)

以供參考:

parity --version
Parity
 version Parity/v1.6.8-beta-c396229-20170608/x86_64-linux-gnu/rustc1.17.0
Copyright 2015, 2016, 2017 Parity Technologies (UK) Ltd

truffle --v
Truffle v3.2.5 - a development framework for Ethereum

我還使用 truffle console –network kovan (類似地在開發鏈上)解鎖了 kovan 網路上的帳戶,所以這不是問題。

我可以在奇偶校驗 Web UI 中看到需要簽名的交易,我可以對其進行簽名,但沒有任何反應。

任何幫助表示讚賞!

謝謝!

在幫助對 ICO 進行故障排除後終於找到了答案(這似乎是很多人都遇到的錯誤),請參閱本文以獲取 gas 價格錯誤的解決方案。

掛起是由於沒有以平價方式簽署交易。

失敗消息是錯誤的,實際上正在部署合約,由於 kovan 網路很慢,我只是很長時間沒有看到它們。在 etherscan 中沒有看到它們以及立即出現的松露錯誤讓我認為它沒有被部署。

調試此問題的一種有用方法是平價交易查看器 dapp,您可以看到您的交易何時被成功探勘,即使它尚未顯示在 etherscan 中。

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