Truffle – Unable to Migrate Contracts to Kovan Using Truffle.js

kovanparitytestnetstruffletruffle-migration

I'm having problems deploying contracts to kovan. I'm able to deploy to testrpc, as well as the parity dev chain, but the exact same process fails on kovan. The contract hangs at:

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

Then fails with:

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

my truffle.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'
        }
   }
}

and I'm running:

truffle migrate --network kovan

after connecting parity to the kovan chain with:

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

The same commands work with the dev chain (replace kovan with development in the truffle command, and kovan with dev in the parity command)

For reference:

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

I've also unlocked the account on the kovan network using truffle console –network kovan (similarly on the development chain), so that isn't the problem.

I can see the transaction needing signed in the parity web UI, and I can sign it, but nothing happens.

Any help appreciated!

Thanks!

Best Answer

Finally found an answer for this after helping troubleshoot an ICO (it seems this is an error many people are having), see this article for a solution to gas price errors.

The hanging is due to not signing the transaction in parity.

The failure message is errant, the contracts were actually being deployed, I just wasn't seeing them for a long time since the kovan network is slow. Not seeing them in etherscan coupled with the immediate truffle error made me assume it wasn't being deployed.

One helpful way to debug this is the transaction viewer dapp in parity, you can see when your transaction has successfully been mined, even if it isn't showing in etherscan yet.

Related Topic