[Ethereum] Truffle: Contract transaction couldn’t be found after 50 blocks

gastestnetstruffle

I'm trying to deploy a contract to the Ropsten testnet via the truffle console. In my truffle.js file, I set the gas parameter to gas: 4700000. When I run migrate –reset, I always get this error no matter how much gas I send during the deploy in 2_deploy_contracts.js:

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
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/contract.js:112:30
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/filter.js:120:21
    at Array.forEach (native)
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/filter.js:119:32
    at Array.forEach (native)
    at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/filter.js:117:22)
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:259:20
    at Array.forEach (native)
    at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:258:12
    at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:118:13)

The contract works properly on testrpc and was successfully deployed via the Remix IDE. I could find it on Etherscan and it looks like the gas estimate was around 1700000.

Best Answer

Resolved -- you must make sure that your node is synced up with the network. In my case, I was on the ropsten testnet. The latest block is at 17 million and my node was still at 15 million.

Related Topic